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 115260 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]
Proposed fix + regression tests
patch_249844.txt (text/plain), 3.31 KB, created by
Olivier Thomann
on 2008-10-16 11:30:00 EDT
(
hide
)
Description:
Proposed fix + regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2008-10-16 11:30:00 EDT
Size:
3.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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 16 Oct 2008 15:28:48 -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); >#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.278 >diff -u -r1.278 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 22 Sep 2008 16:22:19 -0000 1.278 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 16 Oct 2008 15:28:49 -0000 >@@ -46,7 +46,7 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 323 }; >+// TESTS_NUMBERS = new int[] { 324, 325 }; > // TESTS_RANGE = new int[] { 308, -1 }; > // TESTS_NAMES = new String[] {"test0204"}; > } >@@ -10369,4 +10369,40 @@ > ); > assertNotNull("No node", buildAST(contents, this.workingCopy, false, true, true)); > } >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 >+ */ >+ public void test0324() throws JavaModelException { >+ String contents = >+ "package test0324;\n" + >+ "/*start*/@Test/*end*/\n" + >+ "public @interface Test {}"; >+ this.workingCopy = getWorkingCopy( >+ "/Converter15/src/test0324/Test.java", >+ contents, >+ true/*resolve*/ >+ ); >+ MarkerAnnotation annotation = (MarkerAnnotation) buildAST(contents, this.workingCopy, true, true, true); >+ IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); >+ assertNotNull("No java element", annotationBinding.getJavaElement()); >+ } >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=249844 >+ */ >+ public void test0325() throws JavaModelException { >+ String contents = >+ "package test0325;\n" + >+ "@interface Test {}\n" + >+ "/*start*/@Test/*end*/\n" + >+ "public enum X {}"; >+ this.workingCopy = getWorkingCopy( >+ "/Converter15/src/test0325/X.java", >+ contents, >+ true/*resolve*/ >+ ); >+ MarkerAnnotation annotation = (MarkerAnnotation) buildAST(contents, this.workingCopy, true, true, true); >+ IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); >+ IJavaElement javaElement = annotationBinding.getJavaElement(); >+ assertNotNull("No java element", javaElement); >+ } > } >\ 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 249844
:
115260
|
115402