]> source.dussan.org Git - aspectj.git/commitdiff
remove unused code - improve path detection
authoraclement <aclement>
Mon, 1 Sep 2008 20:52:41 +0000 (20:52 +0000)
committeraclement <aclement>
Mon, 1 Sep 2008 20:52:41 +0000 (20:52 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java

index 43b211a718644d9f53ce3de0dc8edcd9c2987509..45fe0fa3a6ec5822fd876fe6a44d831e5235f6dd 100644 (file)
@@ -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;
index 3fcc0ab024d2ee615469704c7acdf0780d66adf2..1392a80d7097d135e834626ccdac67ac250b21cb 100644 (file)
@@ -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];
index 48970547c4db65d9abbbed53a78afed6267333f7..19030715d3cdc4ce77cc085b927f9c7e2adecf32 100644 (file)
@@ -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)
        }
 
        /**
index 7e6b69ca537184d1667a621fa919a14495d03705..6b71647efa5df82d5329058718917dc37b86b447 100644 (file)
@@ -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 {