Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-07-21 08:14:34 +0000
committerStephan Herrmann2019-07-21 08:14:34 +0000
commit3743aeb68ad9de418fe4dbe9c2dec82e8e65fc8d (patch)
tree083b90eaf4208cac2410e05a65fa9d2349280fd6 /org.eclipse.jdt.core.tests.compiler
parent05678aa06f4b71450429d697e039226fa57ddccb (diff)
downloadeclipse.jdt.core-3743aeb68ad9de418fe4dbe9c2dec82e8e65fc8d.tar.gz
eclipse.jdt.core-3743aeb68ad9de418fe4dbe9c2dec82e8e65fc8d.tar.xz
eclipse.jdt.core-3743aeb68ad9de418fe4dbe9c2dec82e8e65fc8d.zip
Bug 499714 - [1.8][null] incorrect wording of warning regarding a type
variable constraint to @Nullable Change-Id: I9ee35e04739d16a0e96f69ccd7ed6850115f2a00
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/NullTypeAnnotationTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
index 757f3f4bbd..f8ca253972 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java
@@ -17797,4 +17797,25 @@ public void testBug542707_1() {
"----------\n";
runner.runNegativeTest();
}
+public void testBug499714() {
+ runNegativeTestWithLibs(
+ new String[] {
+ "Type.java",
+ "import org.eclipse.jdt.annotation.*;\n" +
+ "\n" +
+ "interface Type<@Nullable K> {\n" +
+ " K get();\n" +
+ "\n" +
+ " static <@Nullable T> void x(Type<T> t) {\n" +
+ " t.get().toString();\n" +
+ " }\n" +
+ "}"
+ },
+ "----------\n" +
+ "1. ERROR in Type.java (at line 7)\n" +
+ " t.get().toString();\n" +
+ " ^^^^^^^\n" +
+ "Potential null pointer access: The method get() may return null\n" +
+ "----------\n");
+}
}

Back to the top