Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-04-16 19:46:50 +0000
committerStephan Herrmann2019-04-16 19:49:06 +0000
commitbd2710396dddf798a364e0bd043e4dbe8ad7156c (patch)
tree28b6302b3b639b052a2a4b742812cc7240e048d4 /org.eclipse.jdt.core.tests.compiler
parentfcfd0b7a8086bb7c045999dbfed0f02e4bf593f0 (diff)
downloadeclipse.jdt.core-bd2710396dddf798a364e0bd043e4dbe8ad7156c.tar.gz
eclipse.jdt.core-bd2710396dddf798a364e0bd043e4dbe8ad7156c.tar.xz
eclipse.jdt.core-bd2710396dddf798a364e0bd043e4dbe8ad7156c.zip
Bug 542795 - NPE in ProblemReporter.deprecatedSinceValue(...)I20190416-1800
Change-Id: Ib993ac655af27f5caf14c3037b25144d47e070b2 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
index 6f12b7dd0e..460219383c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Deprecated9Test.java
@@ -960,6 +960,53 @@ public class Deprecated9Test extends AbstractRegressionTest9 {
"CMissing cannot be resolved to a type\n" +
"----------\n");
}
+ public void testBug542795() throws Exception {
+ Runner runner = new Runner();
+ runner.customOptions = new HashMap<>();
+ runner.customOptions.put(JavaCore.COMPILER_PB_DEPRECATION, CompilerOptions.ERROR);
+ runner.testFiles = new String[] {
+ "test/ReaderWarningView.java",
+ "package test;\n" +
+ "@java.lang.Deprecated\n" +
+ "public class ReaderWarningView {}\n",
+ "Test.java",
+ "public class Test implements test.Screen.Component {}\n",
+ "test/Screen.java",
+ "package test;\n" +
+ "@interface Annot{ Class<?> value(); }\n" +
+ "@Annot(test.Screen.Component.class)\n" +
+ "@java.lang.Deprecated\n" +
+ "public final class Screen {\n" +
+ " @java.lang.Deprecated\n" +
+ " public interface Component extends test.ReaderWarningView.Component {\n" +
+ " }\n" +
+ "}\n",
+ };
+ runner.expectedCompilerLog =
+ "----------\n" +
+ "1. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^\n" +
+ "The hierarchy of the type Test is inconsistent\n" +
+ "----------\n" +
+ "2. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^^^\n" +
+ "The type Screen is deprecated\n" +
+ "----------\n" +
+ "3. ERROR in Test.java (at line 1)\n" +
+ " public class Test implements test.Screen.Component {}\n" +
+ " ^^^^^^^^^\n" +
+ "The type Screen.Component is deprecated\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in test\\Screen.java (at line 7)\n" +
+ " public interface Component extends test.ReaderWarningView.Component {\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "test.ReaderWarningView.Component cannot be resolved to a type\n" +
+ "----------\n";
+ runner.runNegativeTest();
+ }
public static Class<?> testClass() {
return Deprecated9Test.class;
}

Back to the top