Tag fresh = tagMap.get(oldTag);
if (fresh == null) {
fresh = oldTag.copy();
if (old instanceof LocalVariableTag) {
// LocalVariable
LocalVariableTag lvTag = (LocalVariableTag) old;
LocalVariableTag lvTagFresh = (LocalVariableTag) fresh;
if (lvTag.getSlot() == 0) {
fresh = new LocalVariableTag(lvTag.getRealType().getSignature(), "ajc$aspectInstance",
frameEnv.get(lvTag.getSlot()), 0);
} else {
// // Do not move it - when copying the code from the aspect to the affected target, 'this' is
// // going to change from aspect to affected type. So just fix the type
// System.out.println("For local variable tag at instruction " + src + " changing slot from "
// + lvTag.getSlot() + " > " + frameEnv.get(lvTag.getSlot()));
lvTagFresh.updateSlot(frameEnv.get(lvTag.getSlot()));
}
}
tagMap.put(oldTag, fresh);
}
dest.addTargeter(fresh);