--- /dev/null
+import java.lang.annotation.*;
+
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@interface Ann {}
+
+@Ann
+class C{}
+
+public class Test3 {
+
+ public static void main(String[] args) {
+ C a = new C();
+ abc(a);
+ }
+
+ static void abc(C y) {}
+}
+
+
+aspect Annotations {
+ before(Ann ann) : call(* Test3.*(..)) && @args(ann) { }
+}
<compile files="ITDReturningParameterizedType.aj" options="-1.5"/>
<run class="ITDReturningParameterizedType"/>
</ajc-test>
+
+ <ajc-test dir="java5/annotations/binding/bugs" title="AtArgs causes a VerifyError: Unable to pop operand off an empty stack" vm="1.5">
+ <compile files="Test3.java" options="-1.5"/>
+ <run class="Test3"/>
+ </ajc-test>
</suite>
\ No newline at end of file
WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_ARG_TYPE,argType.getName()),
"",IMessage.ERROR,shadow.getSourceLocation(),null,new ISourceLocation[]{getSourceLocation()});
}
- if (ap.matches(rArgType).alwaysTrue()) { // !!! ASC Can we ever take this branch?
- // !!! AMC - Yes, if annotation is @Inherited
- argsIndex++;
- continue;
- } else {
+
+ ResolvedTypeX rAnnType = ap.annotationType.resolve(shadow.getIWorld());
+ if (ap instanceof BindingAnnotationTypePattern) {
+ BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern)ap;
+ Var annvar = shadow.getArgAnnotationVar(argsIndex,rAnnType);
+ state.set(btp.getFormalIndex(),annvar);
+ }
+ if (!ap.matches(rArgType).alwaysTrue()) {
// we need a test...
- ResolvedTypeX rAnnType = ap.annotationType.resolve(shadow.getIWorld());
- if (ap instanceof BindingAnnotationTypePattern) {
- BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern)ap;
- Var annvar = shadow.getArgAnnotationVar(argsIndex,rAnnType);
- state.set(btp.getFormalIndex(),annvar);
- ret = Test.makeAnd(ret,Test.makeHasAnnotation(shadow.getArgVar(argsIndex),rAnnType));
- argsIndex++;
- } else {
- ret = Test.makeAnd(ret,Test.makeHasAnnotation(shadow.getArgVar(argsIndex),rAnnType));
- argsIndex++;
- }
- }
+ ret = Test.makeAnd(ret,Test.makeHasAnnotation(shadow.getArgVar(argsIndex),rAnnType));
+ }
+ argsIndex++;
}
}
return ret;