Lines 23-32
Link Here
|
23 |
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral; |
23 |
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral; |
24 |
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; |
24 |
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; |
25 |
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant; |
25 |
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant; |
|
|
26 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding; |
27 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationHolder; |
26 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding; |
28 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding; |
27 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding; |
29 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding; |
28 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; |
30 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; |
29 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; |
31 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; |
|
|
32 |
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; |
30 |
import org.aspectj.weaver.AnnotationX; |
33 |
import org.aspectj.weaver.AnnotationX; |
31 |
import org.aspectj.weaver.BCException; |
34 |
import org.aspectj.weaver.BCException; |
32 |
import org.aspectj.weaver.MemberKind; |
35 |
import org.aspectj.weaver.MemberKind; |
Lines 85-90
Link Here
|
85 |
} |
88 |
} |
86 |
|
89 |
|
87 |
|
90 |
|
|
|
91 |
public AnnotationX[][] getParameterAnnotations() { |
92 |
throw new BCException("EclipseResolvedMember.getParameterAnnotations() not-yet-implemented. Please raise a bug and turn off pipelining as a workaround"); |
93 |
} |
94 |
|
95 |
public ResolvedType[][] getParameterAnnotationTypes() { |
96 |
if (parameterAnnotationTypes!=null) return parameterAnnotationTypes; |
97 |
ResolvedType[][] paramAnnos = null; |
98 |
if (realBinding instanceof MethodBinding) { |
99 |
MethodBinding mb = (MethodBinding)realBinding; |
100 |
MethodBinding originalMethod = mb.original(); |
101 |
if (originalMethod.declaringClass instanceof SourceTypeBinding) { |
102 |
SourceTypeBinding sourceType = (SourceTypeBinding) originalMethod.declaringClass; |
103 |
if (sourceType.scope != null) { |
104 |
AbstractMethodDeclaration methodDeclaration = originalMethod.sourceMethod(); |
105 |
sourceType.scope.referenceContext.resolve(); |
106 |
// if (methodDeclaration != null) { |
107 |
// methodDeclaration.resolve(sourceType.scope); |
108 |
// } |
109 |
} |
110 |
} |
111 |
|
112 |
|
113 |
long abits = realBinding.getAnnotationTagBits(); // ensure resolved |
114 |
TypeBinding[] params = mb.parameters; |
115 |
if (params!=null) { |
116 |
paramAnnos = new ResolvedType[params.length][]; |
117 |
for (int i=0;i<params.length;i++) { |
118 |
//AnnotationHolder ah = mb.declaringClass.retrieveAnnotationHolder(mb,true); |
119 |
AnnotationBinding[] singleParameterAnnotations = mb.getParameterAnnotations(i); |
120 |
paramAnnos[i] = new ResolvedType[singleParameterAnnotations==null?0:singleParameterAnnotations.length]; |
121 |
if (singleParameterAnnotations!=null) { |
122 |
for (int j=0;j<singleParameterAnnotations.length;j++) { |
123 |
UnresolvedType ut = UnresolvedType.forSignature(new String(singleParameterAnnotations[j].getAnnotationType().signature())); |
124 |
paramAnnos[i][j] = w.resolve(ut); |
125 |
} |
126 |
} |
127 |
} |
128 |
} |
129 |
} |
130 |
if (paramAnnos!=null) { |
131 |
parameterAnnotationTypes = paramAnnos; |
132 |
} else { |
133 |
parameterAnnotationTypes = NO_PARAMETER_ANNOTATION_TYPES; |
134 |
} |
135 |
return parameterAnnotationTypes; |
136 |
} |
137 |
|
88 |
public AnnotationX getAnnotationOfType(UnresolvedType ofType) { |
138 |
public AnnotationX getAnnotationOfType(UnresolvedType ofType) { |
89 |
long abits = realBinding.getAnnotationTagBits(); // ensure resolved |
139 |
long abits = realBinding.getAnnotationTagBits(); // ensure resolved |
90 |
Annotation[] annos = getEclipseAnnotations(); |
140 |
Annotation[] annos = getEclipseAnnotations(); |