diff options
author | Jay Arthanareeswaran | 2015-10-06 08:27:39 +0000 |
---|---|---|
committer | Jay Arthanareeswaran | 2015-10-06 08:35:26 +0000 |
commit | d8d7cbcd4366698aa14f36473dfc4682eccbf01c (patch) | |
tree | cd2b4e54ffda602f58fbdc74be8d07ffe7947600 | |
parent | 1b3e3495bafc6466b681cb462b2636cca6843e2e (diff) | |
download | eclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.tar.gz eclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.tar.xz eclipse.jdt.core-d8d7cbcd4366698aa14f36473dfc4682eccbf01c.zip |
Bug 470665 - Adding unit testI20151006-0800
Change-Id: I6c13700ff314902a4b71d841b77ef3a50dd87526
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java | 42 |
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; + } +} } |