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 40510 Details for
Bug 140318
AST: Invalid annotation binding for incomplete code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_140318_tests.txt (text/plain), 4.20 KB, created by
Olivier Thomann
on 2006-05-05 14:43:03 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-05-05 14:43:03 EDT
Size:
4.20 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.198 >diff -u -r1.198 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 24 Apr 2006 17:41:44 -0000 1.198 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 5 May 2006 16:32:53 -0000 >@@ -46,7 +46,7 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 217 }; >+// TESTS_NUMBERS = new int[] { 218 }; > // TESTS_NAMES = new String[] {"test0204"}; > } > public static Test suite() { >@@ -6835,4 +6835,80 @@ > typeArguments = typeBinding2.getTypeArguments(); > assertEquals("Wrong size", 0, typeArguments.length); > } >+ >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140318 >+ */ >+ public void test0218() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "import java.util.List;\n" + >+ "\n" + >+ "public class X {\n" + >+ " /**\n" + >+ " * @category fo\n" + >+ " */\n" + >+ " @Test private int fXoo;\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 1, "Test cannot be resolved to a type"); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType()); >+ FieldDeclaration declaration = (FieldDeclaration) node; >+ List modifiers = declaration.modifiers(); >+ assertEquals("wrong size", 2, modifiers.size()); >+ assertEquals("Not a marker annotation", ASTNode.MARKER_ANNOTATION, ((ASTNode) modifiers.get(0)).getNodeType()); >+ MarkerAnnotation annotation = (MarkerAnnotation) modifiers.get(0); >+ Name name = annotation.getTypeName(); >+ assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType()); >+ ITypeBinding binding = name.resolveTypeBinding(); >+ assertNull("Got a binding", binding); >+ IBinding binding2 = name.resolveBinding(); >+ assertNull("Got a binding", binding2); >+ IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); >+ assertNull("Got a binding", annotationBinding); >+ } >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140318 >+ */ >+ public void test0219() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "import java.util.List;\n" + >+ "\n" + >+ "public class X {\n" + >+ " /**\n" + >+ " * @category fo\n" + >+ " */\n" + >+ " @Test private int fXoo;\n" + >+ "}\n" + >+ "class Test {}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 1, "Type mismatch: cannot convert from Test to Annotation"); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a field declaration", ASTNode.FIELD_DECLARATION, node.getNodeType()); >+ FieldDeclaration declaration = (FieldDeclaration) node; >+ List modifiers = declaration.modifiers(); >+ assertEquals("wrong size", 2, modifiers.size()); >+ assertEquals("Not a marker annotation", ASTNode.MARKER_ANNOTATION, ((ASTNode) modifiers.get(0)).getNodeType()); >+ MarkerAnnotation annotation = (MarkerAnnotation) modifiers.get(0); >+ Name name = annotation.getTypeName(); >+ assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, name.getNodeType()); >+ ITypeBinding binding = name.resolveTypeBinding(); >+ assertNotNull("No binding", binding); >+ IBinding binding2 = name.resolveBinding(); >+ assertNotNull("No binding", binding2); >+ IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); >+ assertNull("Got a binding", annotationBinding); >+ } > } >\ No newline at end of file
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 140318
:
40509
| 40510 |
40727
|
40896