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 71383 Details for
Bug 192774
Annotation AST nodes should have unique IAnnotationBindings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
test case
bug191082.txt (text/plain), 2.50 KB, created by
Walter Harley
on 2007-06-14 19:40:13 EDT
(
hide
)
Description:
test case
Filename:
MIME Type:
Creator:
Walter Harley
Created:
2007-06-14 19:40:13 EDT
Size:
2.50 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.247 >diff -u -r1.247 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 11 May 2007 14:55:27 -0000 1.247 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 14 Jun 2007 23:37:10 -0000 >@@ -9098,4 +9098,47 @@ > CompilationUnit unit = (CompilationUnit) node; > assertProblemsSize(unit, 1, "The type A is not generic; it cannot be parameterized with arguments <?>"); > } >+ >+ /* >+ * Test ability to distinguish AST nodes of multiple similar annotations. >+ */ >+ public void test0999() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "@interface Annot {\n" + >+ " public int value();\n" + >+ "}\n" + >+ "\n" + >+ "public class X {\n" + >+ " @Annot(1) String foo1() { return null; }\n" + >+ " @Annot(1) String foo2() { return null; }\n" + >+ "}"; >+ this.workingCopy.getBuffer().setContents(contents); >+ >+ class CompilationUnitRequestor extends ASTRequestor >+ { >+ public void acceptAST(ICompilationUnit source, CompilationUnit node) { >+ MethodDeclaration methodDeclaration = (MethodDeclaration)getASTNode(node, 1, 0); >+ IMethodBinding methodBinding = methodDeclaration.resolveBinding(); >+ IAnnotationBinding annoBinding = methodBinding.getAnnotations()[0]; >+ ASTNode annoNode = node.findDeclaringNode(annoBinding); >+ int position1 = annoNode.getStartPosition(); >+ >+ methodDeclaration = (MethodDeclaration)getASTNode(node, 1, 1); >+ methodBinding = methodDeclaration.resolveBinding(); >+ annoBinding = methodBinding.getAnnotations()[0]; >+ annoNode = node.findDeclaringNode(annoBinding); >+ int position2 = annoNode.getStartPosition(); >+ assertTrue("Anno 2 position <= anno 1 position", position2 > position1); >+ } >+ } >+ >+ CompilationUnitRequestor requestor = new CompilationUnitRequestor(); >+ ASTParser p = ASTParser.newParser( AST.JLS3 ); >+ p.setResolveBindings( true ); >+ p.setProject( this.getJavaProject("Converter15") ); >+ p.setKind( ASTParser.K_COMPILATION_UNIT ); >+ p.createASTs( new ICompilationUnit[]{this.workingCopy}, new String[0], requestor, null); >+ } >+ > }
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 192774
: 71383 |
73309