From e72d332c31652088faf6c0d73cf80110f21dcbc2 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 26 Aug 2008 21:00:03 +0000 Subject: [PATCH] findbugs: cleared warnings --- .../weaver/reflect/Java15AnnotationFinder.java | 4 ++-- .../org/aspectj/weaver/Jdk14TraceFactoryTest.java | 2 +- .../org/aspectj/weaver/Jdk14TraceTest.java | 2 +- ...estJava5ReflectionBasedReferenceTypeDelegate.java | 2 +- .../bcel/BcelGenericSignatureToTypeXTestCase.java | 2 +- .../weaver/tools/Java15PointcutExpressionTest.java | 12 ++++++------ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java index 47f70c366..44e359d0b 100644 --- a/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java +++ b/weaver5/java5-src/org/aspectj/weaver/reflect/Java15AnnotationFinder.java @@ -308,7 +308,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor)onMember); anns = bcelCons.getParameterAnnotations(); } else if (onMember instanceof Field) { - anns = null; +// anns = null; } // the answer is cached and we don't want to hold on to memory bcelRepository.clear(); @@ -336,7 +336,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { } else if (onMember instanceof Constructor) { anns = ((Constructor)ao).getParameterAnnotations(); } else if (onMember instanceof Field) { - anns = null; +// anns = null; } if (anns == null) return NO_PARAMETER_ANNOTATIONS; ResolvedType[][] result = new ResolvedType[anns.length][]; diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceFactoryTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceFactoryTest.java index 39bdef23d..cec4d6a3d 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceFactoryTest.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceFactoryTest.java @@ -18,7 +18,7 @@ import org.aspectj.weaver.tools.Trace; public class Jdk14TraceFactoryTest extends TestCase { public void testJdk14TraceFactory() { - Jdk14TraceFactory factory = new Jdk14TraceFactory(); + new Jdk14TraceFactory(); } public void testGetTrace() { diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java index 5accd227b..0c694cc9d 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java @@ -22,7 +22,7 @@ public class Jdk14TraceTest extends AbstractTraceTest { } public void testJdk14Trace() { - Jdk14Trace trace = new Jdk14Trace(getClass()); + new Jdk14Trace(getClass()); } public void testSetTraceEnabled() { diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java index 94f13adf4..5861c0220 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/TestJava5ReflectionBasedReferenceTypeDelegate.java @@ -36,7 +36,7 @@ public class TestJava5ReflectionBasedReferenceTypeDelegate extends ReflectionBas world.resolve(collectionType).getRawType().resolve(world); ResolvedMember[] methods = world.resolve(collectionType).getDeclaredMethods(); int i = findMethod("toArray", 1, methods); - assertTrue("Couldn't find 'toArray' in the set of methods? "+methods,i != -1); + assertTrue("Couldn't find 'toArray' in the set of methods? ",i != -1); String expectedSignature = "java.lang.Object[] java.util.Collection.toArray(java.lang.Object[])"; assertTrue("Expected signature of '"+expectedSignature+"' but it was '"+methods[i],methods[i].toString().equals(expectedSignature)); } diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java b/weaver5/java5-testsrc/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java index 28cf82f5a..f849352d7 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java @@ -61,7 +61,7 @@ public class BcelGenericSignatureToTypeXTestCase extends TestCase { cSig.formalTypeParameters, world); assertEquals("Ljava/lang/Object;",resolved.getSignature()); - UnresolvedType resolvedInt = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX( + BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX( cSig.superInterfaceSignatures[0], cSig.formalTypeParameters, world); diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java index fa1e1d17d..47b57fe9a 100644 --- a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java +++ b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java @@ -153,14 +153,14 @@ public class Java15PointcutExpressionTest extends TestCase { Method a = test.A.class.getMethod("a",new Class[] {String.class}); // public void a(String s) {} Method b = test.A.class.getMethod("b",new Class[] {String.class}); // public void b(@A1 String s) {} Method c = test.A.class.getMethod("c",new Class[] {String.class}); // public void c(@A1 @A2 String s) {} - Method d = test.A.class.getMethod("d",new Class[] {String.class,String.class});// public void d(@A1 String s,@A2 String t) {} +// Method d = test.A.class.getMethod("d",new Class[] {String.class,String.class});// public void d(@A1 String s,@A2 String t) {} Method e = test.A.class.getMethod("e",new Class[] {A1AnnotatedType.class}); // public void e(A1AnnotatedType s) {} Method f = test.A.class.getMethod("f",new Class[] {A2AnnotatedType.class}); // public void f(A2AnnotatedType s) {} Method g = test.A.class.getMethod("g",new Class[] {A1AnnotatedType.class}); // public void g(@A2 A1AnnotatedType s) {} Method h = test.A.class.getMethod("h",new Class[] {A1AnnotatedType.class}); // public void h(@A1 A1AnnotatedType s) {} - Method i = test.A.class.getMethod("i",new Class[] {A1AnnotatedType.class,String.class}); // public void i(A1AnnotatedType s,@A2 String t) {} - Method j = test.A.class.getMethod("j",new Class[] {String.class}); // public void j(@A1 @A2 String s) {} +// Method i = test.A.class.getMethod("i",new Class[] {A1AnnotatedType.class,String.class}); // public void i(A1AnnotatedType s,@A2 String t) {} +// Method j = test.A.class.getMethod("j",new Class[] {String.class}); // public void j(@A1 @A2 String s) {} pexpr = p.parsePointcutExpression("execution(public void *(@test.A1 *))"); assertTrue("Should not match", pexpr.matchesMethodExecution(a).neverMatches()); @@ -223,7 +223,7 @@ public class Java15PointcutExpressionTest extends TestCase { " was '"+expectedNodeStructure+"' but it turned out to be '"+mpnv.getStringRepresentation()+"'"); } - String annotationTypePattern = tps[parameterNumber].getAnnotationPattern().toString(); + tps[parameterNumber].getAnnotationPattern().toString(); // parameter type annotation checking Set expected = new HashSet(); @@ -558,7 +558,7 @@ public class Java15PointcutExpressionTest extends TestCase { } public void testAnnotationInExecution() throws Exception { - PointcutExpression ex = parser.parsePointcutExpression("execution(@(org.springframework..*) * *(..))"); + parser.parsePointcutExpression("execution(@(org.springframework..*) * *(..))"); } public void testVarArgsMatching() throws Exception { @@ -599,7 +599,7 @@ public class Java15PointcutExpressionTest extends TestCase { params[0] = parser.createPointcutParameter("d", Date.class); params[1] = parser.createPointcutParameter("s", String.class); params[2] = parser.createPointcutParameter("ss", String[].class); - PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.UsesArrays.pc(d,s,ss)",UsesArrays.class,params); + parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.UsesArrays.pc(d,s,ss)",UsesArrays.class,params); } protected void setUp() throws Exception { -- 2.39.5