Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 55320 Details for
Bug 167217
[1.5][compiler] ClassCastException during annotation code generation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression tests
patch_167217_tests.txt (text/plain), 8.46 KB, created by
Olivier Thomann
on 2006-12-08 11:30:54 EST
(
hide
)
Description:
Regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-12-08 11:30:54 EST
Size:
8.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v >retrieving revision 1.160 >diff -u -r1.160 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 7 Dec 2006 10:05:30 -0000 1.160 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 8 Dec 2006 16:28:39 -0000 >@@ -39,8 +39,8 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test127" }; >-// TESTS_NUMBERS = new int[] { 212, 213 }; >-// TESTS_RANGE = new int[] { 169, 180 }; >+// TESTS_NUMBERS = new int[] { 219 }; >+// TESTS_RANGE = new int[] { 219, -1 }; > } > > public static Test suite() { >@@ -7240,4 +7240,270 @@ > "The method message() is undefined for the type Annotation\n" + > "----------\n"); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test219() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1(MyA2.XX)\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1 value();\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " @MyB1(MyA2.XX)\n" + >+ " ^^^^^^^\n" + >+ "The value for annotation attribute MyB1.value must be some @MyA1 annotation \n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test220() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1({MyA2.XX})\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1[] value();\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " @MyB1({MyA2.XX})\n" + >+ " ^^^^^^^\n" + >+ "The value for annotation attribute MyB1.value must be some @MyA1 annotation \n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test221() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1(null)\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1 value();\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " @MyB1(null)\n" + >+ " ^^^^\n" + >+ "The value for annotation attribute MyB1.value must be some @MyA1 annotation \n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test222() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1({null})\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1[] value();\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " @MyB1({null})\n" + >+ " ^^^^\n" + >+ "The value for annotation attribute MyB1.value must be some @MyA1 annotation \n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test223() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1(@MyA1())\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1 value();\n" + >+ "}" >+ }, >+ ""); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=167217 >+public void test224() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " @MyB1({@MyA1(), @MyA1})\n" + >+ " public void foo(){}\n" + >+ "}", >+ "MyA1.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA1 {\n" + >+ "}", >+ "MyA2.java", >+ "import static java.lang.annotation.ElementType.TYPE;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE\n" + >+ "})\n" + >+ "public @interface MyA2 {\n" + >+ " public static final MyA1 XX = null;\n" + >+ "}", >+ "MyB1.java", >+ "import static java.lang.annotation.ElementType.*;\n" + >+ "import java.lang.annotation.Target;\n" + >+ "\n" + >+ "@Target( {\n" + >+ " TYPE, METHOD\n" + >+ "})\n" + >+ "public @interface MyB1 {\n" + >+ " MyA1[] value();\n" + >+ "}" >+ }, >+ ""); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 167217
:
55318
| 55320