Skip to content

Joda Recipe Nullpointer Exception #624

@christopherfischer

Description

@christopherfischer

What version of OpenRewrite are you using?

I am using

  • Maven CLI 3.9.6
  • rewrite-migrate-java-2.30.1

How are you running OpenRewrite?

I am using the Maven CLI , and my project is a multi module project.
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.migrate.joda.JodaTimeRecipe -Drewrite.exportDatatables=true

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

java.lang.NullPointerException: Cannot invoke "org.openrewrite.java.tree.JavaType.isAssignableFrom(java.util.regex.Pattern)" because the return value of "org.openrewrite.java.tree.J$VariableDeclarations.getType()" is null
[ERROR]   org.openrewrite.java.migrate.joda.JodaTimeVisitor.visitVariableDeclarations(JodaTimeVisitor.java:73)
[ERROR]   org.openrewrite.java.migrate.joda.JodaTimeVisitor.visitVariableDeclarations(JodaTimeVisitor.java:35)
[ERROR]   org.openrewrite.java.tree.J$VariableDeclarations.acceptJava(J.java:5808)
[ERROR]   org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:250)
[ERROR]   org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:320)
[ERROR]   org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1367)
[ERROR]   org.openrewrite.java.JavaVisitor.lambda$visitLambda$16(JavaVisitor.java:789)
[ERROR]   org.openrewrite.internal.ListUtils.map(ListUtils.java:243)
[ERROR]   org.openrewrite.internal.ListUtils.map(ListUtils.java:265)
[ERROR]   org.openrewrite.java.JavaVisitor.visitLambda(JavaVisitor.java:788)
[ERROR]   org.openrewrite.java.tree.J$Lambda.acceptJava(J.java:3191)
[ERROR]   org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:250)
[ERROR]   org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:320)
[ERROR]   org.openrewrite.java.JavaVisitor.visitRightPadded(JavaVisitor.java:1367)

Are you interested in contributing a fix to OpenRewrite?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions