Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2015-10-06 08:27:39 +0000
committerJay Arthanareeswaran2015-10-06 08:35:26 +0000
commitd8d7cbcd4366698aa14f36473dfc4682eccbf01c (patch)
treecd2b4e54ffda602f58fbdc74be8d07ffe7947600
parent1b3e3495bafc6466b681cb462b2636cca6843e2e (diff)
downloadeclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.tar.gz
eclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.tar.xz
eclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.zip
Bug 470665 - Adding unit testI20151006-0800
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
index 9b8dcfae2e..a3b1733536 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java
@@ -11596,4 +11596,46 @@ public void test472178() throws Exception {
" )\n";
checkClassFile("Test", source, expectedOutput, ClassFileBytesDisassembler.DETAILED | ClassFileBytesDisassembler.COMPACT);
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=470665
+public void testBug470665() throws Exception {
+ if (this.complianceLevel <= ClassFileConstants.JDK1_7) {
+ return; // Enough to run in the last two levels!
+ }
+ boolean apt = this.enableAPT;
+ String[] sources = new String[] {
+ "A.java",
+ "public final class A {\n" +
+ " String myString;\n" +
+ " public interface B {\n" +
+ " void test();\n" +
+ " }\n" +
+ " private final B b = new B() {\n" +
+ " @Override\n" +
+ " public void test() {}\n" +
+ " }\n" +
+ "};\n" +
+ "}",
+ "B.java",
+ "public class B {\n" +
+ " private static class X {\n" +
+ " static final Object instance1;\n" +
+ " static {\n" +
+ " try {\n" +
+ " instance1 = new Object();\n" +
+ " } catch (Throwable e) {\n" +
+ " throw new AssertionError(e);\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " X x = new X();\n" +
+ " Object o = X.instance1;\n" +
+ "}"
+ };
+ try {
+ this.enableAPT = true;
+ runConformTest(sources);
+ } finally {
+ this.enableAPT = apt;
+ }
+}
}

Back to the top