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 93455 Details for
Bug 223838
[dom] AnnotationBinding.isRecovered() always return false
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch including Olivier's fix + regression test
v00.txt (text/plain), 6.06 KB, created by
Frederic Fusier
on 2008-03-25 13:56:32 EDT
(
hide
)
Description:
Patch including Olivier's fix + regression test
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-03-25 13:56:32 EDT
Size:
6.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java,v >retrieving revision 1.13 >diff -u -r1.13 ASTConverterBugsTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java 20 Mar 2008 14:27:12 -0000 1.13 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTest.java 25 Mar 2008 17:55:44 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.core.tests.dom; > > import java.io.IOException; >+import java.util.List; > import java.util.Map; > > import junit.framework.Test; >@@ -973,4 +974,30 @@ > "Invalid float literal number\n", > result); > } >+ >+/** >+ * @bug 223838: [dom] AnnotationBinding.isRecovered() always return false >+ * @test That the annotation binding is well flagged as recovered when the annotation is an unknown type >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=223838" >+ */ >+public void testBug223838() throws JavaModelException { >+ String contents = >+ "package b223838;\n" + >+ "@Deprecated\n" + >+ "@Invalid\n" + >+ "public class Test {\n" + >+ "}\n"; >+ ICompilationUnit workingCopy = getWorkingCopy( >+ "/Converter15/src/b223838/Test.java", >+ contents, >+ true/*resolve*/ >+ ); >+ ASTNode node = buildAST(contents, workingCopy, false); >+ CompilationUnit unit = (CompilationUnit) node; >+ List types = unit.types(); >+ TypeDeclaration type = (TypeDeclaration) types.get(0); >+ ITypeBinding typeBinding = type.resolveBinding(); >+ IAnnotationBinding[] annotations = typeBinding.getAnnotations(); >+ assertTrue("Expected recovered annotation binding!", annotations[1].isRecovered()); >+} > } >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.260 >diff -u -r1.260 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 27 Feb 2008 15:41:16 -0000 1.260 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 25 Mar 2008 17:55:44 -0000 >@@ -6918,7 +6918,7 @@ > IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); > assertNotNull("No binding", annotationBinding); > assertEquals("LX;.fXoo)I@LTest;", annotationBinding.getKey()); >- assertFalse("Annotation should not be flagged as recovered", annotationBinding.isRecovered()); >+ assertTrue("Annotation should not flagged as recovered", annotationBinding.isRecovered()); > assertTrue("Annotation type should be flagged as recovered", annotationBinding.getAnnotationType().isRecovered()); > } > /* >@@ -7096,7 +7096,7 @@ > assertEquals("Wrong size", 1, annotations.length); > assertNotNull("No binding", annotations[0]); > assertEquals("LX;.foo()V@LZork;", annotations[0].getKey()); >- assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation should be flagged as recovered", annotations[0].isRecovered()); > assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); > } > /* >@@ -7123,7 +7123,7 @@ > assertEquals("Wrong size", 1, annotations.length); > assertNotNull("No binding", annotations[0]); > assertEquals("LX;@LZork;", annotations[0].getKey()); >- assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation should be flagged as recovered", annotations[0].isRecovered()); > assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); > } > /* >@@ -7154,7 +7154,7 @@ > assertEquals("Wrong size", 1, bindings.length); > assertNotNull("No binding", bindings[0]); > assertEquals("@LZork;", bindings[0].getKey()); >- assertFalse("Annotation should not be flagged as recovered", bindings[0].isRecovered()); >+ assertTrue("Annotation should be flagged as recovered", bindings[0].isRecovered()); > assertTrue("Annotation type should be flagged as recovered", bindings[0].getAnnotationType().isRecovered()); > } > /* >@@ -9373,7 +9373,7 @@ > IAnnotationBinding[] annotations = typeBinding.getAnnotations(); > assertEquals("wrong size", 2, annotations.length); > assertEquals("LX;@LInvalid;", annotations[0].getKey()); >- assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation should be flagged as recovered", annotations[0].isRecovered()); > assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); > assertEquals("LX;@Ljava/lang/Deprecated;", annotations[1].getKey()); > } >#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.7 >diff -u -r1.7 AnnotationBinding.java >--- dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 22 Feb 2008 09:49:36 -0000 1.7 >+++ dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 25 Mar 2008 17:55:45 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair; > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TagBits; > import org.eclipse.jdt.internal.compiler.util.*; > > /** >@@ -199,8 +200,8 @@ > * @see org.eclipse.jdt.core.dom.IBinding#isRecovered() > */ > public boolean isRecovered() { >- return false; >- } >+ ReferenceBinding annotationType = binding.getAnnotationType(); >+ return annotationType == null || (annotationType.tagBits & TagBits.HasMissingType) != 0; } > > public boolean isSynthetic() { > return false;
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 223838
: 93455