Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshankha2014-10-16 10:36:54 +0000
committershankha2014-10-16 11:22:41 +0000
commit92d8872e8a618ddba36d41f3d903f6d211bf20ba (patch)
tree14f62042b7003d63190ce6bc416321fbfbc7ee26 /org.eclipse.jdt.core.tests.builder
parent1b83df7d45014e7f124fef507b7bdd60803d3e04 (diff)
downloadeclipse.jdt.core-92d8872e8a618ddba36d41f3d903f6d211bf20ba.tar.gz
eclipse.jdt.core-92d8872e8a618ddba36d41f3d903f6d211bf20ba.tar.xz
eclipse.jdt.core-92d8872e8a618ddba36d41f3d903f6d211bf20ba.zip
Fixed Bug 437522 - [1.8][compiler] Missing compile error in Java 8 mode for Interface.super.field access
Signed-off-by: ssankaran <srikanth_sankaran@in.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.core.tests.builder')
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java
index ef5e117e65..b533ca40f2 100644
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java
+++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests18.java
@@ -496,4 +496,33 @@ public class IncrementalTests18 extends BuilderTests {
"Problem : The type Y cannot be resolved. It is indirectly referenced from" +
" required .class files [ resource : </Project/X.java> range : <0,1> category : <10> severity : <2>]");
}
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=445049,
+ // [compiler] java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding
+ // cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding
+ public void test445049() throws JavaModelException, IOException {
+ IPath projectPath = env.addProject("Project", "1.8");
+ env.addExternalJars(projectPath, Util.getJavaClassLibs());
+
+ // remove old package fragment root so that names don't collide
+ env.removePackageFragmentRoot(projectPath, "");
+
+ IPath root = env.addPackageFragmentRoot(projectPath, "src");
+ env.setOutputFolder(projectPath, "bin");
+
+ setupProjectForNullAnnotations();
+ env.addClass(root, "", "I",
+ "public interface I { int f = 0;}");
+
+ fullBuild(projectPath);
+ expectingNoProblems();
+
+ env.addClass(root, "", "X", "class X implements I { int i = I.super.f;}");
+
+ incrementalBuild(projectPath);
+ expectingProblemsFor(
+ projectPath,
+ "Problem : No enclosing instance of the type I is accessible in scope [" +
+ " resource : </Project/src/X.java> range : <31,38> category : <40> severity : <2>]");
+ }
}

Back to the top