Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2016-10-30 11:22:48 +0000
committerStephan Herrmann2016-11-22 19:03:34 +0000
commit780f3409ea9ceb5e218788eeb3a54b9227a2c930 (patch)
tree00587dbe3d005ae5f32eba141a964f7ac7b99571
parent2636134a04a09ab2108c3de14e21d4313f8a2cc1 (diff)
downloadorg.eclipse.objectteams-780f3409ea9ceb5e218788eeb3a54b9227a2c930.tar.gz
org.eclipse.objectteams-780f3409ea9ceb5e218788eeb3a54b9227a2c930.tar.xz
org.eclipse.objectteams-780f3409ea9ceb5e218788eeb3a54b9227a2c930.zip
Bug 506746: NullPointerException in TeamAnchor.isTeam
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java2
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java22
2 files changed, 23 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
index cd7fdbacd..3d720a4a8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/RoleTypeCreator.java
@@ -1066,7 +1066,7 @@ public class RoleTypeCreator implements TagBits {
// null any more but only problems.
ProblemReferenceBinding foundProblem= null;
- if (anchor.isValidBinding() && !anchor.isFinal()) {
+ if (anchor.hasValidReferenceType() && !anchor.isFinal()) {
// t.T with t not a Team => plain Java error
if (!anchor.isTeam() && variableStart == tokens.length-2)
return new ProblemReferenceBinding(tokens, null, ProblemReasons.NotFound);
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
index 608be1f53..0164686a6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/regression/ReportedBugs.java
@@ -5486,4 +5486,26 @@ public class ReportedBugs extends AbstractOTJLDTest {
options,
null);
}
+
+ public void testBug506746() {
+ runNegativeTest(
+ new String[] {
+ "C1.java",
+ "class f {\n" +
+ " static class b {}\n" +
+ "}\n" +
+ "public class C1 {\n" +
+ " void m() {\n" +
+ " C1<String> f;\n" +
+ " f.b c = new f.b(); \n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in C1.java (at line 6)\n" +
+ " C1<String> f;\n" +
+ " ^^\n" +
+ "The type C1 is not generic; it cannot be parameterized with arguments <String>\n" +
+ "----------\n");
+ }
}

Back to the top