.getSignature());
}
LazyMethodGen bridgeMethod = makeBridgeMethod(clazz, theBridgeMethod); // The bridge method in this type will have the same
- // signature as the one in the supertype
+ // signature as the one in the supertype
int newflags = bridgeMethod.getAccessFlags() | 0x00000040;/* BRIDGE = 0x00000040 */
if ((newflags & 0x00000100) != 0)
newflags = newflags - 0x100;/* NATIVE = 0x00000100 - need to clear it */
if (annotationsToAdd != null) {
Method oldMethod = mg.getMethod();
MethodGen myGen = new MethodGen(oldMethod, clazz.getClassName(), clazz.getConstantPool(), false);// dont use
- // tags,
- // they
- // won't
- // get
- // repaired
- // like
- // for
- // woven
- // methods
- // .
+ // tags,
+ // they
+ // won't
+ // get
+ // repaired
+ // like
+ // for
+ // woven
+ // methods
+ // .
for (Iterator iter = annotationsToAdd.iterator(); iter.hasNext();) {
AnnotationGen a = (AnnotationGen) iter.next();
myGen.addAnnotation(a);
unusedDecafs.addAll(decaFs);
for (int fieldCounter = 0; fieldCounter < fields.size(); fieldCounter++) {
BcelField aBcelField = (BcelField) fields.get(fieldCounter);// new
- // BcelField(clazz.getBcelObjectType(),fields[fieldCounter
- // ]);
+ // BcelField(clazz.getBcelObjectType(),fields[fieldCounter
+ // ]);
if (!aBcelField.getName().startsWith(NameMangler.PREFIX)) {
// Single first pass
List worthRetrying = new ArrayList();
}
if (decaF.getAnnotationX().isRuntimeVisible()) { // isAnnotationWithRuntimeRetention(clazz.
- // getJavaClass(world))){
+ // getJavaClass(world))){
// if(decaF.getAnnotationTypeX().isAnnotationWithRuntimeRetention(world)){
// it should be runtime visible, so put it on the Field
// Annotation a = decaF.getAnnotationX().getBcelAnnotation();
parttwo.append(InstructionFactory.createDup(1));
int slotForThis = synchronizedMethod.allocateLocal(classType);
parttwo.append(InstructionFactory.createStore(clazzType, slotForThis)); // ? should be the real type ? String or
- // something?
+ // something?
parttwo.append(InstructionFactory.MONITORENTER);
String fieldname = synchronizedMethod.getEnclosingClass().allocateField("class$");
}
}
- void addPerSingletonField(Member field) {
- ObjectType aspectType = (ObjectType) BcelWorld.makeBcelType(field.getReturnType());
- String aspectName = field.getReturnType().getName();
-
- LazyMethodGen clinit = clazz.getStaticInitializer();
- InstructionList setup = new InstructionList();
- InstructionFactory fact = clazz.getFactory();
-
- setup.append(fact.createNew(aspectType));
- setup.append(InstructionFactory.createDup(1));
- setup.append(fact.createInvoke(aspectName, "<init>", Type.VOID, new Type[0], Constants.INVOKESPECIAL));
- setup.append(fact.createFieldAccess(aspectName, field.getName(), aspectType, Constants.PUTSTATIC));
- clinit.getBody().insert(setup);
- }
+ // void addPerSingletonField(Member field) {
+ // ObjectType aspectType = (ObjectType) BcelWorld.makeBcelType(field.getReturnType());
+ // String aspectName = field.getReturnType().getName();
+ //
+ // LazyMethodGen clinit = clazz.getStaticInitializer();
+ // InstructionList setup = new InstructionList();
+ // InstructionFactory fact = clazz.getFactory();
+ //
+ // setup.append(fact.createNew(aspectType));
+ // setup.append(InstructionFactory.createDup(1));
+ // setup.append(fact.createInvoke(aspectName, "<init>", Type.VOID, new Type[0], Constants.INVOKESPECIAL));
+ // setup.append(fact.createFieldAccess(aspectName, field.getName(), aspectType, Constants.PUTSTATIC));
+ // clinit.getBody().insert(setup);
+ // }
/**
* Returns null if this is not a Java constructor, and then we won't weave into it at all
private boolean match(BcelShadow shadow, List shadowAccumulator) {
// System.err.println("match: " + shadow);
if (captureLowLevelContext) { // duplicate blocks - one with context capture, one without, seems faster than multiple
- // 'ifs()'
+ // 'ifs()'
ContextToken shadowMatchToken = CompilationAndWeavingContext.enteringPhase(
CompilationAndWeavingContext.MATCHING_SHADOW, shadow);
boolean isMatched = false;