public String getNameString() {
return AttributeName;
}
- private ResolvedTypeMunger munger;
+ // private ResolvedTypeMunger munger;
public AjSynthetic() {}
public void write(DataOutputStream s) throws IOException {}
//System.out.println("ret: " + ret + " mods: " + Modifier.toString(modifiers));
if (Modifier.isPublic(constructor.getModifiers()))
return ret;
- int i = 0;
while (true) {
ret = addCookieTo(ret, aspectType);
if (targetType.lookupMemberNoSupers(ret) == null)
public static Member methodFromString(String str) {
str = str.trim();
- final int len = str.length();
+ // final int len = str.length();
int i = 0;
int mods = 0;
if (i instanceof FieldInstruction) {
FieldInstruction fi = (FieldInstruction) i;
- if (i instanceof PUTFIELD || i instanceof PUTSTATIC) {
+ if (fi instanceof PUTFIELD || fi instanceof PUTSTATIC) {
// check for sets of constant fields. We first check the previous
// instruction. If the previous instruction is a LD_WHATEVER (push
// constant on the stack) then we must resolve the field to determine
Member interfaceConstructorSignature)
{
InstructionList body = constructor.getBody();
- TypeX inType = constructor.getEnclosingClass().getType();
+ // TypeX inType = constructor.getEnclosingClass().getType();
BcelShadow s =
new BcelShadow(
world,
InstructionHandle next,
Member interfaceConstructorSignature)
{
- final InstructionFactory fact = constructor.getEnclosingClass().getFactory();
+ // final InstructionFactory fact = constructor.getEnclosingClass().getFactory();
InstructionList body = constructor.getBody();
- TypeX inType = constructor.getEnclosingClass().getType();
+ // TypeX inType = constructor.getEnclosingClass().getType();
BcelShadow s =
new BcelShadow(
world,
}
}
- // ---- type access methods
- private ObjectType getTargetBcelType() {
- return (ObjectType) BcelWorld.makeBcelType(getTargetType());
- }
- private Type getArgBcelType(int arg) {
- return BcelWorld.makeBcelType(getArgType(arg));
- }
+// // ---- type access methods
+// private ObjectType getTargetBcelType() {
+// return (ObjectType) BcelWorld.makeBcelType(getTargetType());
+// }
+// private Type getArgBcelType(int arg) {
+// return BcelWorld.makeBcelType(getArgType(arg));
+// }
// ---- kinding
// reflective thisJoinPoint support
private BcelVar thisJoinPointVar = null;
private BcelVar thisJoinPointStaticPartVar = null;
- private BcelVar thisEnclosingJoinPointStaticPartVar = null;
+ // private BcelVar thisEnclosingJoinPointStaticPartVar = null;
public final Var getThisJoinPointVar() {
return getThisJoinPointBcelVar();
* (Unless we have a void return type in which case there's nothing)
*/
public void weaveAfterReturning(BcelAdvice munger) {
- InstructionFactory fact = getFactory();
+ // InstructionFactory fact = getFactory();
List returns = new ArrayList();
Instruction ret = null;
for (InstructionHandle ih = range.getStart(); ih != range.getEnd(); ih = ih.getNext()) {
// we push a null for the unused closure. It's sad, but there it is.
InstructionList advice = new InstructionList();
- InstructionHandle adviceMethodInvocation;
+ // InstructionHandle adviceMethodInvocation;
{
for (Iterator i = argVarList.iterator(); i.hasNext(); ) {
BcelVar var = (BcelVar)i.next();
this,
null,
new InstructionList(InstructionConstants.ACONST_NULL)));
- adviceMethodInvocation =
+ // adviceMethodInvocation =
advice.append(
Utility.createInvoke(fact, localAdviceMethod)); //(fact, getWorld(), munger.getSignature()));
advice.append(
public int getSlot() { return slot; }
+ // fact is used in the subtypes
public Instruction createLoad(InstructionFactory fact) {
- // TODO: remove fact
return InstructionFactory.createLoad(BcelWorld.makeBcelType(getType()), slot);
}
public Instruction createStore(InstructionFactory fact) {
- // TODO: remove fact
return InstructionFactory.createStore(BcelWorld.makeBcelType(getType()), slot);
}
public void appendStore(InstructionList il, InstructionFactory fact) {
- // TODO: remove fact
il.append(createStore(fact));
}
public void appendLoad(InstructionList il, InstructionFactory fact) {
- // TODO: remove fact
il.append(createLoad(fact));
}
public void appendLoadAndConvert(
Utility.appendConversion(il, fact, getType(), toType);
}
public void insertLoad(InstructionList il, InstructionFactory fact) {
- // TODO: remove fact
il.insert(createLoad(fact));
}
public InstructionList createCopyFrom(InstructionFactory fact, int oldSlot) {
- // TODO: remove fact
InstructionList il = new InstructionList();
il.append(InstructionFactory.createLoad(BcelWorld.makeBcelType(getType()), oldSlot));
il.append(createStore(fact));
FileInputStream fis = new FileInputStream(files[i]);
byte[] bytes = FileUtil.readAsByteArray(fis);
- String relativePath = files[i].getPath();
+ // String relativePath = files[i].getPath();
// ASSERT: files[i].getAbsolutePath().startsWith(inFile.getAbsolutePath()
// or we are in trouble...
private ClassPathManager classPath;
//private ClassPathManager aspectPath = null;
- private List aspectPathEntries;
+ // private List aspectPathEntries;
// ---- constructors
private TypePattern parseAtomicTypePattern() {
if (maybeEat("!")) {
- int startPos = tokenSource.peek(-1).getStart();
+ //int startPos = tokenSource.peek(-1).getStart();
//??? we lose source location for true start of !type
TypePattern p = new NotTypePattern(parseAtomicTypePattern());
return p;
//System.out.println("matching: " + this + " with " + Arrays.asList(tys));
ResolvedTypeX[] types = world.resolve(tys);
- int len = types.length;
+ // int len = types.length;
for (int j=0, lenj = required.size(); j < lenj; j++) {
if (! matchesAny(required.get(j), types)) {
return false;
return true;
}
- FuzzyBoolean ret = FuzzyBoolean.NO; // ??? -eh
+ // FuzzyBoolean ret = FuzzyBoolean.NO; // ??? -eh
for (Iterator i = type.getDirectSupertypes(); i.hasNext(); ) {
ResolvedTypeX superType = (ResolvedTypeX)i.next();
if (matchesSubtypes(superType)) return true;
private BcelAdvice makeAroundMunger(final boolean matchOnlyPrintln) {
- BcelWorld world = new BcelWorld();
+ // BcelWorld world = new BcelWorld();
final Member sig =
Member.method(
TypeX.forName("fluffy.Aspect"),