in src/test/java/org/openrewrite/staticanalysis/ReplaceCollectionToArrayArgWithEmptyArrayTest.java
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray$ReplaceCollectionToArrayArgWithEmptyArrayVisitor.lambda$visitNewArray$0(ReplaceCollectionToArrayArgWithEmptyArray.java:79)
at org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray$ReplaceCollectionToArrayArgWithEmptyArrayVisitor$$Lambda/0x000000f00146e550.apply(Unknown Source)
at org.openrewrite.internal.ListUtils.mapFirst(ListUtils.java:166)
at org.openrewrite.internal.ListUtils.mapFirst(ListUtils.java:183)
at org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray$ReplaceCollectionToArrayArgWithEmptyArrayVisitor.visitNewArray(ReplaceCollectionToArrayArgWithEmptyArray.java:68)
at org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray$ReplaceCollectionToArrayArgWithEmptyArrayVisitor.visitNewArray(ReplaceCollectionToArrayArgWithEmptyArray.java:61)
What version of OpenRewrite are you using?
OR current main (7edbbf01ab8a9b666ef3c2003ee7b8e0c66a4967)
rewrite-static-analysis (428d8b0)
What is the smallest, simplest way to reproduce the problem?
in src/test/java/org/openrewrite/staticanalysis/ReplaceCollectionToArrayArgWithEmptyArrayTest.java
Observed
OSS repro