Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2017-03-31 18:51:51 +0000
committerStephan Herrmann2017-04-01 13:55:56 +0000
commit4fba2e5fe62635165ba1b036e4df8dbe7c85cc7a (patch)
treeb347c4a9279de5d64ae901229db451b555115c7d
parent2c42a0df455cbd5ba153f806bdbdfa9b2c3c7fd2 (diff)
downloadeclipse.jdt.core-4fba2e5fe62635165ba1b036e4df8dbe7c85cc7a.tar.gz
eclipse.jdt.core-4fba2e5fe62635165ba1b036e4df8dbe7c85cc7a.tar.xz
eclipse.jdt.core-4fba2e5fe62635165ba1b036e4df8dbe7c85cc7a.zip
Bug 514570 - [1.8][null][javadoc] "Null constraint mismatch" on methodI20170401-2000
reference in javadoc Change-Id: I7c8cbc6d6808e20a1b7f01b6f57f0d1a1c5714cf
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java25
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java2
2 files changed, 26 insertions, 1 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 8d5ea9abd3..1a03907b17 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
@@ -15237,4 +15237,29 @@ public void testBug514091() {
""
);
}
+public void testBug514570() {
+ final Map compilerOptions = getCompilerOptions();
+ compilerOptions.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED);
+ runConformTestWithLibs(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "\n" +
+ "import java.util.List;\n" +
+ "\n" +
+ "import org.eclipse.jdt.annotation.NonNull;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * {@link #bug()}\n" +
+ " */\n" +
+ " <E, T extends List<@NonNull E>> void bug() {\n" +
+ " }\n" +
+ "}\n" +
+ "",
+ },
+ compilerOptions,
+ ""
+ );
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
index 0d4e843ac2..f0dd9b277d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
@@ -141,7 +141,7 @@ public class TypeVariableBinding extends ReferenceBinding {
return BoundCheckStatus.OK;
BoundCheckStatus nullStatus = BoundCheckStatus.OK;
- boolean checkNullAnnotations = scope.environment().usesNullTypeAnnotations();
+ boolean checkNullAnnotations = scope.environment().usesNullTypeAnnotations() && (location == null || (location.bits & ASTNode.InsideJavadoc) == 0);
if (argumentType.kind() == Binding.WILDCARD_TYPE) {
WildcardBinding wildcard = (WildcardBinding) argumentType;

Back to the top