]> source.dussan.org Git - aspectj.git/commitdiff
eclipse: addressed unnecessary casts, unused code, invalid null checks
authoraclement <aclement>
Wed, 27 Aug 2008 01:43:03 +0000 (01:43 +0000)
committeraclement <aclement>
Wed, 27 Aug 2008 01:43:03 +0000 (01:43 +0000)
56 files changed:
weaver/src/org/aspectj/weaver/AjcMemberMaker.java
weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java
weaver/src/org/aspectj/weaver/ReferenceType.java
weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
weaver/src/org/aspectj/weaver/ResolvedType.java
weaver/src/org/aspectj/weaver/ShadowMunger.java
weaver/src/org/aspectj/weaver/TypeVariable.java
weaver/src/org/aspectj/weaver/World.java
weaver/src/org/aspectj/weaver/ast/HasAnnotation.java
weaver/src/org/aspectj/weaver/ast/Instanceof.java
weaver/src/org/aspectj/weaver/ast/Not.java
weaver/src/org/aspectj/weaver/ast/Or.java
weaver/src/org/aspectj/weaver/bcel/AnnotationAccessFieldVar.java
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java
weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java
weaver/src/org/aspectj/weaver/bcel/IfFinder.java
weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
weaver/src/org/aspectj/weaver/ltw/LTWWorld.java
weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/ConcreteCflowPointcut.java
weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
weaver/src/org/aspectj/weaver/patterns/PatternParser.java
weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java
weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java
weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java
weaver/src/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/TypePattern.java
weaver/src/org/aspectj/weaver/patterns/TypeVariablePattern.java
weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
weaver/testsrc/org/aspectj/weaver/CommonsTraceTest.java
weaver/testsrc/org/aspectj/weaver/DefaultTraceTest.java
weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java
weaver/testsrc/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java
weaver/testsrc/org/aspectj/weaver/bcel/ClassLoaderRepositoryTests.java
weaver/testsrc/org/aspectj/weaver/patterns/AndOrNotTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java
weaver/testsrc/org/aspectj/weaver/tools/PointcutDesignatorHandlerTests.java

index cfa883d80c2355beb54aebcbd96093b0168ee96a..219d365acf4bfcdb4bcd2d311e7263340c70b661 100644 (file)
@@ -258,7 +258,7 @@ public class AjcMemberMaker {
                return new ResolvedMemberImpl(Member.METHOD,
                        declaringType, PUBLIC_STATIC, "hasAspect", 
                        "()Z");         
-       };
+       }
        
        public static ResolvedMember perCflowAspectOfMethod(UnresolvedType declaringType) {
                return perSingletonAspectOfMethod(declaringType);
@@ -266,7 +266,7 @@ public class AjcMemberMaker {
        
        public static ResolvedMember perCflowHasAspectMethod(UnresolvedType declaringType) {
                return perSingletonHasAspectMethod(declaringType);
-       };
+       }
        
        public static ResolvedMember perObjectAspectOfMethod(UnresolvedType declaringType) {
                return new ResolvedMemberImpl(Member.METHOD,
@@ -278,7 +278,7 @@ public class AjcMemberMaker {
                return new ResolvedMemberImpl(Member.METHOD,
                        declaringType, PUBLIC_STATIC, "hasAspect", 
                        "(Ljava/lang/Object;)Z");               
-       };
+       }
        
        // PTWIMPL ResolvedMember for aspectOf(), declared in aspect
        public static ResolvedMember perTypeWithinAspectOfMethod(UnresolvedType declaringType,boolean inJava5Mode) {
@@ -331,7 +331,7 @@ public class AjcMemberMaker {
 //             return new ResolvedMemberImpl(Member.METHOD,
 //                     declaringType, PUBLIC_STATIC, "hasAspect", 
 //                     "(Ljava/lang/Class;)Z");                
-       };
+       }
        
        // -- privileged accessors
        
index c7590f5cdee7dd7a94f7328d539fd3047fe11d04..e560ae8b25babbf16e282ef2b6b14365be988105 100644 (file)
@@ -34,7 +34,6 @@ import org.aspectj.weaver.tools.TraceFactory;
  * @author Jim Hugunin
  */
 public class CrosscuttingMembersSet {
-       private World world;
        //FIXME AV - ? we may need a sequencedHashMap there to ensure source based precedence for @AJ advice
     private Map /* ResolvedType (the aspect) > CrosscuttingMembers */members = new HashMap();
        
@@ -56,8 +55,6 @@ public class CrosscuttingMembersSet {
        public CrosscuttingMembersSet(World world) {
                trace.enter("<init>",this,world);
 
-               this.world = world;
-
                trace.exit("<init>");
        }
 
index 0985966fd109681be4042f61b72a19c709c4091b..4487f50cd3e58adcd43d1852af16e1c49c435180 100644 (file)
@@ -304,7 +304,7 @@ public class ReferenceType extends ResolvedType {
                        if (isAssignableFrom((ResolvedType)other.getRawType())) return true;
                }
                if (this.isGenericType() && other.isRawType()) {
-                       if (isAssignableFrom((ResolvedType)other.getGenericType())) return true;
+                       if (isAssignableFrom(other.getGenericType())) return true;
                }
                
                if (this.isParameterizedType()) {
@@ -415,7 +415,7 @@ public class ReferenceType extends ResolvedType {
                if (parameterizedInterfaces != null) return parameterizedInterfaces;
                if (isParameterizedType()) {
                        ResolvedType[] delegateInterfaces = delegate.getDeclaredInterfaces();
-                       UnresolvedType[] paramTypes = getTypesForMemberParameterization();
+//                     UnresolvedType[] paramTypes = getTypesForMemberParameterization();
                        parameterizedInterfaces = new ResolvedType[delegateInterfaces.length];
                        for (int i = 0; i < delegateInterfaces.length; i++) {
                                // We may have to sub/super set the set of parametertypes if the implemented interface
@@ -453,15 +453,15 @@ public class ReferenceType extends ResolvedType {
         * Locates the named type variable in the list of those on this generic type and returns
         * the type parameter from the second list supplied.  Returns null if it can't be found
         */
-       private UnresolvedType findTypeParameterInList(String name, TypeVariable[] tvarsOnThisGenericType, UnresolvedType[] paramTypes) {
-               int position = -1;
-               for (int i = 0; i < tvarsOnThisGenericType.length; i++) {
-                       TypeVariable tv = tvarsOnThisGenericType[i];
-                       if (tv.getName().equals(name)) position = i;
-               }
-               if (position == -1 ) return null;
-               return paramTypes[position];
-       }
+//     private UnresolvedType findTypeParameterInList(String name, TypeVariable[] tvarsOnThisGenericType, UnresolvedType[] paramTypes) {
+//             int position = -1;
+//             for (int i = 0; i < tvarsOnThisGenericType.length; i++) {
+//                     TypeVariable tv = tvarsOnThisGenericType[i];
+//                     if (tv.getName().equals(name)) position = i;
+//             }
+//             if (position == -1 ) return null;
+//             return paramTypes[position];
+//     }
        
 
        /**
index 8b8473b3a091997cef21461452951ada859ef2ea..a239ba5348a5f39ea20e2481d550898ed300f783 100644 (file)
@@ -500,7 +500,6 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
                                        int ps = s.readInt();
                                        UnresolvedType[] params = new UnresolvedType[ps];
                                        for (int i = 0; i < params.length; i++) {
-                                               UnresolvedType type = params[i];
                                                params[i]=TypeFactory.createTypeFromSignature(s.readUTF());
                                        }
                                        UnresolvedType rt =  TypeFactory.createTypeFromSignature(s.readUTF());
index dec39455d9ac52231d455ab6b9ea3f75bb816e5c..79ede540a3e717fe9e8e4c183ec84279d014cc9e 100644 (file)
@@ -1262,7 +1262,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        ConcreteTypeMunger munger = (ConcreteTypeMunger) iter.next();
             if (munger.getSignature() != null && munger.getSignature().isAbstract()) { // Rule 1
                 if (munger.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) {
-                    ;//ignore for @AJ ITD as munger.getSignature() is the interface method hence abstract
+                    //ignore for @AJ ITD as munger.getSignature() is the interface method hence abstract
                 } else {
                 world.getMessageHandler().handleMessage(
                     new Message("must implement abstract inter-type declaration: " + munger.getSignature(),
@@ -1457,7 +1457,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        return;
                }
                
-               ConcreteTypeMunger originalMunger = munger;
+//             ConcreteTypeMunger originalMunger = munger;
                // we will use the 'parameterized' ITD for all the comparisons but we say the original
         // one passed in actually matched as it will be added to the intertype member finder
                // for the target type.  It is possible we only want to do this if a generic type 
@@ -1604,7 +1604,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                                                        existingMember),
                                                        munger.getSourceLocation())
                     );
-                    ;
+                    
                                }
                                //return;
                        }
@@ -1834,16 +1834,6 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                return this;
        }
        
-       private ResolvedType findHigher(ResolvedType other) {
-        if (this == other) return this;
-     for(Iterator i = other.getDirectSupertypes(); i.hasNext(); ) {
-       ResolvedType rtx = (ResolvedType)i.next();
-       boolean b = this.isAssignableFrom(rtx);
-       if (b) return rtx;
-     }       
-     return null;
-       }
-       
        public List getExposedPointcuts() {
                List ret = new ArrayList();
                if (getSuperclass() != null) ret.addAll(getSuperclass().getExposedPointcuts());
index 50f3f4e0b307e0e66e7734632297e6fa8b2124a3..1328f02ae79f2047143e786f22ab8949a6dc4df5 100644 (file)
@@ -277,7 +277,7 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH
        int deCtr = 1;
        int dwCtr = 1;
        for (Iterator iter = children.iterator(); iter.hasNext();) {
-                       Object element = (Object) iter.next();
+                       Object element = iter.next();
                        if (element instanceof DeclareErrorOrWarning) {
                                DeclareErrorOrWarning decl = (DeclareErrorOrWarning)element;
                                int counter = 0;
index 1241c7a17e63a787ab507d03a6b38e1c298abd95..2762fa74826da5a1a7c17cb50dc4551b37b10ad3 100644 (file)
@@ -13,8 +13,6 @@ package org.aspectj.weaver;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
 
 /**
  * Represents a type variable with bounds
index 0fd151e3475e63747423bbcc2443e13ad766dfb4..167d70b247e810a39e05f8257cf1939f313b7e33 100644 (file)
@@ -354,8 +354,6 @@ public abstract class World implements Dump.INode {
        return resolve(UnresolvedType.forName(name),allowMissing);
     }
     
-       private ResolvedType currentlyResolvingBaseType;
-
        /**
         * Resolve to a ReferenceType - simple, raw, parameterized, or generic.
      * Raw, parameterized, and generic versions of a type share a delegate.
@@ -366,10 +364,8 @@ public abstract class World implements Dump.INode {
                        ResolvedType rt = resolveGenericTypeFor(ty,allowMissing);
                        if (rt.isMissing()) return rt;
                        ReferenceType genericType = (ReferenceType)rt;
-                       currentlyResolvingBaseType = genericType;
-                                               ReferenceType parameterizedType = 
+                       ReferenceType parameterizedType = 
                                TypeFactory.createParameterizedType(genericType, ty.typeParameters, this);
-                       currentlyResolvingBaseType = null;
                        return parameterizedType;
                        
                } else if (ty.isGenericType()) {
@@ -414,7 +410,7 @@ public abstract class World implements Dump.INode {
     public ResolvedType resolveGenericTypeFor(UnresolvedType anUnresolvedType, boolean allowMissing) {
         // Look up the raw type by signature
        String rawSignature = anUnresolvedType.getRawType().getSignature();
-       ResolvedType rawType = (ResolvedType) typeMap.get(rawSignature);
+       ResolvedType rawType = typeMap.get(rawSignature);
        if (rawType==null) {
                rawType = resolve(UnresolvedType.forSignature(rawSignature),allowMissing);
                typeMap.put(rawSignature,rawType);
@@ -859,9 +855,9 @@ public abstract class World implements Dump.INode {
                private static boolean debug = false;
 
                // Strategy for entries in the expendable map
-               public static int DONT_USE_REFS = 0; // Hang around forever
-               public static int USE_WEAK_REFS = 1; // Collected asap
-               public static int USE_SOFT_REFS = 2; // Collected when short on memory
+               public final static int DONT_USE_REFS = 0; // Hang around forever
+               public final static int USE_WEAK_REFS = 1; // Collected asap
+               public final static int USE_SOFT_REFS = 2; // Collected when short on memory
                
                // SECRETAPI - Can switch to a policy of choice ;)
                public static int policy  = USE_SOFT_REFS; 
@@ -1085,7 +1081,6 @@ public abstract class World implements Dump.INode {
        protected boolean isExpendable(ResolvedType type) {
                return (
                                !type.equals(UnresolvedType.OBJECT) && 
-                                 (type != null) &&
                                  (!type.isExposedToWeaver()) &&
                                  (!type.isPrimitiveType())
                                );
index e29cfcec317c3cfcb92d3b0b26df0df887f6d056..885e9d083e55363c1e389c1f0c248164c514fd33 100644 (file)
@@ -43,6 +43,10 @@ public class HasAnnotation extends Test {
                        return false;
                }
        }
+       
+       public int hashCode() {
+               return v.hashCode()*37+annType.hashCode();
+       }
 
     public Var getVar() {
         return v;
index 1fccf04ce9778735ef877aaeb46c32e55d792d12..feec6a2bee55af4bab524c14c225498070ebd401 100644 (file)
@@ -41,6 +41,10 @@ public class Instanceof extends Test {
                        return false;
                }
        }
+       
+       public int hashCode() {
+               return var.hashCode()*37+type.hashCode();
+       }
 
     public Var getVar() {
         return var;
index d6db5727f4940a9c52f3860141a7647767d45923..366a193a47d9574651164ae38f75ce4b7b4c1265 100644 (file)
@@ -42,4 +42,8 @@ public class Not extends Test {
                        return false;
                }
        }
+       
+       public int hashCode() {
+               return test.hashCode();
+       }
 }
index ebc4ad1420e9b6da2540bed9d265bfbf30571ddc..b3143df7324a1869469f869435e5483c789b290e 100644 (file)
@@ -39,6 +39,13 @@ public class Or extends Test {
                }
        }
 
+    public int hashCode() {
+        int result = 19;
+        result = 37*result + left.hashCode();
+        result = 37*result + right.hashCode();
+        return result;
+    }
+
     public Test getLeft() {
         return left;
     }
index 119f78b58015604721edb02919f7057d2c791ac7..366e9b7319013fd9a39247d1b54a3d47d84c5f50 100644 (file)
@@ -71,7 +71,7 @@ public class AnnotationAccessFieldVar extends BcelVar {
                 boolean doneAndDusted = false;
                 for (Iterator iterator = vals.iterator(); iterator.hasNext();) {
                     ElementNameValuePairGen object = (ElementNameValuePairGen) iterator.next();
-                    String name = object.getNameString();
+//                    String name = object.getNameString();
                     EnumElementValueGen v = (EnumElementValueGen) object.getValue();
                     String s = v.getEnumTypeString();
                     ResolvedType rt = toType.getWorld().resolve(UnresolvedType.forSignature(s));
index 757fac8eb469deef017197043ba607fb222aefa7..1eb7d44421e61a90b370f822d9a8b50c31d0a032 100644 (file)
@@ -293,7 +293,7 @@ public class AtAjAttributes {
             for (int j = 0; j < mattributes.length; j++) {
                 Attribute mattribute = mattributes[j];
                 if (acceptAttribute(mattribute)) {
-                       if (mstruct==null) mstruct = new AjAttributeMethodStruct(method, null, type, context, msgHandler);//FIXME AVASM
+                       mstruct = new AjAttributeMethodStruct(method, null, type, context, msgHandler);//FIXME AVASM
                     processedPointcut = handlePointcutAnnotation((RuntimeAnnotations) mattribute, mstruct);
                     // there can only be one RuntimeVisible bytecode attribute
                     break;
@@ -332,7 +332,7 @@ public class AtAjAttributes {
                                             type.getSourceLocation()
                                     )
                             );
-                            ;// go ahead
+                            // go ahead
                         }
                     }
                     // there can only be one RuntimeVisible bytecode attribute
@@ -421,7 +421,7 @@ public class AtAjAttributes {
                             type.getSourceLocation()
                     )
             );
-            ;// go ahead
+            // go ahead
         }
         // semantic check - advice must be public
         if (hasAtAspectJAnnotation && !struct.method.isPublic()) {
@@ -433,7 +433,7 @@ public class AtAjAttributes {
                             type.getSourceLocation()
                     )
             );
-            ;// go ahead
+            // go ahead
         }
         
         // semantic check - advice must not be static
@@ -446,7 +446,7 @@ public class AtAjAttributes {
 //                            type.getSourceLocation()
 //                    )
 //            );
-            ;// go ahead
+            // go ahead
         }
         
         // semantic check for non around advice must return void
@@ -461,7 +461,7 @@ public class AtAjAttributes {
                             type.getSourceLocation()
                     )
             );
-            ;// go ahead
+            // go ahead
         }
 
         return struct.ajAttributes;
@@ -744,7 +744,7 @@ public class AtAjAttributes {
                     boolean hasAtLeastOneMethod = false;
                     ResolvedMember[] methods = (ResolvedMember[])fieldType.getMethodsWithoutIterator(true, false).toArray(new ResolvedMember[0]);
                     for (int i = 0; i < methods.length; i++) {
-                        ResolvedMember method = (ResolvedMember)methods[i];
+                        ResolvedMember method = methods[i];
                         if (method.isAbstract()) {
                         // moved to be detected at weave time if the target doesnt implement the methods
 //                            if (defaultImplClassName == null) {
@@ -1187,13 +1187,13 @@ public class AtAjAttributes {
         if (!(Type.VOID.equals(struct.method.getReturnType())
               || (Type.BOOLEAN.equals(struct.method.getReturnType()) && struct.method.isStatic() && struct.method.isPublic()))) {
             reportWarning("Found @Pointcut on a method not returning 'void' or not 'public static boolean'", struct);
-            ;//no need to stop
+            //no need to stop
         }
 
         // semantic check: the method must not throw anything
         if (struct.method.getExceptionTable() != null) {
             reportWarning("Found @Pointcut on a method throwing exception", struct);
-            ;// no need to stop
+            // no need to stop
         }
 
         String argumentNames = getArgNamesValue(pointcut);
@@ -1363,20 +1363,6 @@ public class AtAjAttributes {
         return sb.toString();
     }
 
-    /**
-     * Returns a readable representation of a field.
-     * Field.toString() is not suitable.
-     *
-     * @param field
-     * @return a readable representation of a field
-     */
-    private static String fieldToString(Field field) {
-        StringBuffer sb = new StringBuffer();
-        sb.append(field.getName()).append(' ');
-        sb.append(field.getSignature());
-        return sb.toString();
-    }
-
     /**
      * Build the bindings for a given method (pointcut / advice)
      *
@@ -1421,11 +1407,11 @@ public class AtAjAttributes {
     private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct, String excludeFormal)
             throws UnreadableDebugInfoException {
         FormalBinding[] bindings = extractBindings(struct);
-        int excludeIndex = -1;
+//        int excludeIndex = -1;
         for (int i = 0; i < bindings.length; i++) {
             FormalBinding binding = bindings[i];
             if (binding.getName().equals(excludeFormal)) {
-                excludeIndex = i;
+//                excludeIndex = i;
                 bindings[i] = new FormalBinding.ImplicitFormalBinding(
                         binding.getType(), binding.getName(), binding.getIndex()
                 );
@@ -1560,7 +1546,7 @@ public class AtAjAttributes {
 
         final int startAtStackIndex = method.isStatic() ? 0 : 1;
         final List arguments = new ArrayList();
-        LocalVariableTable lt = (LocalVariableTable) method.getLocalVariableTable();
+        LocalVariableTable lt = method.getLocalVariableTable();
         if (lt != null) {
             for (int j = 0; j < lt.getLocalVariableTable().length; j++) {
                 LocalVariable localVariable = lt.getLocalVariableTable()[j];
index 79361ea6dd00223cd653659dc6936b71f8d3b165..31fcef6dd0da106b77614cb57f5651156f319bb8 100644 (file)
@@ -318,10 +318,7 @@ public class BcelAdvice extends Advice {
     private void removeUnnecessaryProblems(BcelMethod method, int problemLineNumber) {
                ISourceContext sourceContext = method.getSourceContext();
                if (sourceContext instanceof IEclipseSourceContext) {
-                       if (sourceContext != null 
-                               && sourceContext instanceof IEclipseSourceContext) {
-                               ((IEclipseSourceContext)sourceContext).removeUnnecessaryProblems(method, problemLineNumber);                                            
-                       }
+                       ((IEclipseSourceContext)sourceContext).removeUnnecessaryProblems(method, problemLineNumber);                                            
                }
     }
     
@@ -422,7 +419,7 @@ public class BcelAdvice extends Advice {
                BcelVar extraArgVar,
                InstructionHandle ifNoAdvice) 
        {
-        BcelShadow shadow = (BcelShadow) s;
+        BcelShadow shadow =  s;
         InstructionFactory fact = shadow.getFactory();
         BcelWorld world = shadow.getWorld();
                
@@ -504,7 +501,7 @@ public class BcelAdvice extends Advice {
             if (v == null) {
                 // if not @AJ aspect, go on with the regular binding handling
                if (!isAnnotationStyleAspect) {
-                       ;
+                       
                } else {
                     // ATAJ: for @AJ aspects, handle implicit binding of xxJoinPoint
                        //if (getKind() == AdviceKind.Around) {
index ca3d095de4d610205570f58932c52f9c25ad8e96..39094344e1bbc49ae58d8e60262df5341056a88c 100644 (file)
@@ -137,7 +137,7 @@ class BcelClassWeaver implements IClassWeaver {
        
        private Map mapToAnnotations = new HashMap();
     
-    private BcelShadow clinitShadow = null;
+//    private BcelShadow clinitShadow = null;
     
     /**
      * This holds the initialization and pre-initialization shadows for this class
@@ -182,7 +182,7 @@ class BcelClassWeaver implements IClassWeaver {
 
     private List[] perKindShadowMungers;
     private boolean canMatchBodyShadows = false;
-    private boolean canMatchInitialization = false;
+//    private boolean canMatchInitialization = false;
     private void fastMatchShadowMungers(List shadowMungers) {
        // beware the annoying property that SHADOW_KINDS[i].getKey == (i+1) !
        
@@ -207,8 +207,8 @@ class BcelClassWeaver implements IClassWeaver {
 //                     }
                }
        
-       if (!perKindShadowMungers[Shadow.Initialization.getKey()].isEmpty())
-               canMatchInitialization = true;
+//     if (!perKindShadowMungers[Shadow.Initialization.getKey()].isEmpty())
+//             canMatchInitialization = true;
        
        for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
                        Shadow.Kind kind = Shadow.SHADOW_KINDS[i];
@@ -1371,7 +1371,7 @@ class BcelClassWeaver implements IClassWeaver {
                InstructionHandle call = findSuperOrThisCall(mg);
                InstructionList body = mg.getBody();
                ShadowRange r = new ShadowRange(body);
-               r.associateWithShadow((BcelShadow) s);
+               r.associateWithShadow( s);
                if (s.getKind() == Shadow.PreInitialization) {
                        // XXX assert first instruction is an ALOAD_0.
                        // a pre shadow goes from AFTER the first instruction (which we believe to
@@ -1464,7 +1464,6 @@ class BcelClassWeaver implements IClassWeaver {
                InstructionList body    = synchronizedMethod.getBody();
                InstructionList prepend = new InstructionList();
                Type enclosingClassType = BcelWorld.makeBcelType(synchronizedMethod.getEnclosingClass().getType());
-               Type javaLangClassType  = Type.getType(Class.class);
                
                
                // STATIC METHOD TRANSFORMATION
@@ -2097,8 +2096,7 @@ class BcelClassWeaver implements IClassWeaver {
                        }
                        
                        // second pass: retarget branch instructions, copy ranges and tags
-                       Map tagMap = new HashMap();
-                       Map shadowMap = new HashMap();          
+                       Map tagMap = new HashMap();     
                        for (InstructionHandle dest = newList.getStart(), src = sourceList.getStart(); 
                                        dest != null; 
                                        dest = dest.getNext(), src = src.getNext()) {
@@ -2313,7 +2311,8 @@ class BcelClassWeaver implements IClassWeaver {
                        return false;                   
                } else {
                        if (startsAngly && mg.getName().equals("<clinit>")) {
-                               clinitShadow = enclosingShadow = BcelShadow.makeStaticInitialization(world, mg);
+//                             clinitShadow = 
+                                       enclosingShadow = BcelShadow.makeStaticInitialization(world, mg);
                                //System.err.println(enclosingShadow);
                        } else if (mg.isAdviceMethod()) {
                                enclosingShadow = BcelShadow.makeAdviceExecution(world, mg);
@@ -2389,7 +2388,7 @@ class BcelClassWeaver implements IClassWeaver {
                // XXX we don't do pre-inits of interfaces
                
                // now add interface inits
-               if (superOrThisCall != null && ! isThisCall(superOrThisCall)) {
+               if (! isThisCall(superOrThisCall)) {
                        InstructionHandle curr = enclosingShadow.getRange().getStart();
                        for (Iterator i = addedSuperInitializersAsList.iterator(); i.hasNext(); ) {
                                IfaceInitList l = (IfaceInitList) i.next();
@@ -2871,7 +2870,8 @@ class BcelClassWeaver implements IClassWeaver {
             shadow.implement();
             CompilationAndWeavingContext.leavingPhase(tok);
         }
-               int ii = mg.getMaxLocals();
+//             int ii = 
+               mg.getMaxLocals();
                mg.matchedShadows = null;
     }
     
index 0b63b479960d3ff56dca508730ee6d9ac2131f39..25951ac7c039f5d0529a680f6f97cea5ac814ec7 100644 (file)
@@ -67,20 +67,15 @@ public final class BcelMethod extends ResolvedMemberImpl {
        private BcelObjectType bcelObjectType;
        
        private int bitflags;
-       private static final int KNOW_IF_SYNTHETIC           = 0x0001; // used
-       private static final int PARAMETER_NAMES_INITIALIZED = 0x0002; // used
-       private static final int CAN_BE_PARAMETERIZED        = 0x0004; // used
-       private static final int UNPACKED_GENERIC_SIGNATURE  = 0x0008; // used
-       private static final int HAS_EFFECTIVE_SIGNATURE     = 0x0010;
-       private static final int HAS_PRERESOLVED_POINTCUT    = 0x0020;
+       private static final int KNOW_IF_SYNTHETIC           = 0x0001;
+       private static final int PARAMETER_NAMES_INITIALIZED = 0x0002;
+       private static final int CAN_BE_PARAMETERIZED        = 0x0004;
+       private static final int UNPACKED_GENERIC_SIGNATURE  = 0x0008;
        private static final int IS_AJ_SYNTHETIC             = 0x0040;
        private static final int IS_SYNTHETIC                = 0x0080;
        private static final int IS_SYNTHETIC_INVERSE        = 0x7f7f; // all bits but IS_SYNTHETIC (and topmost bit)
-       private static final int HAS_ASSOCIATED_SHADOWMUNGER = 0x0100;
-       private static final int HAS_GENERIC_RETPARAM_TYPES  = 0x0200;
-       private static final int HAS_ANNOTATIONS             = 0x0400; // used
-       private static final int HAVE_DETERMINED_ANNOTATIONS = 0x0800; // used
-       private static final int HAS_MD_LINE_NUMBER_ATTRIBUTE= 0x1000;
+       private static final int HAS_ANNOTATIONS             = 0x0400;
+       private static final int HAVE_DETERMINED_ANNOTATIONS = 0x0800;
        
 
         // genericized version of return and parameter types
@@ -247,7 +242,7 @@ public final class BcelMethod extends ResolvedMemberImpl {
        public String[] getAttributeNames(boolean onlyIncludeAjOnes) {
                Attribute[] as = method.getAttributes();
                List names = new ArrayList();
-               String[] strs = new String[as.length];
+//             String[] strs = new String[as.length];
                for (int j = 0; j < as.length; j++) {
                        if (!onlyIncludeAjOnes || as[j].getName().startsWith(AjAttribute.AttributePrefix))
                          names.add(as[j].getName());
index 6d248424c86fd240ee9ed606b589539e477c925e..2df95c53f23f0d69ee7d8b8229f3d1a23de4f9ea 100644 (file)
@@ -221,7 +221,7 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger {
 
         InstructionList il = method.getBody();
         il.append(Utility.createGet(factory, AjcMemberMaker.perSingletonField(aspectType)));
-        InstructionBranch ifNull = (InstructionBranch)InstructionFactory.createBranchInstruction(Constants.IFNULL, null);
+        InstructionBranch ifNull = InstructionFactory.createBranchInstruction(Constants.IFNULL, null);
         il.append(ifNull);
         il.append(InstructionFactory.PUSH(classGen.getConstantPool(), true));
         il.append(InstructionFactory.createReturn(Type.INT));
@@ -350,28 +350,28 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger {
         ifNonNull.setTarget(end);
     }
 
-    private void generatePerObjectGetSetMethods(LazyClassGen classGen) {
-        InstructionFactory factory = classGen.getFactory();
-
-        LazyMethodGen methodGet = makeMethodGen(classGen, AjcMemberMaker.perObjectInterfaceGet(aspectType));
-        flagAsSynthetic(methodGet, true);
-        classGen.addMethodGen(methodGet);
-        InstructionList ilGet = methodGet.getBody();
-        ilGet = new InstructionList();
-        ilGet.append(InstructionConstants.ALOAD_0);
-        ilGet.append(Utility.createGet(factory, AjcMemberMaker.perObjectField(aspectType, aspectType)));
-        ilGet.append(InstructionFactory.createReturn(Type.OBJECT));
-
-        LazyMethodGen methodSet = makeMethodGen(classGen, AjcMemberMaker.perObjectInterfaceSet(aspectType));
-        flagAsSynthetic(methodSet, true);
-        classGen.addMethodGen(methodSet);
-        InstructionList ilSet = methodSet.getBody();
-        ilSet = new InstructionList();
-        ilSet.append(InstructionConstants.ALOAD_0);
-        ilSet.append(InstructionConstants.ALOAD_1);
-        ilSet.append(Utility.createSet(factory, AjcMemberMaker.perObjectField(aspectType, aspectType)));
-        ilSet.append(InstructionFactory.createReturn(Type.VOID));
-    }
+//    private void generatePerObjectGetSetMethods(LazyClassGen classGen) {
+//        InstructionFactory factory = classGen.getFactory();
+//
+//        LazyMethodGen methodGet = makeMethodGen(classGen, AjcMemberMaker.perObjectInterfaceGet(aspectType));
+//        flagAsSynthetic(methodGet, true);
+//        classGen.addMethodGen(methodGet);
+//        InstructionList ilGet = methodGet.getBody();
+//        ilGet = new InstructionList();
+//        ilGet.append(InstructionConstants.ALOAD_0);
+//        ilGet.append(Utility.createGet(factory, AjcMemberMaker.perObjectField(aspectType, aspectType)));
+//        ilGet.append(InstructionFactory.createReturn(Type.OBJECT));
+//
+//        LazyMethodGen methodSet = makeMethodGen(classGen, AjcMemberMaker.perObjectInterfaceSet(aspectType));
+//        flagAsSynthetic(methodSet, true);
+//        classGen.addMethodGen(methodSet);
+//        InstructionList ilSet = methodSet.getBody();
+//        ilSet = new InstructionList();
+//        ilSet.append(InstructionConstants.ALOAD_0);
+//        ilSet.append(InstructionConstants.ALOAD_1);
+//        ilSet.append(Utility.createSet(factory, AjcMemberMaker.perObjectField(aspectType, aspectType)));
+//        ilSet.append(InstructionFactory.createReturn(Type.VOID));
+//    }
 
     private void generatePerCflowAspectOfMethod(LazyClassGen classGen) {
         InstructionFactory factory = classGen.getFactory();
index af0ee8d5b1ddc67bbf439c5bf2f9f4217f150ab1..a26d46f0af4df5be2a901b640649d1f4bdfb4e6d 100644 (file)
@@ -192,7 +192,6 @@ public final class BcelRenderer implements ITestVisitor, IExprVisitor {
         Member getClass = MemberImpl.method(UnresolvedType.OBJECT, 0, UnresolvedType.JAVA_LANG_CLASS,"getClass", UnresolvedType.NONE);
         il.append(Utility.createInvoke(fact, world, getClass));
         // aload annotationClass
-        String s = hasAnnotation.getAnnotationType().getName();
         il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getName())));
 //        int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature());
 //        il.append(new LDC_W(annClassIndex));
index f17de707b0d21c8e579591a5c7446152c49ae9db..5052952a7b443d5e21b27a2517e6a6c6dc047ec4 100644 (file)
@@ -68,7 +68,6 @@ import org.aspectj.weaver.patterns.AndPointcut;
 import org.aspectj.weaver.patterns.IdentityPointcutVisitor;
 import org.aspectj.weaver.patterns.NotPointcut;
 import org.aspectj.weaver.patterns.OrPointcut;
-import org.aspectj.weaver.patterns.Pointcut;
 import org.aspectj.weaver.patterns.ThisOrTargetPointcut;
 
 
@@ -402,7 +401,7 @@ public class BcelShadow extends Shadow {
                          }
                          if (getKind() == ConstructorCall) {
                                if (!world.isJoinpointArrayConstructionEnabled() || !this.getSignature().getDeclaringType().isArray()) {
-                                       range.insert((Instruction) InstructionFactory.createDup(1), Range.InsideBefore);
+                                       range.insert(InstructionFactory.createDup(1), Range.InsideBefore);
                                        range.insert(
                                                fact.createNew(
                                                        (ObjectType) BcelWorld.makeBcelType(
@@ -1343,7 +1342,7 @@ public class BcelShadow extends Shadow {
         final InstructionList il = new InstructionList();
         int alen = getArgCount() ;
         il.append(Utility.createConstant(fact, alen));
-        il.append((Instruction)fact.createNewArray(Type.OBJECT, (short)1));
+        il.append(fact.createNewArray(Type.OBJECT, (short)1));
         arrayVar.appendStore(il, fact);
 
         int stateIndex = 0;     
@@ -2131,8 +2130,7 @@ public class BcelShadow extends Shadow {
        
                                    int alen = cflowStateVars.length;
                                    entrySuccessInstructions.append(Utility.createConstant(fact, alen));
-                                   entrySuccessInstructions.append(
-                                               (Instruction) fact.createNewArray(Type.OBJECT, (short) 1));
+                                   entrySuccessInstructions.append(fact.createNewArray(Type.OBJECT, (short) 1));
                                    arrayVar.appendStore(entrySuccessInstructions, fact);
                 
                                    for (int i = 0; i < alen; i++) {
@@ -2612,39 +2610,39 @@ public class BcelShadow extends Shadow {
                return ret;
        }
        
-    private static boolean bindsThisOrTarget(Pointcut pointcut) {
-        ThisTargetFinder visitor = new ThisTargetFinder();
-        pointcut.accept(visitor, null);
-        return visitor.bindsThisOrTarget;
-    }
+//    private static boolean bindsThisOrTarget(Pointcut pointcut) {
+//        ThisTargetFinder visitor = new ThisTargetFinder();
+//        pointcut.accept(visitor, null);
+//        return visitor.bindsThisOrTarget;
+//    }
     
-    private static class ThisTargetFinder extends IdentityPointcutVisitor {
-        boolean bindsThisOrTarget = false;
-
-        public Object visit(ThisOrTargetPointcut node, Object data) {
-               if (node.isBinding()) {
-                bindsThisOrTarget = true;
-            }
-            return node;
-        }
-
-        public Object visit(AndPointcut node, Object data) {
-            if (!bindsThisOrTarget) node.getLeft().accept(this, data);
-            if (!bindsThisOrTarget) node.getRight().accept(this, data);
-            return node;
-        }
-
-        public Object visit(NotPointcut node, Object data) {
-            if (!bindsThisOrTarget) node.getNegatedPointcut().accept(this, data);
-            return node;
-        }
-
-        public Object visit(OrPointcut node, Object data) {
-            if (!bindsThisOrTarget) node.getLeft().accept(this, data);
-            if (!bindsThisOrTarget) node.getRight().accept(this, data);
-            return node;
-        }
-    }
+//    private static class ThisTargetFinder extends IdentityPointcutVisitor {
+//        boolean bindsThisOrTarget = false;
+//
+//        public Object visit(ThisOrTargetPointcut node, Object data) {
+//             if (node.isBinding()) {
+//                bindsThisOrTarget = true;
+//            }
+//            return node;
+//        }
+//
+//        public Object visit(AndPointcut node, Object data) {
+//            if (!bindsThisOrTarget) node.getLeft().accept(this, data);
+//            if (!bindsThisOrTarget) node.getRight().accept(this, data);
+//            return node;
+//        }
+//
+//        public Object visit(NotPointcut node, Object data) {
+//            if (!bindsThisOrTarget) node.getNegatedPointcut().accept(this, data);
+//            return node;
+//        }
+//
+//        public Object visit(OrPointcut node, Object data) {
+//            if (!bindsThisOrTarget) node.getLeft().accept(this, data);
+//            if (!bindsThisOrTarget) node.getRight().accept(this, data);
+//            return node;
+//        }
+//    }
 
     /**
      * ATAJ Handle the inlining for @AJ aspects
@@ -3147,7 +3145,7 @@ public class BcelShadow extends Shadow {
                                ((targetVar != null && targetVar != thisVar) ? 1 : 0) + 
                                (thisJoinPointVar == null ? 0 : 1);
         il.append(Utility.createConstant(fact, alen));
-        il.append((Instruction)fact.createNewArray(Type.OBJECT, (short)1));
+        il.append(fact.createNewArray(Type.OBJECT, (short)1));
         arrayVar.appendStore(il, fact);
 
         int stateIndex = 0;     
@@ -3188,7 +3186,7 @@ public class BcelShadow extends Shadow {
 
         IntMap ret = new IntMap();
         for(int i = 0, len = adviceArgs.length; i < len; i++) {
-            BcelVar v = (BcelVar) adviceArgs[i];
+            BcelVar v = adviceArgs[i];
             if (v == null) continue; // XXX we don't know why this is required
             int pos = v.getPositionInAroundState();
             if (pos >= 0) {  // need this test to avoid args bound via cflow
@@ -3344,7 +3342,7 @@ public class BcelShadow extends Shadow {
                
         body.append(Utility.createConstant(fact, len));
 
-        body.append((Instruction)fact.createNewArray(Type.OBJECT, (short)1));
+        body.append(fact.createNewArray(Type.OBJECT, (short)1));
         arrayVar.appendStore(body, fact);
 
         for (int i = len - 1; i >= 0; i++) {
index ee5d41fad4aef72f77c3a8dee22e120624c3469b..99d0acd35cc3463a59a2b0e4ce56bb29c5e3a4b2 100644 (file)
@@ -150,7 +150,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                     
                        }
             } else if (munger.getKind().equals(ResolvedTypeMunger.FieldHost)) {
-                ;//hidden
+                //hidden
             } else {
                        ResolvedMember declaredSig = munger.getSignature();
 //                     if (declaredSig==null) declaredSig= munger.getSignature();
@@ -1041,7 +1041,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                // Algorithm:  Step1. Check in this type - has someone already created the bridge method?
                //             Step2. Look above us - do we 'override' a method and yet differ in return type (i.e. covariance)
                //             Step3. Create a forwarding bridge method
-               ResolvedType superclass = onType.getSuperclass();
+//             ResolvedType superclass = onType.getSuperclass();
                boolean quitRightNow = false;
                
                String localMethodName    = unMangledInterMethod.getName();
@@ -1093,7 +1093,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                
                LazyMethodGen bridgeMethod = makeMethodGen(clazz,theBridgeMethod); // The bridge method in this type will have the same signature as the one in the supertype
                bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040 /*BRIDGE    = 0x00000040*/ );
-               UnresolvedType[] newParams = munger.getSignature().getParameterTypes();
+//             UnresolvedType[] newParams = munger.getSignature().getParameterTypes();
                Type returnType   = BcelWorld.makeBcelType(theBridgeMethod.getReturnType());
                body = bridgeMethod.getBody();
                fact = clazz.getFactory();
@@ -1267,7 +1267,8 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
             // don't signal error as it could be a consequence of a wild type pattern
             return false;
         }
-        boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType);
+//        boolean shouldApply = 
+               munger.matches(weaver.getLazyClassGen().getType(), aspectType); // why do this?
         ResolvedMember host = AjcMemberMaker.itdAtDeclareParentsField(
                 weaver.getLazyClassGen().getType(),
                 munger.getSignature().getType(),
@@ -1677,7 +1678,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,munger.getSignature().getDeclaringType().resolve(getWorld()),false,munger.getTypeVariableAliases());
                                boolean needsbridging = false;
                                if (!toBridgeTo.getReturnType().getErasureSignature().equals(munger.getSignature().getReturnType().getErasureSignature())) needsbridging = true;
-                               if (toBridgeTo!=null && needsbridging) {
+                               if (needsbridging) {
                                  ResolvedMember bridgingGetter = AjcMemberMaker.interFieldInterfaceGetter(toBridgeTo, gen.getType(), aspectType);                                
                                  createBridgeMethodForITDF(weaver,gen,itdfieldGetter,bridgingGetter);
                          }
@@ -1708,8 +1709,10 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                        if (munger.getDeclaredSignature()!=null) {
                          ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,munger.getSignature().getDeclaringType().resolve(getWorld()),false,munger.getTypeVariableAliases());
                          boolean needsbridging = false;
-                         if (!toBridgeTo.getReturnType().getErasureSignature().equals(munger.getSignature().getReturnType().getErasureSignature())) needsbridging = true;
-                         if (toBridgeTo!=null && needsbridging) {
+                         if (!toBridgeTo.getReturnType().getErasureSignature().equals(munger.getSignature().getReturnType().getErasureSignature())) {
+                                 needsbridging = true;
+                         }
+                         if (needsbridging) {
                                ResolvedMember bridgingSetter = AjcMemberMaker.interFieldInterfaceSetter(toBridgeTo, gen.getType(), aspectType);
                                createBridgeMethodForITDF(weaver, gen, itdfieldSetter, bridgingSetter);
                          }
index 07883c96e98904a9273f421ebec46674952fd35d..f253a390059fdc131d4f1673068d8dd84c14bf62 100644 (file)
@@ -1091,7 +1091,8 @@ public class BcelWeaver {
         if (input.isApplyAtAspectJMungersOnly()) {
             ContextToken atAspectJMungersOnly = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_ATASPECTJTYPE_MUNGERS_ONLY, "");
             requestor.weavingAspects();
-            ContextToken aspectToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_ASPECTS, "");
+//            ContextToken aspectToken = 
+               CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_ASPECTS, "");
             for (Iterator i = input.getClassFileIterator(); i.hasNext(); ) {
                 UnwovenClassFile classFile = (UnwovenClassFile)i.next();
                 String className = classFile.getClassName();
@@ -1255,7 +1256,7 @@ public class BcelWeaver {
                        
                        public int hashCode() {
                                return 37 + 17*lineNo + 17*inAspect.hashCode();
-                       };
+                       }
                }
                
                // FIXME asc Should be factored out into Xlint code and done automatically for all xlint messages, ideally.
index bb4cc7b32c6f01ea958b2593461bcbbb0f3229b2..421c3e70020413386c20bb02f826e2ff1cd94006 100644 (file)
@@ -155,10 +155,6 @@ public class BcelWorld extends World implements Repository {
                delegate = getClassLoaderRepositoryFor(loaderRef);
        }
     }
-    
-    private ClassLoader getClassLoader() {
-        return loaderRef.getClassLoader();
-    } 
 
     public Repository getClassLoaderRepositoryFor(ClassLoaderReference loader) {
         if (bcelRepositoryCaching) {
@@ -246,55 +242,15 @@ public class BcelWorld extends World implements Repository {
 
        protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty) {
         String name = ty.getName();
-        JavaClass jc = null;
-           ensureAdvancedConfigurationProcessed();
-        //UnwovenClassFile classFile = (UnwovenClassFile)sourceJavaClasses.get(name);
-        //if (classFile != null) jc = classFile.getJavaClass();
-//        if (isFastDelegateSupportEnabled() && classPath!=null && !ty.needsModifiableDelegate() && isNotOnPackageRestrictedList(name)) {
-//             ClassPathManager.ClassFile cf = classPath.find(ty);
-//             if (cf==null) {
-//                     return null;
-//             } else {
-//                     ReferenceTypeDelegate delegate =  buildAsmDelegate(ty,cf);
-//                     if (fallbackToLoadingBcelDelegatesForAspects && delegate.isAspect()) {
-//                             // bugger - pr135001 - we can't inline around advice from an aspect because we don't load the instructions.
-//                             // fixing this quick to get AJDT upgraded with a good 1.5.2dev build.
-//                             // other fixes would be:
-//                             // 1. record that we are loading the superclass for an aspect, so we know to make it a BCEL delegate
-//                             //
-//                             // the 'fix' here is only reasonable because there are many less aspects than classes!
-//                             
-//                             // Create a BCEL delegate
-//                             if (jc == null) jc = lookupJavaClass(classPath, name);
-//                     if (jc == null) return delegate; // worrying situation ?!?
-//                     else            return buildBcelDelegate(ty, jc, false);
-//                     } else {
-//                             return delegate;
-//                     }
-//             }
-//        } else {
-               if (jc == null) {
-                       jc = lookupJavaClass(classPath, name);
-               }       
-               if (jc == null) {
-                       return null;
-               } else {
-                       return buildBcelDelegate(ty, jc, false);
-               }
-//         }
+           ensureAdvancedConfigurationProcessed();
+           JavaClass jc = lookupJavaClass(classPath, name);
+        if (jc == null) {
+               return null;
+        } else {
+               return buildBcelDelegate(ty, jc, false);
+        }
        }
        
-//    private ReferenceTypeDelegate buildAsmDelegate(ReferenceType type,ClassPathManager.ClassFile t) {
-//     AsmDelegate asmDelegate;
-//             try {
-//                     asmDelegate = new AsmDelegate(type,t.getInputStream());
-//             } catch (IOException e) {
-//                     e.printStackTrace();
-//                     return null;
-//             }
-//             return asmDelegate;
-//     }
-    
        public BcelObjectType buildBcelDelegate(ReferenceType resolvedTypeX, JavaClass jc, boolean exposedToWeaver) {
                BcelObjectType ret = new BcelObjectType(resolvedTypeX, jc, exposedToWeaver);
                return ret;
@@ -501,8 +457,6 @@ public class BcelWorld extends World implements Repository {
             UnresolvedType.forName(javaClass.getClassName()), mods, method.getName(), method.getSignature()); 
     }
     
-    private static final String[] ZERO_STRINGS = new String[0];
-    
        public String toString() {
                StringBuffer buf = new StringBuffer();
                buf.append("BcelWorld(");
index 5f06c0e6f17a4477f86d49a486b928b19f6feb68..6b163ab38e54e8f7140149fc413f3f6aae8f8b6b 100644 (file)
@@ -66,7 +66,7 @@ public class ClassPathManager {
                if (trace.isTraceEnabled()) trace.exit("<init>");
        }
 
-       protected ClassPathManager() {};
+       protected ClassPathManager() {}
        
        public void addPath (String name, IMessageHandler handler) {
                File f = new File(name);
index f1fda4c011ff24cdc5eefe62ef290b647d4b6474..e1125edc70e793824acbfa236db9d5797246c3ce 100644 (file)
@@ -24,7 +24,7 @@ class IfFinder extends IdentityPointcutVisitor {
     boolean hasIf = false;
     public Object visit(IfPointcut node, Object data) {
         if (node.alwaysFalse() || node.alwaysTrue()) {
-            ;//IfFalse / IfTrue
+            //IfFalse / IfTrue
         } else {
             hasIf = true;
         }
index eecb402220a80f0dd29e2d3e0ec7347c883c176b..ce789252beeb1c8bd44e045f3d0fb8f87e06e324 100644 (file)
@@ -38,7 +38,6 @@ import org.aspectj.apache.bcel.classfile.JavaClass;
 import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.apache.bcel.classfile.Signature;
 import org.aspectj.apache.bcel.classfile.Synthetic;
-import org.aspectj.apache.bcel.classfile.Unknown;
 import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
 import org.aspectj.apache.bcel.generic.BasicType;
 import org.aspectj.apache.bcel.generic.ClassGen;
@@ -149,15 +148,15 @@ public final class LazyClassGen {
                return ((InlinedSourceFileInfo) inlinedFiles.get(fullpath)).offset;
        }
        
-       private Unknown getSourceDebugExtensionAttribute() {
-               int nameIndex = cp.addUtf8("SourceDebugExtension");
-               String data = getSourceDebugExtensionString();
-               //System.err.println(data);
-               byte[] bytes = Utility.stringToUTF(data);
-               int length = bytes.length;
-
-               return new Unknown(nameIndex, length, bytes, cp);               
-       }       
+//     private Unknown getSourceDebugExtensionAttribute() {
+//             int nameIndex = cp.addUtf8("SourceDebugExtension");
+//             String data = getSourceDebugExtensionString();
+//             //System.err.println(data);
+//             byte[] bytes = Utility.stringToUTF(data);
+//             int length = bytes.length;
+//
+//             return new Unknown(nameIndex, length, bytes, cp);               
+//     }       
 
 //     private LazyClassGen() {}
 //     public static void main(String[] args) {
@@ -171,51 +170,51 @@ public final class LazyClassGen {
 //     }
        
        // For the entire pathname, we're using package names.  This is probably wrong.
-       private String getSourceDebugExtensionString() {
-               StringBuffer out = new StringBuffer();
-               String myFileName = getFileName();
-               // header section
-               out.append("SMAP\n");
-               out.append(myFileName);
-               out.append("\nAspectJ\n");
-               // stratum section
-               out.append("*S AspectJ\n");
-               // file section
-               out.append("*F\n");
-               out.append("1 ");
-               out.append(myFileName);
-               out.append("\n");
-               int i = 2;
-               for (Iterator iter = inlinedFiles.keySet().iterator(); iter.hasNext();) {
-                       String element = (String) iter.next(); 
-                       int ii = element.lastIndexOf('/');
-                       if (ii == -1) {
-                               out.append(i++); out.append(' '); 
-                               out.append(element); out.append('\n');                          
-                       } else {
-                               out.append("+ "); out.append(i++); out.append(' '); 
-                               out.append(element.substring(ii+1)); out.append('\n');
-                               out.append(element); out.append('\n');                                                  
-                       }
-               }
-               // emit line section
-               out.append("*L\n");
-               out.append("1#1,");
-               out.append(highestLineNumber);
-               out.append(":1,1\n");
-               i = 2;  
-               for (Iterator iter = inlinedFiles.values().iterator(); iter.hasNext();) {
-                       InlinedSourceFileInfo element = (InlinedSourceFileInfo) iter.next();
-                       out.append("1#"); 
-                       out.append(i++); out.append(',');
-                       out.append(element.highestLineNumber); out.append(":");
-                       out.append(element.offset + 1); out.append(",1\n");
-               }       
-               // end section
-               out.append("*E\n");
-               // and finish up...
-               return out.toString();
-       }
+//     private String getSourceDebugExtensionString() {
+//             StringBuffer out = new StringBuffer();
+//             String myFileName = getFileName();
+//             // header section
+//             out.append("SMAP\n");
+//             out.append(myFileName);
+//             out.append("\nAspectJ\n");
+//             // stratum section
+//             out.append("*S AspectJ\n");
+//             // file section
+//             out.append("*F\n");
+//             out.append("1 ");
+//             out.append(myFileName);
+//             out.append("\n");
+//             int i = 2;
+//             for (Iterator iter = inlinedFiles.keySet().iterator(); iter.hasNext();) {
+//                     String element = (String) iter.next(); 
+//                     int ii = element.lastIndexOf('/');
+//                     if (ii == -1) {
+//                             out.append(i++); out.append(' '); 
+//                             out.append(element); out.append('\n');                          
+//                     } else {
+//                             out.append("+ "); out.append(i++); out.append(' '); 
+//                             out.append(element.substring(ii+1)); out.append('\n');
+//                             out.append(element); out.append('\n');                                                  
+//                     }
+//             }
+//             // emit line section
+//             out.append("*L\n");
+//             out.append("1#1,");
+//             out.append(highestLineNumber);
+//             out.append(":1,1\n");
+//             i = 2;  
+//             for (Iterator iter = inlinedFiles.values().iterator(); iter.hasNext();) {
+//                     InlinedSourceFileInfo element = (InlinedSourceFileInfo) iter.next();
+//                     out.append("1#"); 
+//                     out.append(i++); out.append(',');
+//                     out.append(element.highestLineNumber); out.append(":");
+//                     out.append(element.offset + 1); out.append(",1\n");
+//             }       
+//             // end section
+//             out.append("*E\n");
+//             // and finish up...
+//             return out.toString();
+//     }
        
        // ---- end JSR45-related stuff
        
@@ -410,7 +409,7 @@ public final class LazyClassGen {
                if (isSerializable && !hasSerialVersionUIDField) {
                        getWorld().getLint().serialVersionUIDBroken.signal(
                                new String[] {
-                                       myType.getResolvedTypeX().getName().toString(),
+                                       myType.getResolvedTypeX().getName(),
                                        field.getName()
                                },
                                sourceLocation,
index b2faf5300757a9a16dfaa6aa9c7c730fcbf02180..715053f8478d6e2fd7f6e9f6f3406536f9988e2a 100644 (file)
@@ -1083,7 +1083,7 @@ public final class LazyMethodGen implements Traceable {
         // OPTIMIZE sort out in here: getRange()/insertHandler() and type of exceptionList
         while (iHandle != null) {
                Instruction inst = iHandle.getInstruction();
-               InstructionHandle nextInst = iHandle.getNext();
+//             InstructionHandle nextInst = iHandle.getNext();
                // OPTIMIZE remove this instructionhandle as it now points to nowhere?
                if (inst == Range.RANGEINSTRUCTION) {
                        Range r = Range.getRange(iHandle);
@@ -1199,7 +1199,7 @@ public final class LazyMethodGen implements Traceable {
             gen.addLocalVariable(
                        tag.getName(),
                        t,
-                tag.getSlot(),(InstructionHandle) start,(InstructionHandle) lvpos.end);
+                tag.getSlot(), start, lvpos.end);
         }
        }
 
@@ -1342,12 +1342,12 @@ public final class LazyMethodGen implements Traceable {
 //     }
 //     }
    
-   private static InstructionHandle fNext(InstructionHandle ih) {
-          while (true) {
-                  if (ih.getInstruction()==Range.RANGEINSTRUCTION) ih = ih.getNext();
-                  else return ih;
-          }
-   }
+//   private static InstructionHandle fNext(InstructionHandle ih) {
+//        while (true) {
+//                if (ih.getInstruction()==Range.RANGEINSTRUCTION) ih = ih.getNext();
+//                else return ih;
+//        }
+//   }
 
     private static InstructionHandle remap(InstructionHandle ih, Map map) {
         while (true) {
index 9a6d6ea42e6b575bee73db1a3955e65fdbc348b3..24a0350cfe1f6b5b671ae86cc9acc485b47a973a 100644 (file)
@@ -97,7 +97,6 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld {
         * @Override
         */
     protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty) {        
-        String name = ty.getName();
 
         // use reflection delegates for all bootstrap types
         ReferenceTypeDelegate bootstrapLoaderDelegate = resolveIfBootstrapDelegate(ty);
index 4b14b8e31e8eebf641125d7f5ea0d3b777858746..365a5154fa376ff13032c0600601bd6e54fea10b 100644 (file)
@@ -66,7 +66,6 @@ import org.aspectj.weaver.bcel.BcelTypeMunger;
 public class AnnotationPointcut extends NameBindingPointcut {
 
        private ExactAnnotationTypePattern annotationTypePattern;
-    private ShadowMunger munger = null; // only set after concretization
     private String declarationText; 
        
        public AnnotationPointcut(ExactAnnotationTypePattern type) {
@@ -78,7 +77,6 @@ public class AnnotationPointcut extends NameBindingPointcut {
 
        public AnnotationPointcut(ExactAnnotationTypePattern type, ShadowMunger munger) {
                this(type);
-               this.munger = munger;
                buildDeclarationText();
        }
 
index 65b3c8e4c0431614cd8ef40696d0fbd4ad522362..2d9cbc8e4d8b24bcd5cfadac862aade6b5a6d460 100644 (file)
@@ -173,6 +173,14 @@ public class ConcreteCflowPointcut extends Pointcut {
                                o.formalType.equals(this.formalType);
                }
                
+           public int hashCode() {
+               int result = 19;
+               result = 37*result + formalIndex;
+               result = 37*result + arrayIndex;
+               result = 37*result + formalType.hashCode();
+               return result;
+           }
+               
                public String toString() {
                        return "Slot(" + formalIndex + ", " + formalType + ", " + arrayIndex + ")";
                }
index 98ace325cee13893ca88ae32269277fde62d8609..93e40b4be1f47bc96dd2ee130ade26d6c5b177db 100644 (file)
@@ -133,7 +133,7 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern {
                                                                if (ms[i].isAbstract() && ms[i].getParameterTypes().length==0 && ms[i].getName().equals(k)) {
                                                                        // we might be onto something
                                                                        String s= ms[i].getAnnotationDefaultValue();
-                                                                       if (s!=null && s.equals(v)) foundMatch=true;;
+                                                                       if (s!=null && s.equals(v)) foundMatch=true;
                                                                }
                                                        }
                                                        if (!foundMatch)
@@ -168,7 +168,7 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern {
                                                                                if (ms[i].isAbstract() && ms[i].getParameterTypes().length==0 && ms[i].getName().equals(k)) {
                                                                                        // we might be onto something
                                                                                        String s= ms[i].getAnnotationDefaultValue();
-                                                                                       if (s!=null && s.equals(v)) foundMatch=true;;
+                                                                                       if (s!=null && s.equals(v)) foundMatch=true;
                                                                                }
                                                                        }
                                                                        if (!foundMatch)
index 0e61b5edaa5bac8b28d378f24b3c1e5f0223e1a7..328cc4044f34da8b8f9bd0cf134dc7df46a8aba0 100644 (file)
@@ -357,7 +357,7 @@ public class IfPointcut extends Pointcut {
                         || AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argSignature)
                         || AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argSignature)
                         || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argSignature)) {
-                        ;
+                        
                     } else {
                         ret.baseArgsCount++;
                     }
index a1acb39f8ac823e79955fac51b29067aae5b77f5..a1110eb9f4fb99848fa36b485d5160fab26dba6f 100644 (file)
@@ -498,7 +498,7 @@ public class PatternParser {
        }
 
        private Pointcut parseWithinAnnotationPointcut() {
-               String kind = parseIdentifier();
+               /* String kind = */parseIdentifier();
                eat("(");
                if (maybeEat(")")) {
                        throw new ParserException("expecting @AnnotationName or parameter, but found ')'", tokenSource.peek());
@@ -509,7 +509,7 @@ public class PatternParser {
        }
 
        private Pointcut parseWithinCodeAnnotationPointcut() {
-               String kind = parseIdentifier();
+               /*String kind = */parseIdentifier();
                eat("(");
                if (maybeEat(")")) {
                        throw new ParserException("expecting @AnnotationName or parameter, but found ')'", tokenSource.peek());
@@ -628,7 +628,7 @@ public class PatternParser {
        /** Covers the 'lock()' and 'unlock()' pointcuts */
        private KindedPointcut parseMonitorPointcut(String kind) {
                eat("(");
-               TypePattern type = TypePattern.ANY;
+//             TypePattern type = TypePattern.ANY;
                eat(")");
                
                if (kind.equals("lock")) {
@@ -1009,10 +1009,6 @@ public class PatternParser {
 //     }
        
 
-       private boolean isAnnotationPattern(PatternNode p) {
-               return (p instanceof AnnotationTypePattern);
-       }
-       
        public List parseDottedNamePattern() {
                List names = new ArrayList();
                StringBuffer buf = new StringBuffer();
@@ -1096,7 +1092,8 @@ public class PatternParser {
        public String parseAnnotationNameValuePattern() {
                StringBuffer buf = new StringBuffer();
                IToken tok;
-               int startPos = tokenSource.peek().getStart();
+//             int startPos = 
+                       tokenSource.peek().getStart();
                boolean dotOK = false;
                int depth = 0;
                while (true) {
@@ -1423,8 +1420,7 @@ public class PatternParser {
                TypePattern upperBound = null;
                TypePattern[] additionalInterfaceBounds = null;
                TypePattern lowerBound = null;
-               String typeVariableName = null;
-               if (typeVariableName == null) typeVariableName = parseIdentifier();
+               String typeVariableName = parseIdentifier();
                if (maybeEatIdentifier("extends")) {
                        upperBound = parseTypePattern();
                        additionalInterfaceBounds = maybeParseAdditionalInterfaceBounds();
index ee47eacc89616f5e9cb528a2febbbfe1f74f9857..ad9f003812c50708be4f57ecbf89a4701c92168a 100644 (file)
@@ -98,7 +98,7 @@ public class PerTypeWithin extends PerClause {
     }
     
     protected Test findResidueInternal(Shadow shadow, ExposedState state) {
-       Member ptwField = AjcMemberMaker.perTypeWithinField(shadow.getEnclosingType(),inAspect);
+//     Member ptwField = AjcMemberMaker.perTypeWithinField(shadow.getEnclosingType(),inAspect);
        
        Expr myInstance =
                Expr.makeCallExpr(AjcMemberMaker.perTypeWithinLocalAspectOf(shadow.getEnclosingType(),inAspect/*shadow.getEnclosingType()*/),
index 0b64ff33fa60b1388a9c05d2da72e47fb95f1f9d..7adce3928ed347b10034ebae871cc42740b47b19 100644 (file)
@@ -54,43 +54,43 @@ public class PointcutRewriter {
                return result;
        }
        
-       /**
-        * Checks pointcuts - used for debugging.
-        * - this variant checks if the context has been lost, since
-        *   that can indicate an NPE will happen later reporting a message (pr162657).
-        *   Not finished, but helped locate the problem ;)
-        */
-       private void checkPC(Pointcut pc) {
-               if (isNot(pc)) {
-                       NotPointcut npc = (NotPointcut)pc;
-                       checkPC(npc.getNegatedPointcut());
-                       if (npc.getSourceContext()==null) {
-                               System.out.println("Lost context for "+npc);
-                               throw new RuntimeException("Lost context");
-                       }
-               } else if (isOr(pc)) {
-                       OrPointcut opc = (OrPointcut)pc;
-                       checkPC(opc.getLeft());
-                       checkPC(opc.getRight());
-                       if (opc.getSourceContext()==null) {
-                               System.out.println("Lost context for "+opc);
-                               throw new RuntimeException("Lost context");
-                       }
-               } else if (isAnd(pc)) {
-                       AndPointcut apc = (AndPointcut)pc;
-                       checkPC(apc.getLeft());
-                       checkPC(apc.getRight());
-                       if (apc.getSourceContext()==null) {
-                               System.out.println("Lost context for "+apc);
-                               throw new RuntimeException("Lost context");
-                       }
-               } else {
-                       if (pc.getSourceContext()==null) {
-                               System.out.println("Lost context for "+pc);
-                               throw new RuntimeException("Lost context");             
-                       }
-               }
-       }
+//     /**
+//      * Checks pointcuts - used for debugging.
+//      * - this variant checks if the context has been lost, since
+//      *   that can indicate an NPE will happen later reporting a message (pr162657).
+//      *   Not finished, but helped locate the problem ;)
+//      */
+//     private void checkPC(Pointcut pc) {
+//             if (isNot(pc)) {
+//                     NotPointcut npc = (NotPointcut)pc;
+//                     checkPC(npc.getNegatedPointcut());
+//                     if (npc.getSourceContext()==null) {
+//                             System.out.println("Lost context for "+npc);
+//                             throw new RuntimeException("Lost context");
+//                     }
+//             } else if (isOr(pc)) {
+//                     OrPointcut opc = (OrPointcut)pc;
+//                     checkPC(opc.getLeft());
+//                     checkPC(opc.getRight());
+//                     if (opc.getSourceContext()==null) {
+//                             System.out.println("Lost context for "+opc);
+//                             throw new RuntimeException("Lost context");
+//                     }
+//             } else if (isAnd(pc)) {
+//                     AndPointcut apc = (AndPointcut)pc;
+//                     checkPC(apc.getLeft());
+//                     checkPC(apc.getRight());
+//                     if (apc.getSourceContext()==null) {
+//                             System.out.println("Lost context for "+apc);
+//                             throw new RuntimeException("Lost context");
+//                     }
+//             } else {
+//                     if (pc.getSourceContext()==null) {
+//                             System.out.println("Lost context for "+pc);
+//                             throw new RuntimeException("Lost context");             
+//                     }
+//             }
+//     }
                                
        public Pointcut rewrite(Pointcut pc) {
                return rewrite(pc,false);
@@ -289,18 +289,18 @@ public class PointcutRewriter {
 //             }
 //     }
        
-       private SignaturePattern removeDeclaringTypePattern(SignaturePattern sp) {
-               return new SignaturePattern(
-                 sp.getKind(),
-                 sp.getModifiers(),
-                 sp.getReturnType(),
-                 TypePattern.ANY,
-                 sp.getName(),
-                 sp.getParameterTypes(),
-                 sp.getThrowsPattern(),
-                 sp.getAnnotationPattern()
-               );
-       }
+//     private SignaturePattern removeDeclaringTypePattern(SignaturePattern sp) {
+//             return new SignaturePattern(
+//               sp.getKind(),
+//               sp.getModifiers(),
+//               sp.getReturnType(),
+//               TypePattern.ANY,
+//               sp.getName(),
+//               sp.getParameterTypes(),
+//               sp.getThrowsPattern(),
+//               sp.getAnnotationPattern()
+//             );
+//     }
 
        // this finds the root of each && tree and then aggregates all of the branches
        // into a sorted set:
@@ -437,22 +437,4 @@ public class PointcutRewriter {
                return (pc instanceof OrPointcut);
        }
        
-       private boolean isExecution(Pointcut pc) {
-               if (pc instanceof KindedPointcut) {
-                       KindedPointcut kp = (KindedPointcut) pc;
-                       if (kp.kind == Shadow.MethodExecution) return true;
-                       if (kp.kind == Shadow.ConstructorExecution) return true;
-               }
-               return false;
-       }
-       
-       private boolean isWithinCode(Pointcut pc) {
-               return (pc instanceof WithincodePointcut); 
-       }
-       
-       private boolean isAnyType(TypePattern tp) {
-               if (tp == TypePattern.ANY) return true;
-               if (tp.toString().equals("*")) return true;
-               return false;
-       }
 }
\ No newline at end of file
index e77a9f61d9c1c943c77a7590f89bec51fe2451c4..6ac7d0f970681176851aa5ce48058e1919c52cb8 100644 (file)
@@ -323,7 +323,7 @@ public class ReferencePointcut extends Pointcut {
                        }
                                        
                        //System.err.println("start: " + searchStart);
-                       ResolvedType[] parameterTypes = searchStart.getWorld().resolve(pointcutDec.getParameterTypes());
+//                     ResolvedType[] parameterTypes = searchStart.getWorld().resolve(pointcutDec.getParameterTypes());
                        
                        TypePatternList arguments = this.arguments.resolveReferences(bindings);
                        
index 831457cb25ecf2a28aef8e2b0d2e7d1f7ae92154..0643b480ced9ff66beb87364e684501692f3de86 100644 (file)
@@ -15,7 +15,6 @@ package org.aspectj.weaver.patterns;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -25,15 +24,11 @@ import java.util.Map;
 import java.util.Set;
 
 import org.aspectj.bridge.ISourceLocation;
-import org.aspectj.lang.Signature;
-import org.aspectj.lang.reflect.FieldSignature;
-import org.aspectj.lang.reflect.MethodSignature;
 import org.aspectj.util.FuzzyBoolean;
-import org.aspectj.weaver.AjAttribute;
+import org.aspectj.weaver.AjAttribute; 
 import org.aspectj.weaver.AjcMemberMaker;
 import org.aspectj.weaver.AnnotationTargetKind;
 import org.aspectj.weaver.ConcreteTypeMunger;
-import org.aspectj.weaver.Constants;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.JoinPointSignature;
 import org.aspectj.weaver.Member;
@@ -497,7 +492,7 @@ public class SignaturePattern extends PatternNode {
          // relevant member in the original aspect
          if (member.isAnnotatedElsewhere() && member.getKind()==Member.FIELD) {
            // FIXME asc duplicate of code in AnnotationPointcut.matchInternal()?  same fixmes apply here.
-           ResolvedMember [] mems = member.getDeclaringType().resolve(world).getDeclaredFields(); // FIXME asc should include supers with getInterTypeMungersIncludingSupers?
+//         ResolvedMember [] mems = member.getDeclaringType().resolve(world).getDeclaredFields(); // FIXME asc should include supers with getInterTypeMungersIncludingSupers?
            List mungers = member.getDeclaringType().resolve(world).getInterTypeMungers(); 
                for (Iterator iter = mungers.iterator(); iter.hasNext();) {
                ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) iter.next();
@@ -564,35 +559,35 @@ public class SignaturePattern extends PatternNode {
                return false;
        }
        
-       private Collection getDeclaringTypes(Signature sig) {
-               List l = new ArrayList();
-               Class onType = sig.getDeclaringType();
-               String memberName = sig.getName();
-               if (sig instanceof FieldSignature) {
-                       Class fieldType = ((FieldSignature)sig).getFieldType();
-                       Class superType = onType;
-                       while(superType != null) {
-                               try {
-                                       Field f =  (superType.getDeclaredField(memberName));
-                                       if (f.getType() == fieldType) {
-                                               l.add(superType);
-                                       }
-                               } catch (NoSuchFieldException nsf) {}
-                               superType = superType.getSuperclass();
-                       }
-               } else if (sig instanceof MethodSignature) {
-                       Class[] paramTypes = ((MethodSignature)sig).getParameterTypes();
-                       Class superType = onType;
-                       while(superType != null) {
-                               try {
-                                       superType.getDeclaredMethod(memberName,paramTypes);
-                                       l.add(superType);
-                               } catch (NoSuchMethodException nsm) {}
-                               superType = superType.getSuperclass();
-                       }
-               }
-               return l;
-       }
+//     private Collection getDeclaringTypes(Signature sig) {
+//             List l = new ArrayList();
+//             Class onType = sig.getDeclaringType();
+//             String memberName = sig.getName();
+//             if (sig instanceof FieldSignature) {
+//                     Class fieldType = ((FieldSignature)sig).getFieldType();
+//                     Class superType = onType;
+//                     while(superType != null) {
+//                             try {
+//                                     Field f =  (superType.getDeclaredField(memberName));
+//                                     if (f.getType() == fieldType) {
+//                                             l.add(superType);
+//                                     }
+//                             } catch (NoSuchFieldException nsf) {}
+//                             superType = superType.getSuperclass();
+//                     }
+//             } else if (sig instanceof MethodSignature) {
+//                     Class[] paramTypes = ((MethodSignature)sig).getParameterTypes();
+//                     Class superType = onType;
+//                     while(superType != null) {
+//                             try {
+//                                     superType.getDeclaredMethod(memberName,paramTypes);
+//                                     l.add(superType);
+//                             } catch (NoSuchMethodException nsm) {}
+//                             superType = superType.getSuperclass();
+//                     }
+//             }
+//             return l;
+//     }
        
     public NamePattern getName() { return name; }
     public TypePattern getDeclaringType() { return declaringType; }
@@ -735,14 +730,14 @@ public class SignaturePattern extends PatternNode {
         * return true if last argument in params is an Object[] but the modifiers say this method
         * was declared with varargs (Object...).  We shouldn't be matching if this is the case.
         */
-       private boolean matchedArrayAgainstVarArgs(TypePatternList params,int modifiers) {
-               if (params.size()>0 && (modifiers & Constants.ACC_VARARGS)!=0) {
-                       // we have at least one parameter in the pattern list, and the method has a varargs signature
-                       TypePattern lastPattern = params.get(params.size()-1);
-                       if (lastPattern.isArray() && !lastPattern.isVarArgs) return true;
-               }
-           return false;
-       }
+//     private boolean matchedArrayAgainstVarArgs(TypePatternList params,int modifiers) {
+//             if (params.size()>0 && (modifiers & Constants.ACC_VARARGS)!=0) {
+//                     // we have at least one parameter in the pattern list, and the method has a varargs signature
+//                     TypePattern lastPattern = params.get(params.size()-1);
+//                     if (lastPattern.isArray() && !lastPattern.isVarArgs) return true;
+//             }
+//         return false;
+//     }
        
        public AnnotationTypePattern getAnnotationPattern() {
                return annotationPattern;
index 167ea886e3ceaba1e80594c11fc8810fb5cfe99b..350a192543638fde95d68446426049fe887026d5 100644 (file)
@@ -43,7 +43,6 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
        private boolean isThis;
        private boolean alreadyWarnedAboutDEoW = false;
        private ExactAnnotationTypePattern annotationTypePattern;
-       private ShadowMunger munger;
        private String declarationText;
        
        private static final int thisKindSet;
@@ -74,7 +73,6 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
 
        public ThisOrTargetAnnotationPointcut(boolean isThis, ExactAnnotationTypePattern type, ShadowMunger munger) {
            this(isThis,type);
-           this.munger = munger;
        }
 
     public ExactAnnotationTypePattern getAnnotationTypePattern() {
index 1336ea863efb66df0db818253831bb4144be0e4e..ed4f1ddf039b6066c876482570738f031ca9a9c3 100644 (file)
@@ -124,7 +124,7 @@ public abstract class TypePattern extends PatternNode {
        public abstract FuzzyBoolean matchesInstanceof(ResolvedType type);      
        
        public final FuzzyBoolean matches(ResolvedType type, MatchKind kind) {
-               FuzzyBoolean typeMatch = null;
+//             FuzzyBoolean typeMatch = null;
                //??? This is part of gracefully handling missing references
                if (type.isMissing()) return FuzzyBoolean.NO;
                
index 0cbebf199bbbd0b97d75ed5c1b99e1373e24070a..7016b23fd9c7fdc740d75cdccadfe8fdfd2d93ef 100644 (file)
@@ -15,7 +15,6 @@ import java.io.DataOutputStream;
 import java.io.IOException;
 
 import org.aspectj.weaver.ISourceContext;
-import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
 
index edda22658f26c396d38b785b109298f7f1444bd7..ba9ce8b26680155134b3a604208054090413878f 100644 (file)
@@ -42,7 +42,6 @@ import org.aspectj.weaver.ast.Var;
 public class WithinAnnotationPointcut extends NameBindingPointcut {
 
        private AnnotationTypePattern annotationTypePattern;
-       private ShadowMunger munger;
        private String declarationText;
        
        /**
@@ -57,8 +56,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
        
        public WithinAnnotationPointcut(AnnotationTypePattern type, ShadowMunger munger) {
            this(type);
-           this.munger = munger;
-               this.pointcutKind = ATWITHIN;
+           this.pointcutKind = ATWITHIN;
        }
 
     public AnnotationTypePattern getAnnotationTypePattern() {
@@ -112,7 +110,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
                                        getSourceLocation()));
                        return;
                }
-               annotationTypePattern = (ExactAnnotationTypePattern) annotationTypePattern.resolveBindings(scope,bindings,true);
+               annotationTypePattern = annotationTypePattern.resolveBindings(scope,bindings,true);
                // must be either a Var, or an annotation type pattern
        }
 
@@ -176,7 +174,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
 
        public static Pointcut read(VersionedDataInputStream s, ISourceContext context) throws IOException {
                AnnotationTypePattern type = AnnotationTypePattern.read(s, context);
-               WithinAnnotationPointcut ret = new WithinAnnotationPointcut((ExactAnnotationTypePattern)type);
+               WithinAnnotationPointcut ret = new WithinAnnotationPointcut(type);
                ret.readLocation(context, s);
                return ret;
        }
index 74cb2a6203f1e0d43ff34c4aa1830d1ce7c1bcac..ed3e5f1451dd3625eb84130c4e3c7c6df59dd4dc 100644 (file)
@@ -18,7 +18,6 @@ import java.util.Map;
 
 import org.aspectj.bridge.MessageUtil;
 import org.aspectj.util.FuzzyBoolean;
-import org.aspectj.weaver.AnnotatedElement;
 import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
@@ -45,7 +44,6 @@ import org.aspectj.weaver.ast.Var;
 public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
 
        private ExactAnnotationTypePattern annotationTypePattern;
-    private ShadowMunger munger = null; // only set after concretization
     private String declarationText;
     
     private static final int matchedShadowKinds;
@@ -67,7 +65,6 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
 
        public WithinCodeAnnotationPointcut(ExactAnnotationTypePattern type, ShadowMunger munger) {
                this(type);
-               this.munger = munger;
                this.pointcutKind = Pointcut.ATWITHINCODE;
        }
 
@@ -96,7 +93,6 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
         * @see org.aspectj.weaver.patterns.Pointcut#match(org.aspectj.weaver.Shadow)
         */
        protected FuzzyBoolean matchInternal(Shadow shadow) {
-               AnnotatedElement toMatchAgainst = null;
                Member member = shadow.getEnclosingCodeSignature();             
                ResolvedMember rMember = member.resolve(shadow.getIWorld());
 
index e27eb75c38c8155900a05cb5e784166dca97b1b9..423c8bd3ddbad5e7d8b36a309cc1aaa633021a0a 100644 (file)
@@ -653,7 +653,8 @@ public class WeavingAdaptor implements IMessageContext {
                }
 
                public boolean handleMessage(IMessage message) throws AbortException {
-                       boolean result = super.handleMessage(message);
+//                     boolean result = 
+                               super.handleMessage(message);
                        if (abortOnError && 0 <= message.getKind().compareTo(failKind)) {
                                throw new AbortException(message);
                        }
index 1ff47c45a366daf1704e949ee858d0a7de39e40b..ac6a8cec3a2c08dd342a8e88acf05bc4428f3a04 100644 (file)
@@ -21,7 +21,8 @@ public class CommonsTraceTest extends AbstractTraceTest {
        }
        
        public void testCommonsTrace() {
-               CommonsTrace trace = new CommonsTrace(getClass());
+//             CommonsTrace trace = 
+                       new CommonsTrace(getClass());
        }
 
        public void testSetTraceEnabled() {
index fef476c49cd8791396ba75f28ca691cda45d2f6c..a8313c4fb64e7569810bdedb78a281921c38d076 100644 (file)
@@ -21,7 +21,8 @@ public class DefaultTraceTest extends AbstractTraceTest {
        }
 
        public void testDefaultTrace() {
-               DefaultTrace trace = new DefaultTrace(getClass());
+//             DefaultTrace trace = 
+                       new DefaultTrace(getClass());
        }
 
        public void testSetTraceEnabled() {
index 59fb884ca7f922e48de07adb61505464c22e6718..ea5dd9d671b312754095676131531a56bb0183bc 100644 (file)
@@ -33,7 +33,7 @@ public class WeaverMessagesTestCase extends TestCase {
                        if (f.getType() == String.class) {
                                try {
                                        String key = (String) f.get(null);
-                                       String value = WeaverMessages.format(key);
+//                                     String value = WeaverMessages.format(key);
                                        assertFalse("Each key should be unique",fieldList.contains(key));
                                        fieldList.add(key);
 //                                     System.out.println(key + "," + value);
index 28cf82f5a34c840a567402e221ab5bfd2b4abf57..168400e918552d4779bf823db9ff432d0f3c532d 100644 (file)
@@ -61,7 +61,8 @@ public class BcelGenericSignatureToTypeXTestCase extends TestCase {
                                cSig.formalTypeParameters,
                                world);
                assertEquals("Ljava/lang/Object;",resolved.getSignature());
-               UnresolvedType resolvedInt = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(
+//             UnresolvedType resolvedInt = 
+                       BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(
                                cSig.superInterfaceSignatures[0],
                                cSig.formalTypeParameters,
                                world);
index ce7666e84aa5cf5efe4644efbae01053b7352968..664b0c783ffc61f5254606acb3a07fa74a3d0f81 100644 (file)
@@ -77,19 +77,19 @@ public class ClassLoaderRepositoryTests extends TestCase {
                System.err.println(rep2.report());
     }
 
-        private void loadOnce() throws Exception {
-               ClassLoaderRepository rep = setupRepository();
-               while (entries.hasMoreElements()) {
-                       ZipEntry zfe = (ZipEntry) entries.nextElement();
-                       String classfileName = zfe.getName();
-                       if (classfileName.endsWith(".class")) {
-                               String clazzname = classfileName.substring(0,
-                                               classfileName.length() - 6).replace('/', '.');
-
-                               rep.loadClass(clazzname);
-                       }
-               }
-       }
+//      private void loadOnce() throws Exception {
+//             ClassLoaderRepository rep = setupRepository();
+//             while (entries.hasMoreElements()) {
+//                     ZipEntry zfe = (ZipEntry) entries.nextElement();
+//                     String classfileName = zfe.getName();
+//                     if (classfileName.endsWith(".class")) {
+//                             String clazzname = classfileName.substring(0,
+//                                             classfileName.length() - 6).replace('/', '.');
+//
+//                             rep.loadClass(clazzname);
+//                     }
+//             }
+//     }
 
         public void testMultiThreaded() throws Throwable {              
                 ClassLoaderRepository.useSharedCache=true;
index 74969929c68b0727b4ed52c7419c791a0016767a..481f3a0c1b2e197a070acc8ff414fe2582b0f54b 100644 (file)
@@ -27,10 +27,6 @@ import org.aspectj.weaver.bcel.BcelWorld;
 /**
  * @author hugunin
  *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class AndOrNotTestCase extends TestCase {               
        /**
@@ -41,6 +37,9 @@ public class AndOrNotTestCase extends TestCase {
                super(name);
        }
        
+       static {
+               new Foo();new Bar();new C(); // just to touch them and so eclipse thinks they are used
+       }
        World world;
                                        
        
@@ -97,8 +96,8 @@ public class AndOrNotTestCase extends TestCase {
                assertEquals("write/read", p, newP);    
        }
        
-       private static class Foo{};
-       private static class Bar{};
-       private static class C{};
+       private static class Foo{}
+       private static class Bar{}
+       private static class C{}
        
 }
index b7a1ef319ed0da677d0df27b65ec3ffdc3b9ed12..5e6ad5e59410de389ea99a5fbb72153fde4a41da 100644 (file)
@@ -102,12 +102,13 @@ public class AnnotationPatternMatchingTestCase extends TestCase {
                        return false;
                }
                public boolean isIgnoring(Kind kind) {return false;}
-        public void dontIgnore(IMessage.Kind kind) {;}
+        public void dontIgnore(IMessage.Kind kind) {}
                public void ignore(Kind kind) {}
        }
        
        public void testReferenceToNonAnnotationType() {
-               ResolvedType rtx = loadType("AnnotatedClass"); // inits the world
+//             ResolvedType rtx = 
+                       loadType("AnnotatedClass"); // inits the world
                PatternParser p = new PatternParser("@java.lang.String");
                
                MyMessageHandler mh = new MyMessageHandler();
@@ -123,7 +124,8 @@ public class AnnotationPatternMatchingTestCase extends TestCase {
        }
        
        public void testReferenceViaFormalToNonAnnotationType() {
-               ResolvedType rtx = loadType("AnnotatedClass"); // inits the world
+//             ResolvedType rtx = 
+                       loadType("AnnotatedClass"); // inits the world
                PatternParser p = new PatternParser("a");
                
                MyMessageHandler mh = new MyMessageHandler();
index adf8f415f279f7f64424f977bc55169ffceab4e2..52c2cb811e8d76df76550f7ab7d0da112b2e42ac 100644 (file)
@@ -86,8 +86,10 @@ public class AnnotationPatternTestCase extends TestCase {
                ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);                
                AndAnnotationTypePattern atp = (AndAnnotationTypePattern) ap;
                NotAnnotationTypePattern notBoo = (NotAnnotationTypePattern) atp.getRight();
-               ExactAnnotationTypePattern boo = (ExactAnnotationTypePattern) notBoo.getNegatedPattern();
-               AnnotationTypePattern fooOrGoo = (AnnotationTypePattern) atp.getLeft();
+//             ExactAnnotationTypePattern boo = (ExactAnnotationTypePattern) 
+                       notBoo.getNegatedPattern();
+//             AnnotationTypePattern fooOrGoo = (AnnotationTypePattern) 
+                       atp.getLeft();
                assertEquals("@((Foo || Goo)) !@Boo",ap.toString());
        }
        
@@ -116,14 +118,15 @@ public class AnnotationPatternTestCase extends TestCase {
        public void testParseNameOrVarAnnotationPattern() {
                PatternParser p = new PatternParser("Foo");
                AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
-               assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
+               assertTrue("ExactAnnotationTypePattern expected",foo!=null);
                assertEquals("Foo",UnresolvedType.forName("Foo"),((ExactAnnotationTypePattern)foo).annotationType);             
        }
        
        public void testParseNameOrVarAnnotationPatternWithNot() {
                PatternParser p = new PatternParser("!@Foo");
                try {
-                       AnnotationTypePattern bad = p.parseAnnotationNameOrVarTypePattern();
+//                     AnnotationTypePattern bad = 
+                               p.parseAnnotationNameOrVarTypePattern();
                        fail("ParserException expected");
                } catch(ParserException pEx) {
                        assertEquals("identifier",pEx.getMessage());
index 5b0a09b0edf424d6c0a5f2b71489f764f913b9d1..4d157628c32949d524f0e37ee89cf0517841ae68 100644 (file)
@@ -140,15 +140,15 @@ public class ArgsTestCase extends TestCase {
                public void anInt(int i) {}
                public void anInteger(Integer i) {}
                
-       };
+       }
        private static class B extends A {
                public void x(A a) {}
                public void y(B b) {}
-       };
+       }
        private static class C {
                public void z(A a, C c) {}
                public void t(B b, A a) {}
-       };
+       }
 
        
        private boolean needToSkip = false;
index 4f3e63a17195c04d50111280e61661c855c29f10..d6592da54bf67c966c82bf2f9b7a1c52e1e9791d 100644 (file)
@@ -84,25 +84,26 @@ public class ParserTestCase extends TestCase {
        public void testParseExecutionWithMultipleAnnotations() {
            PatternParser parser = new PatternParser("execution(@SimpleAnnotation (@Foo Integer) (@Goo Hello).*(..))");
            KindedPointcut p = (KindedPointcut) parser.parsePointcut();
-           assertEquals("execution(@(SimpleAnnotation) (@(Foo) Integer) (@(Goo) Hello).*(..))",p.toString());;
+           assertEquals("execution(@(SimpleAnnotation) (@(Foo) Integer) (@(Goo) Hello).*(..))",p.toString());
        }
        
        public void testParseCallWithMultipleAnnotations() {
            PatternParser parser = new PatternParser("call(@SimpleAnnotation (@Foo Integer) (@Goo Hello).*(..))");
            KindedPointcut p = (KindedPointcut) parser.parsePointcut();
-           assertEquals("call(@(SimpleAnnotation) (@(Foo) Integer) (@(Goo) Hello).*(..))",p.toString());;          
+           assertEquals("call(@(SimpleAnnotation) (@(Foo) Integer) (@(Goo) Hello).*(..))",p.toString());
        }
        
        public void testParseGetWithAnnotations() {
            PatternParser parser = new PatternParser("get(@Foo (@SimpleAnnotation ReturnType) (@Foo @Goo Hello).*)");
            KindedPointcut p = (KindedPointcut) parser.parsePointcut();
-           assertEquals("get(@(Foo) (@(SimpleAnnotation) ReturnType) (@(Foo) @(Goo) Hello).*)",p.toString());    
+           assertEquals("get(@(Foo) (@(SimpleAnnotation) ReturnType) (@(Foo) @(Goo) Hello).*)",p.toString());    
        }
        
        public void testParseBadGetWithAnnotations() {
            PatternParser parser = new PatternParser("get(@Foo (@Foo @Goo Hello).*)");
            try {
-               KindedPointcut p = (KindedPointcut) parser.parsePointcut();
+//             KindedPointcut p = (KindedPointcut) 
+                       parser.parsePointcut();
                fail("Expected parser exception");
            } catch (ParserException pEx) {
                assertEquals("name pattern",pEx.getMessage());
@@ -112,20 +113,20 @@ public class ParserTestCase extends TestCase {
        public void testParseGetWithAndAggregationAnnotations() {
            PatternParser parser = new PatternParser("get(@Foo @SimpleAnnotation ReturnType (@Foo @Goo Hello).*)");
            KindedPointcut p = (KindedPointcut) parser.parsePointcut();
-           assertEquals("get(@(Foo) @(SimpleAnnotation) ReturnType (@(Foo) @(Goo) Hello).*)",p.toString());;       
+           assertEquals("get(@(Foo) @(SimpleAnnotation) ReturnType (@(Foo) @(Goo) Hello).*)",p.toString());        
        }
        
        
        public void testParseSetWithAnnotations() {
            PatternParser parser = new PatternParser("set(@Foo (@SimpleAnnotation ReturnType) (@Foo @Goo Hello).*)");
            KindedPointcut p = (KindedPointcut) parser.parsePointcut();
-           assertEquals("set(@(Foo) (@(SimpleAnnotation) ReturnType) (@(Foo) @(Goo) Hello).*)",p.toString());;     
+           assertEquals("set(@(Foo) (@(SimpleAnnotation) ReturnType) (@(Foo) @(Goo) Hello).*)",p.toString());   
        }
        
        public void testParseHandlerWithAnnotations() {
            PatternParser parser = new PatternParser("handler(@Critical Exception+)");
            Pointcut p = parser.parsePointcut();
-           assertEquals("handler((@(Critical) Exception+))",p.toString());;        
+           assertEquals("handler((@(Critical) Exception+))",p.toString());         
        }
 
        public void testParseInitializationWithAnnotations() {
@@ -168,7 +169,8 @@ public class ParserTestCase extends TestCase {
        public void testBadAtAnnotation() {
            PatternParser parser = new PatternParser("@annotation(!Foo)");
            try {
-               Pointcut p = parser.parsePointcut();
+//             Pointcut p = 
+                       parser.parsePointcut();
                fail("Expected parser exception");
            } catch (ParserException pEx) {
                assertEquals("identifier",pEx.getMessage());
@@ -184,7 +186,8 @@ public class ParserTestCase extends TestCase {
        public void testDoubleAtAnnotation() {
            PatternParser parser = new PatternParser("@annotation(Foo Goo)");
            try {
-               Pointcut p = parser.parsePointcut();
+//             Pointcut p = 
+                       parser.parsePointcut();
                fail("Expected parser exception");
            } catch (ParserException pEx) {
                assertEquals(")",pEx.getMessage());
@@ -329,7 +332,8 @@ public class ParserTestCase extends TestCase {
        public void testParseDeclareParentsWithTypeParameterList() {
                try {
                        PatternParser parser = new PatternParser("declare parents<T> : Foo<T> implements IveGoneMad");
-                       DeclareParents decp = (DeclareParents) parser.parseDeclare();
+                       //DeclareParents decp = (DeclareParents) 
+                         parser.parseDeclare();
 //                     String[] tvp = decp.getTypeParameterNames();
 //                     assertEquals("one type parameter",1,tvp.length);
 //                     assertEquals("expecting T","T",tvp[0]);
@@ -342,7 +346,8 @@ public class ParserTestCase extends TestCase {
        public void testParameterizedTypePatternsAny() {
                try {
                        PatternParser parser = new PatternParser("*<T,S extends Number>");
-                       WildTypePattern wtp = (WildTypePattern) parser.parseTypePattern(false,false);
+//                     WildTypePattern wtp = (WildTypePattern) 
+                               parser.parseTypePattern(false,false);
        //              TypePatternList tvs = wtp.getTypeParameters();
        //              assertEquals("2 type parameters",2,tvs.getTypePatterns().length);
        //              assertEquals("T",new PatternParser("T").parseTypePattern(),tvs.getTypePatterns()[0]);
@@ -388,7 +393,9 @@ public class ParserTestCase extends TestCase {
        public void testSimpleTypeVariableListError() {
                PatternParser parser = new PatternParser("<T extends Number>");
                try {
-                       String[] tl = parser.maybeParseSimpleTypeVariableList();
+//                     String[] tl = 
+                               parser.maybeParseSimpleTypeVariableList();
+                       fail();
                } catch (ParserException ex) {
                        assertEquals("Expecting ',' or '>'","',' or '>'",ex.getMessage());
                }       
@@ -398,7 +405,7 @@ public class ParserTestCase extends TestCase {
        public void testParseCallPCDWithTypeVariables() {
                PatternParser parser = new PatternParser("call<T>(* Foo<T>.*(T))");
                try {
-                       Pointcut pc = parser.parsePointcut();
+                       parser.parsePointcut();
 //                     String[] tvps = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type variable",1,tvps.length);
 //                     assertEquals("T",tvps[0]);
@@ -551,7 +558,8 @@ public class ParserTestCase extends TestCase {
        public void testExecutionWithTypeVariables() {
                PatternParser parser = new PatternParser("execution<T>(T Bar<T>.doSomething())");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);
@@ -564,7 +572,8 @@ public class ParserTestCase extends TestCase {
        public void testInitializationWithTypeVariables() {
                PatternParser parser = new PatternParser("initialization<T>(Bar<T>.new())");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
@@ -577,7 +586,8 @@ public class ParserTestCase extends TestCase {
        public void testPreInitializationWithTypeVariables() {
                PatternParser parser = new PatternParser("preinitialization<T>(Bar<T>.new())");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
@@ -590,7 +600,7 @@ public class ParserTestCase extends TestCase {
        public void testStaticInitializationWithTypeVariables() {
                PatternParser parser = new PatternParser("staticinitialization<T>(Bar<T>)");
                try {
-                       Pointcut pc = parser.parsePointcut();
+                       parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
@@ -603,7 +613,7 @@ public class ParserTestCase extends TestCase {
        public void testWithinWithTypeVariables() {
                PatternParser parser = new PatternParser("within<T>(Bar<T>)");
                try {
-               Pointcut pc = parser.parsePointcut();
+                       parser.parsePointcut();
        //              String[] tvs = pc.getTypeVariablesInScope();
        //              assertEquals("1 type pattern",1,tvs.length);
        //              assertEquals("T",tvs[0]);               
@@ -616,7 +626,7 @@ public class ParserTestCase extends TestCase {
        public void testTypeParamList() {
                PatternParser parser = new PatternParser("Bar<T,S extends T, R extends S>");
                try {
-                       TypePattern tp = parser.parseTypePattern(false,false);
+                       parser.parseTypePattern(false,false);
 //                     TypePattern[] tps = tp.getTypeParameters().getTypePatterns();
 //                     assertEquals("3 type patterns",3,tps.length);
 //                     assertEquals("T",tps[0].toString());
@@ -631,7 +641,7 @@ public class ParserTestCase extends TestCase {
        public void testWithinCodeWithTypeVariables() {
                PatternParser parser = new PatternParser("withincode<T,S,R>(Bar<T,S extends T, R extends S>.new())");
                try {
-               Pointcut pc = parser.parsePointcut();
+                       parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("3 type patterns",3,tvs.length);
 //                     assertEquals("T",tvs[0]);
@@ -646,7 +656,8 @@ public class ParserTestCase extends TestCase {
        public void testCallWithTypeVariables() {
                PatternParser parser = new PatternParser("call<T>(* Bar<T>.*(..))");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
@@ -659,7 +670,8 @@ public class ParserTestCase extends TestCase {
        public void testGetWithTypeVariables() {
                PatternParser parser = new PatternParser("get<T>(* Bar<T>.*)");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
@@ -672,7 +684,8 @@ public class ParserTestCase extends TestCase {
        public void testSetWithTypeVariables() {
                PatternParser parser = new PatternParser("set<T>(* Bar<T>.*)");
                try {
-                       Pointcut pc = parser.parsePointcut();
+//                     Pointcut pc = 
+                               parser.parsePointcut();
 //                     String[] tvs = pc.getTypeVariablesInScope();
 //                     assertEquals("1 type pattern",1,tvs.length);
 //                     assertEquals("T",tvs[0]);               
index 20c6a4064452b5c63d58ae9836b18bcd16e9cdd3..f6b96ef2c09c392459e23bbf2d53003a6bb7b1ec 100644 (file)
@@ -180,7 +180,8 @@ public class PointcutRewriterTest extends TestCase {
        
        public void testNotRemoveNearlyDuplicatesInAnd() {
                Pointcut toAndto = getPointcut("this(Object+) && this(Object)");
-               Pointcut rewritten = prw.rewrite(toAndto);
+//             Pointcut rewritten = 
+                       prw.rewrite(toAndto);
        }
        
        public void testAAndNotAinAnd() {
index de3fa022249c7b9be3778a657dd35c8e17c6b5a3..2e8de7c7314fe75506ff52196d9dd999df9321ac 100644 (file)
@@ -58,7 +58,7 @@ import org.aspectj.weaver.bcel.BcelWorld;
                 assertEquals("Ljava/util/List;",rt.getSignature());
                 assertTrue(rt.isRawType());
                 
-                ExactTypePattern etp = (ExactTypePattern) writeAndRead((ExactTypePattern)rtp);
+                ExactTypePattern etp = (ExactTypePattern) writeAndRead(rtp);
                 exactType = etp.getExactType();
 
                 assertEquals("Ljava/util/List;",exactType.getSignature());
@@ -92,7 +92,7 @@ import org.aspectj.weaver.bcel.BcelWorld;
                 assertEquals("Pjava/util/List<Ljava/lang/String;>;",rt.getSignature());
                 assertTrue(rt.isParameterizedType());
 
-                ExactTypePattern etp = (ExactTypePattern) writeAndRead((ExactTypePattern)rtp);
+                ExactTypePattern etp = (ExactTypePattern) writeAndRead(rtp);
                 exactType = etp.getExactType();
 
                 assertEquals("Pjava/util/List<Ljava/lang/String;>;",rt.getSignature());
index 690f64d32af2191f1b5030fa01714142c5f6e220..5e7d40d0bb4ca19ba520c3c6dedc959d8df2d18a 100644 (file)
@@ -77,7 +77,8 @@ public class PointcutDesignatorHandlerTests extends TestCase {
         // public void testBean1SetAge() { }
 
         // This should be found and resolved
-        PointcutExpression pc = parser.parsePointcutExpression("CounterAspect.testBean1SetAge()");
+//        PointcutExpression pc = 
+               parser.parsePointcutExpression("CounterAspect.testBean1SetAge()");
 
     }