From 552516c0885eacb480b51ca3054d8717198bf368 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Sat, 16 Dec 2023 21:21:34 +0100 Subject: [PATCH] Polish --- .../java/search/SemanticallyEqualTest.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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) {