Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-01-28 19:42:28 +0000
committerStephan Herrmann2012-01-28 19:42:28 +0000
commit2c38ab4d76d7def0495e781b84c159ff2b585512 (patch)
treed4e6d53cca5f3dd7402b444af6018b432d29887f /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
parent8574731a0f2dc482cebc92613334e05b97ad83d0 (diff)
downloadorg.eclipse.objectteams-2c38ab4d76d7def0495e781b84c159ff2b585512.tar.gz
org.eclipse.objectteams-2c38ab4d76d7def0495e781b84c159ff2b585512.tar.xz
org.eclipse.objectteams-2c38ab4d76d7def0495e781b84c159ff2b585512.zip
Basic merge to M5 using jdt.core v20120125-1544
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java66
1 files changed, 64 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
index aa4d4729e..5e591ccf1 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for Bug 365519 - editorial cleanup after bug 186342 and bug 365387
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
@@ -15,6 +16,7 @@ import java.util.Map;
import junit.framework.Test;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.ToolFactory;
import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.jdt.core.util.ClassFileBytesDisassembler;
@@ -6517,6 +6519,66 @@ public void test180() {
"",
null);
}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=289892
+// in interaction with null annotations
+// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=365519#c4 item (6)
+public void test180a() {
+ Map options = getCompilerOptions();
+ options.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
+ this.runConformTest(
+ new String[] {
+ "p/package-info.java",
+ "@p.Annot(state=p.MyEnum.BROKEN)\n" +
+ "package p;",
+ "p/Annot.java",
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public @interface Annot {\n" +
+ " MyEnum state() default MyEnum.KO;\n" +
+ "}",
+ "p/MyEnum.java",
+ "package p;\n" +
+ "@Annot(state=MyEnum.KO)\n" +
+ "public enum MyEnum {\n" +
+ " WORKS, OK, KO, BROKEN, ;\n" +
+ "}",
+ "test180/package-info.java",
+ "@p.Annot(state=p.MyEnum.OK)\n" +
+ "package test180;",
+ "test180/Test.java",
+ "package test180;\n" +
+ "import p.MyEnum;\n" +
+ "import p.Annot;\n" +
+ "@Annot(state=MyEnum.OK)\n" +
+ "public class Test {}",
+ },
+ "",
+ null,
+ true,
+ null,
+ options,
+ null
+ );
+ options = getCompilerOptions();
+ options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
+ this.runConformTest(
+ false,
+ new String[] {
+ "X.java",
+ "import test180.Test;\n" +
+ "public class X {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(Test.class);\n" +
+ " }\n" +
+ "}"
+ },
+ null,
+ options,
+ "",
+ "class test180.Test",
+ "",
+ null);
+}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=300133
public void test181() {
this.runConformTest(

Back to the top