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 115402 Details for
Bug 249844
IBinding#getJavaElement() always returns null for IAnnotationBindings declared in annotation or enum types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Same fix and tests moved to ASTModelBridgeTests
249844.txt (text/plain), 3.21 KB, created by
Jerome Lanneluc
on 2008-10-17 10:55:01 EDT
(
hide
)
Description:
Same fix and tests moved to ASTModelBridgeTests
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-10-17 10:55:01 EDT
Size:
3.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java,v >retrieving revision 1.60 >diff -u -r1.60 ASTModelBridgeTests.java >--- src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 14 Oct 2008 13:47:33 -0000 1.60 >+++ src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 17 Oct 2008 14:54:17 -0000 >@@ -310,6 +310,48 @@ > } > > /* >+ * Ensures that the IJavaElement of an IBinding representing an annotation on an annotation type is correct. >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 ) >+ */ >+ public void testAnnotation6() throws JavaModelException { >+ ASTNode node = buildAST( >+ "/*start*/@MyAnnot/*end*/\n" + >+ "public @interface X {\n" + >+ "}\n" + >+ "@interface MyAnnot {\n" + >+ "}" >+ ); >+ IBinding binding = ((Annotation) node).resolveAnnotationBinding(); >+ IJavaElement element = binding.getJavaElement(); >+ assertElementEquals( >+ "Unexpected Java element", >+ "@MyAnnot [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]", >+ element >+ ); >+ } >+ >+ /* >+ * Ensures that the IJavaElement of an IBinding representing an annotation on an enum type is correct. >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 ) >+ */ >+ public void testAnnotation7() throws JavaModelException { >+ ASTNode node = buildAST( >+ "/*start*/@MyAnnot/*end*/\n" + >+ "public enum X {\n" + >+ "}\n" + >+ "@interface MyAnnot {\n" + >+ "}" >+ ); >+ IBinding binding = ((Annotation) node).resolveAnnotationBinding(); >+ IJavaElement element = binding.getJavaElement(); >+ assertElementEquals( >+ "Unexpected Java element", >+ "@MyAnnot [in X [in [Working copy] X.java [in <default> [in src [in P]]]]]", >+ element >+ ); >+ } >+ >+ /* > * Ensures that the IJavaElement of an IBinding representing an anonymous type is correct. > */ > public void testAnonymousType() throws JavaModelException { >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/AnnotationBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java,v >retrieving revision 1.11 >diff -u -r1.11 AnnotationBinding.java >--- dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 27 Jun 2008 16:03:46 -0000 1.11 >+++ dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 17 Oct 2008 14:54:18 -0000 >@@ -112,8 +112,10 @@ > parentElement = ((ICompilationUnit) cu).getPackageDeclaration(pkgName); > } > break; >+ case ASTNode.ENUM_DECLARATION: > case ASTNode.TYPE_DECLARATION: >- parentElement = ((TypeDeclaration) parent).resolveBinding().getJavaElement(); >+ case ASTNode.ANNOTATION_TYPE_DECLARATION: >+ parentElement = ((AbstractTypeDeclaration) parent).resolveBinding().getJavaElement(); > break; > case ASTNode.FIELD_DECLARATION: > VariableDeclarationFragment fragment = (VariableDeclarationFragment) ((FieldDeclaration) parent).fragments().get(0);
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 249844
:
115260
| 115402