diff options
author | Stephan Herrmann | 2018-08-18 04:03:42 -0400 |
---|---|---|
committer | Stephan Herrmann | 2018-08-18 04:04:06 -0400 |
commit | b4f5a4322b2aaab402c8c978d378954486b00c76 (patch) | |
tree | 11635e4f2bd461c5d603406ce246099737e364d9 | |
parent | 97b95fa05a64615fc7296744b69bd741cc4af2c7 (diff) | |
download | eclipse.jdt.core-b4f5a4322b2aaab402c8c978d378954486b00c76.tar.gz eclipse.jdt.core-b4f5a4322b2aaab402c8c978d378954486b00c76.tar.xz eclipse.jdt.core-b4f5a4322b2aaab402c8c978d378954486b00c76.zip |
Bug 404648 - [1.8][compiler] investigate differences between ECJ & JavacI20180818-1500
- excuses in LookupTest
Change-Id: I3a88dc7794aaf18aec62b811e8df49aab459e5fa
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java index 5672a40388..02219e9101 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java @@ -3320,7 +3320,8 @@ public void test103() { Map options = getCompilerOptions(); CompilerOptions compOptions = new CompilerOptions(options); if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return; - this.runNegativeTest( + Runner runner = new Runner(); + runner.testFiles = new String[] { "A.java",//------------------------------ "public class A {\n" + @@ -3337,7 +3338,8 @@ public void test103() { " private int x;\n" + " }\n" + " }\n", - }, + }; + runner.expectedCompilerLog = "----------\n" + "1. WARNING in A.java (at line 2)\n" + " private int x;\n" + @@ -3368,14 +3370,17 @@ public void test103() { " private int x;\n" + " ^\n" + "The value of the field A.C.x is not used\n" + - "----------\n"); + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956 public void test104() { Map options = getCompilerOptions(); CompilerOptions compOptions = new CompilerOptions(options); if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return; - this.runNegativeTest( + Runner runner = new Runner(); + runner.testFiles = new String[] { "A.java",//------------------------------ "public class A {\n" + @@ -3392,7 +3397,8 @@ public void test104() { " public int x;\n" + " }\n" + " }\n", - }, + }; + runner.expectedCompilerLog = "----------\n" + "1. WARNING in A.java (at line 2)\n" + " private int x;\n" + @@ -3413,14 +3419,17 @@ public void test104() { " void foo() {\n" + " ^^^^^\n" + "The method foo() from the type new A.C(){} is never used locally\n" + - "----------\n"); + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=316956 public void test105() { Map options = getCompilerOptions(); CompilerOptions compOptions = new CompilerOptions(options); if (compOptions.complianceLevel < ClassFileConstants.JDK1_4) return; - this.runNegativeTest( + Runner runner = new Runner(); + runner.testFiles = new String[] { "A.java",//------------------------------ "public class A {\n" + @@ -3434,7 +3443,8 @@ public void test105() { " private int x;\n" + " }\n" + " }\n", - }, + }; + runner.expectedCompilerLog = "----------\n" + "1. WARNING in A.java (at line 2)\n" + " private int x;\n" + @@ -3460,13 +3470,16 @@ public void test105() { " private int x;\n" + " ^\n" + "The value of the field A.C.x is not used\n" + - "----------\n"); + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=350738 public void test106() { if (this.complianceLevel < ClassFileConstants.JDK1_5) return; - this.runNegativeTest( + Runner runner = new Runner(); + runner.testFiles = new String[] { "X.java",//------------------------------ "import java.util.List;\n" + @@ -3479,7 +3492,8 @@ public void test106() { " return foo3(set);\n" + " }\n" + "}\n", - }, + }; + runner.expectedCompilerLog = "----------\n" + "1. WARNING in X.java (at line 4)\n" + " private static List<Object> foo1(Set<Object> set) {\n" + @@ -3490,7 +3504,9 @@ public void test106() { " private static <T> List<T> foo3(Set<T> set) {\n" + " ^^^^^^^^^^^^^^^^\n" + "The method foo3(Set<T>) from the type X is never used locally\n" + - "----------\n"); + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); } public void testBug527828() { |