File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
main/java/org/openrewrite/java/migrate/lang/var
test/java/org/openrewrite/java/migrate/lang/var Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,6 @@ public static boolean initializedByStaticMethod(@Nullable Expression initializer
224224 return false ;
225225 }
226226
227- return invocation .getMethodType ().getFlags (). contains (Flag .Static );
227+ return invocation .getMethodType ().hasFlags (Flag .Static );
228228 }
229229}
Original file line number Diff line number Diff line change @@ -313,6 +313,7 @@ void m() {
313313 @ Issue ("https://github.com/openrewrite/rewrite-migrate-java/issues/550" )
314314 void genericType () {
315315 rewriteRun (
316+ //language=java
316317 java (
317318 """
318319 import java.io.Serializable;
@@ -348,6 +349,7 @@ class NotApplicable {
348349 void genericTypeInStaticMethod () {
349350 // ATM the recipe skips all static method initialized variables
350351 rewriteRun (
352+ //language=java
351353 java (
352354 """
353355 package example;
@@ -360,7 +362,7 @@ static <T> T cast(Object o) {
360362 class User {
361363 public String test() {
362364 Object o = "Hello";
363- String string = Global.cast(o);
365+ String string = Global.cast(o); // static method unchanged
364366 return string;
365367 }
366368 }
@@ -376,7 +378,7 @@ static <T> T cast(Object o) {
376378 class User {
377379 public String test() {
378380 var o = "Hello";
379- String string = Global.cast(o);
381+ String string = Global.cast(o); // static method unchanged
380382 return string;
381383 }
382384 }
You can’t perform that action at this time.
0 commit comments