diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/search/SemanticallyEqualTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/search/SemanticallyEqualTest.java index bbf05ab2480..739db1ef362 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/search/SemanticallyEqualTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/search/SemanticallyEqualTest.java @@ -76,22 +76,31 @@ class A { void compareFieldAccess() { assertExpressionsEqual( """ - class A { + class T { int n = 1; - int a = A.this.n; - int b = A.this.n; + int a = T.this.n; + int b = T.this.n; } """ ); assertExpressionsEqual( """ - class A { + class T { int n = 1; - int a = A.this.n; + int a = T.this.n; int b = this.n; } """ ); + assertExpressionsEqual( + """ + class T { + int n = 1; + int a = T.this.n; + int b = n; + } + """ + ); } private void assertEqualToSelf(@Language("java") String a) {