Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-01-31 19:05:44 +0000
committerStephan Herrmann2019-01-31 20:42:15 +0000
commit705bf0beff6f458ef068964094f5fecf359aec3c (patch)
tree7424ceca7dfcc03f79de327c68c17f22d0a609a6 /org.eclipse.jdt.core.tests.compiler
parentac35e2f73e4b24ada4c919c2a75c1546eafd8287 (diff)
downloadeclipse.jdt.core-705bf0beff6f458ef068964094f5fecf359aec3c.tar.gz
eclipse.jdt.core-705bf0beff6f458ef068964094f5fecf359aec3c.tar.xz
eclipse.jdt.core-705bf0beff6f458ef068964094f5fecf359aec3c.zip
Bug 533475 - ExceptionInIntializerError using ecj-4.7.3 in Java 9. JavaI20190204-1800I20190203-1800I20190202-1800I20190201-1800I20190201-0600I20190131-1800
8 works fine, as does compiling with JDK Change-Id: Icbaf6d26b690ba97056c45ea12760da0b1842d49 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
index 751faf0133..cc7fc5fb1a 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2017 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -3072,6 +3072,40 @@ public void test526911a() {
};
this.runConformTest(sourceFiles, "1 11", options);
}
+public void testBug533475() {
+ if (this.complianceLevel < ClassFileConstants.JDK1_5)
+ return;
+ runConformTest(
+ new String[] {
+ "SwitchBug.java",
+ "public class SwitchBug {\n" +
+ " static class MyClass {\n" +
+ " private static final Object C = \"\";\n" +
+ "\n" +
+ " public enum State {\n" +
+ " ENABLED(C); // pass null constant\n" +
+ "\n" +
+ " State(Object value) {\n" +
+ " } // value can be ignored\n" +
+ " }\n" +
+ "\n" +
+ " /* unused method with switch statement IN SAME CLASS */\n" +
+ " private void unusedMethod() {\n" +
+ " switch (State.ENABLED) {\n" +
+ " case ENABLED:\n" +
+ " break;\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " // access enum values from an other class\n" +
+ " MyClass.State.values();\n" +
+ " System.out.println(\"It runs.\");\n" +
+ " }\n" +
+ "}\n"
+ });
+}
public static Class testClass() {
return SwitchTest.class;
}

Back to the top