]> source.dussan.org Git - aspectj.git/commitdiff
minor pruning (semantics preserving)
authorehilsdal <ehilsdal>
Fri, 14 Nov 2003 05:43:40 +0000 (05:43 +0000)
committerehilsdal <ehilsdal>
Fri, 14 Nov 2003 05:43:40 +0000 (05:43 +0000)
12 files changed:
weaver/src/org/aspectj/weaver/AjAttribute.java
weaver/src/org/aspectj/weaver/AjcMemberMaker.java
weaver/src/org/aspectj/weaver/Member.java
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/org/aspectj/weaver/bcel/BcelVar.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
weaver/src/org/aspectj/weaver/patterns/PatternParser.java
weaver/src/org/aspectj/weaver/patterns/ThrowsPattern.java
weaver/src/org/aspectj/weaver/patterns/TypePattern.java
weaver/testsrc/org/aspectj/weaver/bcel/MegaZipTestCase.java

index 217f042806a03381a432db4f2dabba7b45667f2f..417fa7ce56a6300ae5965ab0e135183fb0002a13 100644 (file)
@@ -130,7 +130,7 @@ public abstract class AjAttribute {
                public String getNameString() {
                        return AttributeName;
                }
-               private ResolvedTypeMunger munger;
+               // private ResolvedTypeMunger munger;
                public AjSynthetic() {}
 
                public void write(DataOutputStream s) throws IOException {}
index 308b020b9612ba0fd5b5045292d66b653ba9de91..d91d5f65c4b3df13e08d72fcce3a5a8b6a47611c 100644 (file)
@@ -386,7 +386,6 @@ public class AjcMemberMaker {
                //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)
index 7e3b2474fe0882375b84519a69a456e3ddc8354d..8eddb8b23834b4fafca4fe3fe553036b9df84e79 100644 (file)
@@ -247,7 +247,7 @@ public class Member implements Comparable {
     
     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;
index 51308b4bb5ec61d431d775c226e87348ea83a42c..fde2d9d0ed830eb19233ac51d18f4837b77f9850 100644 (file)
@@ -850,7 +850,7 @@ class BcelClassWeaver implements IClassWeaver {
                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
index 9bc3b3fa362a4245fcffa2bf9afbd332950a3108..6d45e96dba0dfa25f01b0e88d8ab1b85ee340d3d 100644 (file)
@@ -429,7 +429,7 @@ public class BcelShadow extends Shadow {
                Member interfaceConstructorSignature) 
        {
                InstructionList body = constructor.getBody();
-               TypeX inType = constructor.getEnclosingClass().getType();
+               // TypeX inType = constructor.getEnclosingClass().getType();
         BcelShadow s =
             new BcelShadow(
                 world,
@@ -453,9 +453,9 @@ public class BcelShadow extends Shadow {
                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,
@@ -705,13 +705,13 @@ public class BcelShadow extends Shadow {
                }
        }
 
-    // ---- 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
 
@@ -766,7 +766,7 @@ public class BcelShadow extends Shadow {
     // 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();
@@ -948,7 +948,7 @@ public class BcelShadow extends Shadow {
         * (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()) {
@@ -1354,7 +1354,7 @@ public class BcelShadow extends Shadow {
        // 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();
@@ -1366,7 +1366,7 @@ public class BcelShadow extends Shadow {
                                        this,
                                        null,
                                        new InstructionList(InstructionConstants.ACONST_NULL)));
-                   adviceMethodInvocation =
+                   // adviceMethodInvocation =
                        advice.append(
                                Utility.createInvoke(fact, localAdviceMethod)); //(fact, getWorld(), munger.getSignature()));
                        advice.append(
index d2f1d35f31ff8c6ed59bf3ee6d62c01d57d79e0b..dddd47a16d37967dd804e9f0de4b8179124651b9 100644 (file)
@@ -39,21 +39,18 @@ public class BcelVar extends Var {
 
     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(
@@ -64,11 +61,9 @@ public class BcelVar extends Var {
                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));
index 78ee0d576c5517b5da51735adbabe26b716ba792..3a83bf2c418c2fd9a970bd2dd38bd26af4298097 100644 (file)
@@ -151,7 +151,7 @@ public class BcelWeaver implements IWeaver {
                        
                        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...
index a74e7918c157a60371cc46188a9e8c3c968524e5..873b0781888b15b95a64daf21182b40435a4a451 100644 (file)
@@ -52,7 +52,7 @@ public class BcelWorld extends World {
        private ClassPathManager classPath;
        
        //private ClassPathManager aspectPath = null;
-       private List aspectPathEntries;
+       // private List aspectPathEntries;
        
     // ---- constructors
 
index d2f9b9b0c210132cbd6a36de63c6e1c9d984cf0a..0f0bd3e577c83f20b93c79c311f922ebdc404200 100644 (file)
@@ -399,7 +399,7 @@ public class PatternParser {
        
        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;                       
index 5de0c16b7eb424cd59161ffeb46ef3deec785a5d..113b900006d38db86dfb260a1cdb8703d1ffe175 100644 (file)
@@ -72,7 +72,7 @@ public class ThrowsPattern extends PatternNode {
                //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;
index 7568f75b00e272e530dfc60e05babce10703e3d4..6c58c5c6b6aad1794e42cc5a3225a001afaaafd8 100644 (file)
@@ -91,7 +91,7 @@ public abstract class TypePattern extends PatternNode {
                        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;
index c790b4dc7c28311973f836182dd6cc67152e1d97..e44ee1f72346fa53f37e5b728224b34b561a2545 100644 (file)
@@ -44,7 +44,7 @@ public class MegaZipTestCase extends WeaveTestCase {
 
 
     private BcelAdvice makeAroundMunger(final boolean matchOnlyPrintln) {
-        BcelWorld world = new BcelWorld();
+        // BcelWorld world = new BcelWorld();
         final Member sig = 
             Member.method(
                 TypeX.forName("fluffy.Aspect"),