]> source.dussan.org Git - aspectj.git/commitdiff
findbugs/eclipse warnings fixed
authoraclement <aclement>
Wed, 27 Aug 2008 00:38:33 +0000 (00:38 +0000)
committeraclement <aclement>
Wed, 27 Aug 2008 00:38:33 +0000 (00:38 +0000)
weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/reflect/ReflectionWorld.java
weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java

index 1a0a52d8a8486b6940bc43592d25039491b4bbb9..8b8473b3a091997cef21461452951ada859ef2ea 100644 (file)
@@ -743,7 +743,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
 //             }
         declaringType = declaringType.resolve(w);
         if (declaringType.isRawType()) declaringType = ((ResolvedType)declaringType).getGenericType();
-               TypeVariable[] typeVariables = getDeclaringType().getTypeVariables();
+//             TypeVariable[] typeVariables = getDeclaringType().getTypeVariables();
 //             if (isParameterized && (typeVariables.length != typeParameters.length)) {
 //                     throw new IllegalStateException("Wrong number of type parameters supplied");
 //             }
@@ -817,12 +817,12 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
 //                             if (!(getDeclaringType() instanceof ResolvedType)) {
 //                                     int stop = 1;
 //                             }
-                               if (aType instanceof UnresolvedType) {
+//                             if (aType!=null) {// instanceof UnresolvedType) {
                                        if (w!=null) aType = aType.resolve(w);
                                        else {
                                                aType= aType.resolve(((ResolvedType)getDeclaringType()).getWorld());
                                        }
-                               }
+//                             }
                                return aType.parameterize(typeVariableMap);
                        } else {
                                return aType.getRawType();
index db0ca8becb52a158ad476ac51695c7308ba1aa52..757fac8eb469deef017197043ba607fb222aefa7 100644 (file)
@@ -1232,19 +1232,19 @@ public class AtAjAttributes {
                 return false;//stop
             }
         } else {
-               if (pointcutExpr==null || (pointcutExpr != null && isNullOrEmpty(pointcutExpr.getValue().stringifyValue()))) {
+               if (pointcutExpr==null || isNullOrEmpty(pointcutExpr.getValue().stringifyValue())) {
                        // the matches nothing pointcut (125475/125480) - perhaps not as cleanly supported as it could be.
                } else {
-              if (pointcutExpr != null) {
+//              if (pointcutExpr != null) {
                 // use a LazyResolvedPointcutDefinition so that the pointcut is resolved lazily
                 // since for it to be resolved, we will need other pointcuts to be registered as well
                 pc = parsePointcut(pointcutExpr.getValue().stringifyValue(), struct, true);
                 if (pc == null) return false;//parse error
                 pc.setLocation(struct.context, -1, -1);//FIXME AVASM !! bMethod is null here..
-              } else {
-                reportError("Found undefined @Pointcut on a non-abstract method", struct);
-                return false;
-              }
+//              } else {
+//                reportError("Found undefined @Pointcut on a non-abstract method", struct);
+//                return false;
+//              }
                }
         }
         // do not resolve binding now but lazily
index 9102939130da75c6247d6df186e75109193be3cc..ee5d41fad4aef72f77c3a8dee22e120624c3469b 100644 (file)
@@ -972,7 +972,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                                for (int ii = 0;ii<originalParams.length;ii++) {
                                        if (!originalParams[ii].getErasureSignature().equals(newParams[ii].getErasureSignature())) needsbridging=true;
                                }
-                               if (toBridgeTo!=null && needsbridging) {
+                               if (needsbridging) {
                                        ResolvedMember bridgerMethod = AjcMemberMaker.bridgerToInterMethod(unMangledInterMethod,gen.getType());
                                        ResolvedMember bridgingSetter = AjcMemberMaker.interMethod(toBridgeTo, aspectType, false);
                                        
index 12107649cc1bf5f51b18364b74d77495dbd8d278..fc4a9d561f17ce50406fbd26d8fe23bd15181f67 100644 (file)
@@ -43,11 +43,11 @@ public class ReflectionWorld extends World implements IReflectionWorld {
        private AnnotationFinder annotationFinder;
        
        private ReflectionWorld() {
-               super();
-               this.setMessageHandler(new ExceptionBasedMessageHandler());
-               setBehaveInJava5Way(LangUtil.is15VMOrGreater());
-               this.classLoaderReference = new WeakClassLoaderReference(ReflectionWorld.class.getClassLoader());
-               this.annotationFinder = makeAnnotationFinderIfAny(classLoaderReference.getClassLoader(), this);
+//             super();
+//             this.setMessageHandler(new ExceptionBasedMessageHandler());
+//             setBehaveInJava5Way(LangUtil.is15VMOrGreater());
+//             this.classLoaderReference = new WeakClassLoaderReference(ReflectionWorld.class.getClassLoader());
+//             this.annotationFinder = makeAnnotationFinderIfAny(classLoaderReference.getClassLoader(), this);
        }
        
        public ReflectionWorld(ClassLoader aClassLoader) {
index 231df0c756b4bf73d650c068b0eede2af80ea56a..dc4c2e3d1dc733170577ae76d7c5fed17aca1101 100644 (file)
@@ -149,7 +149,7 @@ public class TypeXTestCase extends TestCase {
                assertTrue("Expected parameterization flag to be "+shouldBeParameterized,tx.isParameterizedType()==shouldBeParameterized);
                if (numberOfTypeParameters==0) {
                        UnresolvedType[] params = tx.getTypeParameters();
-                       assertTrue("Expected 0 type parameters but found "+params.length,params==null || params.length==0);
+                       assertTrue("Expected 0 type parameters but found "+params.length, params.length==0);
            } else {
                                assertTrue("Expected #type parameters to be "+numberOfTypeParameters,tx.getTypeParameters().length==numberOfTypeParameters);
            }
index 3408e759a6ceb224cad7e28cc26e769773171612..adf8f415f279f7f64424f977bc55169ffceab4e2 100644 (file)
@@ -100,7 +100,7 @@ public class AnnotationPatternTestCase extends TestCase {
        public void testParseBadPattern() {
                PatternParser p = new PatternParser("@@Foo");
                try {
-                       AnnotationTypePattern bad = p.maybeParseAnnotationPattern();
+                       p.maybeParseAnnotationPattern();
                        fail("ParserException expected");
                } catch(ParserException pEx) {
                        assertEquals("name pattern",pEx.getMessage());