Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in GitProvenance #3593

Closed
Bananeweizen opened this issue Oct 1, 2023 · 1 comment
Closed

NPE in GitProvenance #3593

Bananeweizen opened this issue Oct 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Bananeweizen
Copy link
Contributor

This one is not from USING OpenRewrite, but from building the maven plugin 5.8.0-SNAPSHOT from current head. One of the tests triggers an NPE in core code.

What is the smallest, simplest way to reproduce the problem?

cd rewrite-maven-plugin
mvn verify

What is the full stack trace of any errors you encountered?

[INFO] Running org.openrewrite.maven.MavenMojoProjectParserTest
[debug] Unable to determine git provenance

java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toFile()" because "projectDir" is null
        at org.openrewrite.marker.GitProvenance.fromGitConfig(GitProvenance.java:187)
        at org.openrewrite.marker.GitProvenance.fromProjectDirectory(GitProvenance.java:175)
        at org.openrewrite.maven.MavenMojoProjectParser.gitProvenance(MavenMojoProjectParser.java:647)
        at org.openrewrite.maven.MavenMojoProjectParser.generateProvenance(MavenMojoProjectParser.java:263)
        at org.openrewrite.maven.MavenMojoProjectParserTest.givenNoJavaVersionInformationExistsInMavenThenJavaSpecificationVersionShouldBeUsed(MavenMojoProjectParserTest.java:29)

Are you interested in contributing a fix to OpenRewrite?

Not this one. I'm not sure what would be reasonable here for the null case.

@timtebeek
Copy link
Contributor

Thanks for pointing this one out! Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants