You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rewriteRun-tests on a recipe that rewrites J.MethodInvocation arguments of type Map<?, ?> throw
java.lang.IllegalStateException: LST contains missing or invalid type information
MethodInvocation->Block->MethodDeclaration->Block->ClassDeclaration->CompilationUnit
/*~~(MethodInvocation type is missing or malformed)~~>*/SomeClassWithGenericMethod.someSimilarMethod(map)
for now apparent reason 🤷 – the recipe can be built, installed and run against existing code fine.
This happens on a final pass at org.openrewrite.java.Assertions.assertValidTypesafter the before/after assertion has passed – if it doesn't, the tests fail as usual with the diff.
Example
I have assembled the most minimal example was able to unpack here:
This happens on OpenRewrite 8.28.1
rewriteRun
-tests on a recipe that rewritesJ.MethodInvocation
arguments of typeMap<?, ?>
throwfor now apparent reason 🤷 – the recipe can be built, installed and run against existing code fine.
This happens on a final pass at
org.openrewrite.java.Assertions.assertValidTypes
after the before/after assertion has passed – if it doesn't, the tests fail as usual with the diff.Example
I have assembled the most minimal example was able to unpack here:
lstError_example1_methodInvocationType
lstError_example2_methodInvocationType
lstError_example3_methodInvocationType
With the accompanying Recipe GenericsLstIssue
This may happen with other unbounded wildcard types, needs further investigation.
Workaround
Configuring the
RewriteTest#defaults()
withrewrite/rewrite-java-test/src/test/java/org/openrewrite/java/format/MethodParamPadTest.java
Line 333 in 0c7f396
disables the final check which apparently triggers this warning (thanks @knutwannheden for pointing this out).
The text was updated successfully, but these errors were encountered: