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 34436 Details for
Bug 123470
AST: new type IResolvedAnnotation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Improved patch for jdt.apt projects
123470_apt_v4.txt (text/plain), 18.63 KB, created by
Jerome Lanneluc
on 2006-02-09 13:33:05 EST
(
hide
)
Description:
Improved patch for jdt.apt projects
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-02-09 13:33:05 EST
Size:
18.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.apt.core >Index: src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationMirrorImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationMirrorImpl.java,v >retrieving revision 1.18 >diff -u -r1.18 AnnotationMirrorImpl.java >--- src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationMirrorImpl.java 27 Jan 2006 00:24:16 -0000 1.18 >+++ src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationMirrorImpl.java 9 Feb 2006 18:33:21 -0000 >@@ -25,8 +25,8 @@ > import org.eclipse.jdt.core.dom.Annotation; > import org.eclipse.jdt.core.dom.CompilationUnit; > import org.eclipse.jdt.core.dom.IMethodBinding; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >-import org.eclipse.jdt.core.dom.IResolvedMemberValuePair; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; >+import org.eclipse.jdt.core.dom.IMemberValuePairBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > import org.eclipse.jdt.core.dom.MemberValuePair; >@@ -46,13 +46,13 @@ > public class AnnotationMirrorImpl implements AnnotationMirror, EclipseMirrorImpl > { > /**The ast node that correspond to the annotation.*/ >- private final IResolvedAnnotation _domAnnotation; >+ private final IAnnotationBinding _domAnnotation; > private final BaseProcessorEnv _env; > /** the declaration that is annotated by this annotation or the annotation element declaration > * if this is (part of) a default value*/ > private final EclipseDeclarationImpl _annotated; > >- public AnnotationMirrorImpl(IResolvedAnnotation annotationAstNode, EclipseDeclarationImpl decl, BaseProcessorEnv env) >+ public AnnotationMirrorImpl(IAnnotationBinding annotationAstNode, EclipseDeclarationImpl decl, BaseProcessorEnv env) > { > _domAnnotation = annotationAstNode; > _env = env; >@@ -80,14 +80,14 @@ > > public Map<AnnotationTypeElementDeclaration, AnnotationValue> getElementValues() > { >- final IResolvedMemberValuePair[] pairs = _domAnnotation.getDeclaredMemberValuePairs(); >+ final IMemberValuePairBinding[] pairs = _domAnnotation.getDeclaredMemberValuePairs(); > if (pairs.length == 0) { > return Collections.emptyMap(); > } > > final Map<AnnotationTypeElementDeclaration, AnnotationValue> result = > new LinkedHashMap<AnnotationTypeElementDeclaration, AnnotationValue>(pairs.length * 4 / 3 + 1 ); >- for( IResolvedMemberValuePair pair : pairs ){ >+ for( IMemberValuePairBinding pair : pairs ){ > final String name = pair.getName(); > if( name == null ) continue; > IMethodBinding elementMethod = pair.getMethodBinding(); >@@ -142,8 +142,8 @@ > public ITypeBinding[] getMemberValueTypeBinding(String membername) > { > if( membername == null ) return null; >- final IResolvedMemberValuePair[] declaredPairs = _domAnnotation.getDeclaredMemberValuePairs(); >- for( IResolvedMemberValuePair pair : declaredPairs ){ >+ final IMemberValuePairBinding[] declaredPairs = _domAnnotation.getDeclaredMemberValuePairs(); >+ for( IMemberValuePairBinding pair : declaredPairs ){ > if( membername.equals(pair.getName()) ){ > final Object value = pair.getValue(); > return getValueTypeBinding(value, pair.getMethodBinding().getReturnType()); >@@ -191,8 +191,8 @@ > public Object getValue(final String memberName) > { > if( memberName == null ) return null; >- final IResolvedMemberValuePair[] declaredPairs = _domAnnotation.getDeclaredMemberValuePairs(); >- for( IResolvedMemberValuePair pair : declaredPairs ){ >+ final IMemberValuePairBinding[] declaredPairs = _domAnnotation.getDeclaredMemberValuePairs(); >+ for( IMemberValuePairBinding pair : declaredPairs ){ > if( memberName.equals(pair.getName()) ){ > return pair.getValue(); > } >@@ -221,7 +221,7 @@ > return null; > } > >- public IResolvedAnnotation getResolvedAnnotaion(){return _domAnnotation; } >+ public IAnnotationBinding getResolvedAnnotaion(){return _domAnnotation; } > > > >Index: src/org/eclipse/jdt/apt/core/internal/declaration/ASTBasedDeclarationImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/ASTBasedDeclarationImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 ASTBasedDeclarationImpl.java >--- src/org/eclipse/jdt/apt/core/internal/declaration/ASTBasedDeclarationImpl.java 10 Jan 2006 23:59:08 -0000 1.2 >+++ src/org/eclipse/jdt/apt/core/internal/declaration/ASTBasedDeclarationImpl.java 9 Feb 2006 18:33:21 -0000 >@@ -22,7 +22,7 @@ > import org.eclipse.jdt.core.dom.BodyDeclaration; > import org.eclipse.jdt.core.dom.CompilationUnit; > import org.eclipse.jdt.core.dom.IExtendedModifier; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.SingleVariableDeclaration; > import org.eclipse.jdt.core.dom.VariableDeclaration; > import org.eclipse.jdt.core.dom.VariableDeclarationFragment; >@@ -111,19 +111,19 @@ > > public <A extends Annotation> A getAnnotation(Class<A> annotationClass) > { >- final IResolvedAnnotation[] instances = getAnnotationInstancesFromAST(); >+ final IAnnotationBinding[] instances = getAnnotationInstancesFromAST(); > return _getAnnotation(annotationClass, instances); > } > > public Collection<AnnotationMirror> getAnnotationMirrors() > { >- final IResolvedAnnotation[] instances = getAnnotationInstancesFromAST(); >+ final IAnnotationBinding[] instances = getAnnotationInstancesFromAST(); > return _getAnnotationMirrors(instances); > } > >- private IResolvedAnnotation[] getAnnotationInstancesFromAST() >+ private IAnnotationBinding[] getAnnotationInstancesFromAST() > { >- IResolvedAnnotation[] instances = null; >+ IAnnotationBinding[] instances = null; > List extendsMods = null; > switch( _astNode.getNodeType() ) > { >@@ -156,13 +156,13 @@ > if( extMod.isAnnotation() ) > count ++; > } >- instances = new IResolvedAnnotation[count]; >+ instances = new IAnnotationBinding[count]; > int index = 0; > for( Object obj : extendsMods ){ > final IExtendedModifier extMod = (IExtendedModifier)obj; > if( extMod.isAnnotation() ) > instances[index ++] = >- ((org.eclipse.jdt.core.dom.Annotation)extMod).resolveAnnotation(); >+ ((org.eclipse.jdt.core.dom.Annotation)extMod).resolveAnnotationBinding(); > } > } > return instances; >Index: src/org/eclipse/jdt/apt/core/internal/declaration/BinaryParameterDeclarationImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/BinaryParameterDeclarationImpl.java,v >retrieving revision 1.7 >diff -u -r1.7 BinaryParameterDeclarationImpl.java >--- src/org/eclipse/jdt/apt/core/internal/declaration/BinaryParameterDeclarationImpl.java 2 Sep 2005 16:45:49 -0000 1.7 >+++ src/org/eclipse/jdt/apt/core/internal/declaration/BinaryParameterDeclarationImpl.java 9 Feb 2006 18:33:21 -0000 >@@ -28,7 +28,7 @@ > import org.eclipse.jdt.core.dom.ASTNode; > import org.eclipse.jdt.core.dom.IBinding; > import org.eclipse.jdt.core.dom.IMethodBinding; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.SimpleName; > import org.eclipse.jdt.core.dom.SingleVariableDeclaration; >@@ -101,14 +101,14 @@ > public <A extends Annotation> A getAnnotation(Class<A> annotationClass) > { > final IMethodBinding methodBinding = _executable.getDeclarationBinding(); >- final IResolvedAnnotation[] paramAnnos = methodBinding.getParameterAnnotations(_paramIndex); >+ final IAnnotationBinding[] paramAnnos = methodBinding.getParameterAnnotations(_paramIndex); > return _getAnnotation(annotationClass, paramAnnos); > } > > public Collection<AnnotationMirror> getAnnotationMirrors() > { > final IMethodBinding methodBinding = _executable.getDeclarationBinding(); >- final IResolvedAnnotation[] paramAnnos = methodBinding.getParameterAnnotations(_paramIndex); >+ final IAnnotationBinding[] paramAnnos = methodBinding.getParameterAnnotations(_paramIndex); > return _getAnnotationMirrors(paramAnnos); > } > >Index: src/org/eclipse/jdt/apt/core/internal/declaration/EclipseDeclarationImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/EclipseDeclarationImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 EclipseDeclarationImpl.java >--- src/org/eclipse/jdt/apt/core/internal/declaration/EclipseDeclarationImpl.java 13 Oct 2005 21:19:00 -0000 1.2 >+++ src/org/eclipse/jdt/apt/core/internal/declaration/EclipseDeclarationImpl.java 9 Feb 2006 18:33:21 -0000 >@@ -30,7 +30,7 @@ > import org.eclipse.jdt.core.dom.CompilationUnit; > import org.eclipse.jdt.core.dom.EnumConstantDeclaration; > import org.eclipse.jdt.core.dom.FieldDeclaration; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.Javadoc; > import org.eclipse.jdt.core.dom.MethodDeclaration; >@@ -58,7 +58,7 @@ > } > > <A extends Annotation> A _getAnnotation(Class<A> annotationClass, >- IResolvedAnnotation[] annoInstances) >+ IAnnotationBinding[] annoInstances) > { > if( annoInstances == null || annoInstances.length == 0 || annotationClass == null ) > return null; >@@ -68,7 +68,7 @@ > annoTypeName = annoTypeName.replace('$', '.'); > final int len = annoInstances == null ? 0 : annoInstances.length; > if( len == 0 ) return null; >- for( IResolvedAnnotation annoInstance : annoInstances){ >+ for( IAnnotationBinding annoInstance : annoInstances){ > final ITypeBinding binding = annoInstance.getAnnotationType(); > if( binding != null && binding.isAnnotation() ){ > final String curTypeName = binding.getQualifiedName(); >@@ -84,12 +84,12 @@ > return null; > } > >- Collection<AnnotationMirror> _getAnnotationMirrors(IResolvedAnnotation[] annoInstances) >+ Collection<AnnotationMirror> _getAnnotationMirrors(IAnnotationBinding[] annoInstances) > { > final int len = annoInstances == null ? 0 : annoInstances.length; > if( len == 0 ) return Collections.emptyList(); > final List<AnnotationMirror> result = new ArrayList<AnnotationMirror>(len); >- for(IResolvedAnnotation annoInstance : annoInstances){ >+ for(IAnnotationBinding annoInstance : annoInstances){ > final AnnotationMirrorImpl annoMirror = > (AnnotationMirrorImpl)Factory.createAnnotationMirror(annoInstance, this, _env); > result.add(annoMirror); >@@ -103,7 +103,7 @@ > final List<AnnotationMirror> result = new ArrayList<AnnotationMirror>(annoInstances.size()); > for( org.eclipse.jdt.core.dom.Annotation annoInstance : annoInstances){ > final AnnotationMirrorImpl annoMirror = >- (AnnotationMirrorImpl)Factory.createAnnotationMirror(annoInstance.resolveAnnotation(), this, _env); >+ (AnnotationMirrorImpl)Factory.createAnnotationMirror(annoInstance.resolveAnnotationBinding(), this, _env); > result.add(annoMirror); > } > return result; >Index: src/org/eclipse/jdt/apt/core/internal/declaration/MemberDeclarationImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/MemberDeclarationImpl.java,v >retrieving revision 1.10 >diff -u -r1.10 MemberDeclarationImpl.java >--- src/org/eclipse/jdt/apt/core/internal/declaration/MemberDeclarationImpl.java 10 Jan 2006 23:59:08 -0000 1.10 >+++ src/org/eclipse/jdt/apt/core/internal/declaration/MemberDeclarationImpl.java 9 Feb 2006 18:33:21 -0000 >@@ -38,20 +38,20 @@ > > public <A extends Annotation> A getAnnotation(Class<A> annotationClass) > { >- final IResolvedAnnotation[] instances = getAnnotationInstances(); >+ final IAnnotationBinding[] instances = getAnnotationInstances(); > return _getAnnotation(annotationClass, instances); > } > > public Collection<AnnotationMirror> getAnnotationMirrors() > { >- final IResolvedAnnotation[] instances = getAnnotationInstances(); >+ final IAnnotationBinding[] instances = getAnnotationInstances(); > return _getAnnotationMirrors(instances); > } > >- private IResolvedAnnotation[] getAnnotationInstances() >+ private IAnnotationBinding[] getAnnotationInstances() > { > final IBinding binding = getDeclarationBinding(); >- final IResolvedAnnotation[] instances; >+ final IAnnotationBinding[] instances; > switch( binding.getKind() ) > { > case IBinding.TYPE: >Index: src/org/eclipse/jdt/apt/core/internal/env/AnnotationInvocationHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/AnnotationInvocationHandler.java,v >retrieving revision 1.8 >diff -u -r1.8 AnnotationInvocationHandler.java >--- src/org/eclipse/jdt/apt/core/internal/env/AnnotationInvocationHandler.java 27 Jan 2006 00:24:17 -0000 1.8 >+++ src/org/eclipse/jdt/apt/core/internal/env/AnnotationInvocationHandler.java 9 Feb 2006 18:33:22 -0000 >@@ -26,7 +26,7 @@ > import org.eclipse.jdt.apt.core.internal.declaration.AnnotationMirrorImpl; > import org.eclipse.jdt.apt.core.internal.util.Factory; > import org.eclipse.jdt.core.dom.IMethodBinding; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > >@@ -195,11 +195,11 @@ > else if( domValue instanceof ITypeBinding ) > throw new IllegalStateException("sourceValue is a type binding."); //$NON-NLS-1$ > >- else if( domValue instanceof IResolvedAnnotation ) >+ else if( domValue instanceof IAnnotationBinding ) > { > final AnnotationMirrorImpl annoMirror = > (AnnotationMirrorImpl)Factory.createAnnotationMirror( >- (IResolvedAnnotation)domValue, >+ (IAnnotationBinding)domValue, > _instance.getAnnotatedDeclaration(), > _instance.getEnvironment()); > final AnnotationInvocationHandler handler = new AnnotationInvocationHandler(annoMirror, expectedType); >Index: src/org/eclipse/jdt/apt/core/internal/util/Factory.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/Factory.java,v >retrieving revision 1.13 >diff -u -r1.13 Factory.java >--- src/org/eclipse/jdt/apt/core/internal/util/Factory.java 27 Jan 2006 00:24:17 -0000 1.13 >+++ src/org/eclipse/jdt/apt/core/internal/util/Factory.java 9 Feb 2006 18:33:22 -0000 >@@ -55,7 +55,7 @@ > import org.eclipse.jdt.apt.core.internal.type.WildcardTypeImpl; > import org.eclipse.jdt.core.dom.ASTNode; > import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.IBinding; > import org.eclipse.jdt.core.dom.IMethodBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; >@@ -221,7 +221,7 @@ > * @param env > * @return a newly created {@link AnnotationMirror} object > */ >- public static AnnotationMirror createAnnotationMirror(final IResolvedAnnotation annotation, >+ public static AnnotationMirror createAnnotationMirror(final IAnnotationBinding annotation, > final EclipseDeclarationImpl annotated, > final BaseProcessorEnv env) > { >@@ -366,7 +366,7 @@ > Object o = convertDOMValueToMirrorValue( elements[i], name, parent, decl, env, leaf ); > if( o == null ) > return null; >- assert( !( o instanceof IResolvedAnnotation ) ) : >+ assert( !( o instanceof IAnnotationBinding ) ) : > "Unexpected return value from convertDomValueToMirrorValue! o.getClass().getName() = " //$NON-NLS-1$ > + o.getClass().getName(); > >@@ -380,9 +380,9 @@ > else if( domValue instanceof ITypeBinding ) > returnValue = Factory.createTypeMirror((ITypeBinding)domValue, env); > >- else if( domValue instanceof IResolvedAnnotation ) >+ else if( domValue instanceof IAnnotationBinding ) > { >- returnValue = Factory.createAnnotationMirror((IResolvedAnnotation)domValue, decl, env); >+ returnValue = Factory.createAnnotationMirror((IAnnotationBinding)domValue, decl, env); > } > else > // should never reach this point >#P org.eclipse.jdt.apt.tests >Index: src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java,v >retrieving revision 1.2 >diff -u -r1.2 ReadAnnotationTests2.java >--- src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java 10 Jan 2006 23:58:38 -0000 1.2 >+++ src/org/eclipse/jdt/apt/tests/ReadAnnotationTests2.java 9 Feb 2006 18:33:24 -0000 >@@ -21,7 +21,7 @@ > import org.eclipse.jdt.core.dom.ASTRequestor; > import org.eclipse.jdt.core.dom.IBinding; > import org.eclipse.jdt.core.dom.IMethodBinding; >-import org.eclipse.jdt.core.dom.IResolvedAnnotation; >+import org.eclipse.jdt.core.dom.IAnnotationBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > import org.eclipse.jdt.core.tests.builder.Tests; >@@ -307,7 +307,7 @@ > } > } > >- private void assertAnnotation(final String[] expected, IResolvedAnnotation[] annotations) >+ private void assertAnnotation(final String[] expected, IAnnotationBinding[] annotations) > { > final int expectedLen = expected.length; > TestCase.assertEquals("annotation number mismatch", expected.length, annotations.length); //$NON-NLS-1$ >@@ -317,7 +317,7 @@ > expectedSet.add(expected[i]); > > int counter = 0; >- for( IResolvedAnnotation mirror : annotations ){ >+ for( IAnnotationBinding mirror : annotations ){ > if( counter >= expectedLen ) > TestCase.assertEquals("", mirror.toString()); //$NON-NLS-1$ > else{
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 123470
:
34415
|
34416
|
34435
| 34436