From 26cc3f3e984682c18d38e88d0ee0ff585e67165d Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Thu, 25 Jul 2024 22:43:12 +0200 Subject: [PATCH] Fixed tests failing after requiring minimal 1.8 compliance, part 4 - PullUpTests - InlineTempTests (all except test31()) - InlineConstantTests1d7 - ExtractMethodTests - ExtractInterfaceTests See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2536 --- .../resources/ExtractInterface/test108/out/A.java | 1 + .../ExtractMethodTests/destination_out/A_test1059.java | 8 ++++---- .../ExtractMethodTests/destination_out/A_test1060.java | 6 +++--- .../resources/InlineConstant/canInline17/test0/out/C.java | 2 +- .../resources/InlineTemp/canInline/A_test37_out.java | 2 +- .../resources/InlineTemp/canInline/A_test38_out.java | 2 +- .../resources/InlineTemp/canInline/A_test39_out.java | 2 +- .../resources/PullUp/test46/out/A.java | 1 + .../resources/PullUp/test47/out/A.java | 1 + .../resources/PullUp/test51/out/A.java | 1 + .../resources/PullUp/test52/out/A.java | 4 ++++ .../resources/PullUp/test53/out/A.java | 1 + 12 files changed, 20 insertions(+), 11 deletions(-) diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface/test108/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface/test108/out/A.java index 5aa6edc9044..80436890925 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface/test108/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractInterface/test108/out/A.java @@ -1,6 +1,7 @@ package p; public class A implements I { + @Override public void m() { for (A a : getCollection()) { a.abc(); diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1059.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1059.java index 29504e965d4..9ac7126f5b3 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1059.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1059.java @@ -4,10 +4,10 @@ public class A_test1059 { interface B { @interface C { int i= /*[*/extracted();/*]*/ - } - } + } - protected static int extracted() { - return 0; + static int extracted() { + return 0; + } } } \ No newline at end of file diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1060.java b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1060.java index dee74a668f7..a5117650dc9 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1060.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/destination_out/A_test1060.java @@ -7,9 +7,9 @@ int foo() { return extracted(); } } - } - protected static int extracted() { - /*[*/return 0;/*]*/ + static int extracted() { + /*[*/return 0;/*]*/ + } } } \ No newline at end of file diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline17/test0/out/C.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline17/test0/out/C.java index 2217fe85083..914c09918bd 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline17/test0/out/C.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline17/test0/out/C.java @@ -9,7 +9,7 @@ public C(T param){ field1 = param; } public static void main(String[] args) { - C.testFunction(new C(null).getField()); + C.testFunction(new C<>(null).getField()); } public static void testFunction(String param){ System.out.println("S " + param); diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test37_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test37_out.java index 6e7401ad50e..e7bb98b66e7 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test37_out.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test37_out.java @@ -2,7 +2,7 @@ class A { String x() { - return A.bar(); + return bar(); } static T bar() { diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test38_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test38_out.java index d603f015e92..1988751a75a 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test38_out.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test38_out.java @@ -2,7 +2,7 @@ class A { String x() { - return this.bar(); + return bar(); } T bar() { diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test39_out.java b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test39_out.java index 6ae975fda21..4fb99c96239 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test39_out.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test39_out.java @@ -2,7 +2,7 @@ class A extends Super { String x() { - return super.bar(); + return super.bar(); } T bar() { diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test46/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test46/out/A.java index e418cf58b75..83492bc7ade 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test46/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test46/out/A.java @@ -7,6 +7,7 @@ interface A{ } class B implements A { + @Override public int getConst() { return CONST; } diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test47/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test47/out/A.java index e2c42ed8696..6bc1cba7625 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test47/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test47/out/A.java @@ -4,6 +4,7 @@ public interface A { void method(); } class B implements A { + @Override public final void method() { } diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test51/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test51/out/A.java index 8802828dc72..3f338bf6d2a 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test51/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test51/out/A.java @@ -4,6 +4,7 @@ public class A implements B.Foo { + @Override public void b() { List l = null; } diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test52/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test52/out/A.java index eb7c39a5e92..7cdb1bb86b3 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test52/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test52/out/A.java @@ -43,12 +43,16 @@ interface Foo { } static class B implements Foo { + @Override public void baz1() { } + @Override public void baz2() { } + @Override public void baz3() { } + @Override public void baz4() { } } diff --git a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test53/out/A.java b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test53/out/A.java index 61d4ac49352..3b2447a0382 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test53/out/A.java +++ b/org.eclipse.jdt.ui.tests.refactoring/resources/PullUp/test53/out/A.java @@ -4,6 +4,7 @@ interface A{ int[] m()[]; } class B implements A{ + @Override public int[] m()[] { return null; }