*/
public boolean attemptToModifySuperCalls(BcelClassWeaver weaver,LazyClassGen newParentTarget, ResolvedType newParent) {
String currentParent = newParentTarget.getSuperClassname();
+ if (newParent.getGenericType()!=null) newParent = newParent.getGenericType(); // target new super calls at the generic type if its raw or parameterized
List mgs = newParentTarget.getMethodGens();
// Look for ctors to modify
private boolean mungeNewField(BcelClassWeaver weaver, NewFieldTypeMunger munger) {
/*ResolvedMember initMethod = */munger.getInitMethod(aspectType);
-
LazyClassGen gen = weaver.getLazyClassGen();
ResolvedMember field = munger.getSignature();
-
ResolvedType onType = weaver.getWorld().resolve(field.getDeclaringType(),munger.getSourceLocation());
if (onType.isRawType()) onType = onType.getGenericType();
return false;
}
-
ResolvedMember interMethodBody = munger.getInitMethod(aspectType);
AnnotationX annotationsOnRealMember[] = null;
if (field.isStatic()) throw new RuntimeException("unimplemented");
weaver.addInitializer(this);
//System.err.println("impl body on " + gen.getType() + " for " + munger);
+
+
Type fieldType = BcelWorld.makeBcelType(field.getType());
-
+
FieldGen fg = makeFieldGen(gen,AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType));
-
-
- if (annotationsOnRealMember!=null) {
- for (int i = 0; i < annotationsOnRealMember.length; i++) {
- AnnotationX annotationX = annotationsOnRealMember[i];
- Annotation a = annotationX.getBcelAnnotation();
- AnnotationGen ag = new AnnotationGen(a,weaver.getLazyClassGen().getConstantPoolGen(),true);
- fg.addAnnotation(ag);
+
+ if (annotationsOnRealMember!=null) {
+ for (int i = 0; i < annotationsOnRealMember.length; i++) {
+ AnnotationX annotationX = annotationsOnRealMember[i];
+ Annotation a = annotationX.getBcelAnnotation();
+ AnnotationGen ag = new AnnotationGen(a,weaver.getLazyClassGen().getConstantPoolGen(),true);
+ fg.addAnnotation(ag);
+ }
}
- }
-
- gen.addField(fg.getField(),getSourceLocation());
+
+ gen.addField(fg.getField(),getSourceLocation());
//this uses a shadow munger to add init method to constructors
//weaver.getShadowMungers().add(makeInitCallShadowMunger(initMethod));
-
- ResolvedMember itdfieldGetter = AjcMemberMaker.interFieldInterfaceGetter(field, gen.getType()/*onType*/, aspectType);
+
+ ResolvedMember itdfieldGetter = AjcMemberMaker.interFieldInterfaceGetter(field, gen.getType()/*onType*/, aspectType);
LazyMethodGen mg = makeMethodGen(gen, itdfieldGetter);
InstructionList il = new InstructionList();
InstructionFactory fact = gen.getFactory();