diff options
author | aclement <aclement> | 2008-09-01 20:52:41 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-01 20:52:41 +0000 |
commit | c5f29f24913fafe0983b51ee6ea175326bda4221 (patch) | |
tree | c28049d25701d208be7992e0c2cf4e0d0d313053 /weaver | |
parent | df779877b56586c5a4e226ac8b73d70386bf5039 (diff) | |
download | aspectj-c5f29f24913fafe0983b51ee6ea175326bda4221.tar.gz aspectj-c5f29f24913fafe0983b51ee6ea175326bda4221.zip |
remove unused code - improve path detection
Diffstat (limited to 'weaver')
4 files changed, 32 insertions, 36 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 43b211a71..45fe0fa3a 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -368,7 +368,7 @@ class BcelClassWeaver implements IClassWeaver { .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 */ @@ -883,16 +883,16 @@ class BcelClassWeaver implements IClassWeaver { 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); @@ -1186,8 +1186,8 @@ class BcelClassWeaver implements IClassWeaver { 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(); @@ -1209,7 +1209,7 @@ class BcelClassWeaver implements IClassWeaver { } 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(); @@ -1637,7 +1637,7 @@ class BcelClassWeaver implements IClassWeaver { 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$"); @@ -2250,20 +2250,20 @@ class BcelClassWeaver implements IClassWeaver { } } - 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 @@ -2777,7 +2777,7 @@ class BcelClassWeaver implements IClassWeaver { 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; diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index 3fcc0ab02..1392a80d7 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -275,7 +275,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { if (typeVars == null) { Signature.ClassSignature classSig = getGenericClassTypeSignature();// cachedGenericClassTypeSignature;//javaClass. - // getGenericClassTypeSignature(); + // getGenericClassTypeSignature(); typeVars = new TypeVariable[classSig.formalTypeParameters.length]; for (int i = 0; i < typeVars.length; i++) { Signature.FormalTypeParameter ftp = classSig.formalTypeParameters[i]; diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java index 48970547c..19030715d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java @@ -113,8 +113,6 @@ public class BcelWorld extends World implements Repository { setCrossReferenceHandler(xrefHandler); // Tell BCEL to use us for resolving any classes delegate = this; - // TODO Alex do we need to call org.aspectj.apache.bcel.Repository.setRepository(delegate); - // if so, how can that be safe in J2EE ?? (static stuff in Bcel) } public BcelWorld(ClassPathManager cpm, IMessageHandler handler, ICrossReferenceHandler xrefHandler) { @@ -123,8 +121,6 @@ public class BcelWorld extends World implements Repository { setCrossReferenceHandler(xrefHandler); // Tell BCEL to use us for resolving any classes delegate = this; - // TODO Alex do we need to call org.aspectj.apache.bcel.Repository.setRepository(delegate); - // if so, how can that be safe in J2EE ?? (static stuff in Bcel) } /** diff --git a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java index 7e6b69ca5..6b71647ef 100644 --- a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java @@ -152,7 +152,7 @@ public class ClassPathManager { public abstract static class Entry { public abstract ClassFile find(String name) throws IOException; - public abstract List getAllClassFiles() throws IOException; + // public abstract List getAllClassFiles() throws IOException; } private static class FileClassFile extends ClassFile { |