diff options
author | acolyer <acolyer> | 2005-11-25 19:12:27 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-11-25 19:12:27 +0000 |
commit | 78e8ecbd934a4fbfe6e2776b59a4045b0c3e8e80 (patch) | |
tree | 41d6b54f8c8dc6b1fc08ddd9020d20e9c8d90425 /aspectj5rt | |
parent | c860a8664600e46d5b78976a59125abf0bbc7f3c (diff) | |
download | aspectj-78e8ecbd934a4fbfe6e2776b59a4045b0c3e8e80.tar.gz aspectj-78e8ecbd934a4fbfe6e2776b59a4045b0c3e8e80.zip |
eliminates many warnings in the aspectj5rt package - 10 generic related warnings remain that I'm not sure how to eradicate!
Diffstat (limited to 'aspectj5rt')
5 files changed, 12 insertions, 11 deletions
diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AdviceImpl.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AdviceImpl.java index 0cdf0bc96..77b30223f 100644 --- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AdviceImpl.java +++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AdviceImpl.java @@ -64,7 +64,7 @@ public class AdviceImpl implements Advice { this.genericParameterTypes = new Type[genTypes.length - syntheticCount]; for (int i = 0; i < genericParameterTypes.length; i++) { if (genTypes[i] instanceof Class) { - this.genericParameterTypes[i] = AjTypeSystem.getAjType((Class)genTypes[i]); + this.genericParameterTypes[i] = AjTypeSystem.getAjType((Class<?>)genTypes[i]); } else { this.genericParameterTypes[i] = genTypes[i]; } diff --git a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java index 60db9a2ba..8534d0743 100644 --- a/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java +++ b/aspectj5rt/java5-src/org/aspectj/internal/lang/reflect/AjTypeImpl.java @@ -118,8 +118,9 @@ public class AjTypeImpl<T> implements AjType<T> { /* (non-Javadoc) * @see org.aspectj.lang.reflect.AjType#getSupertype() */ - public AjType<?> getSupertype() { - return new AjTypeImpl(clazz.getSuperclass()); + public AjType<? super T> getSupertype() { + Class<? super T> superclass = clazz.getSuperclass(); + return (AjType<? super T>) new AjTypeImpl(superclass); } /* (non-Javadoc) diff --git a/aspectj5rt/java5-src/org/aspectj/lang/reflect/AjTypeSystem.java b/aspectj5rt/java5-src/org/aspectj/lang/reflect/AjTypeSystem.java index fbd9a6644..737abc1b6 100644 --- a/aspectj5rt/java5-src/org/aspectj/lang/reflect/AjTypeSystem.java +++ b/aspectj5rt/java5-src/org/aspectj/lang/reflect/AjTypeSystem.java @@ -35,7 +35,7 @@ public class AjTypeSystem { */ public static <T> AjType<T> getAjType(Class<T> fromClass) { if (ajTypes.containsKey(fromClass)) { - WeakReference<AjType> weakRefToAjType = ajTypes.get(fromClass); + WeakReference<AjType<T>> weakRefToAjType = (WeakReference<AjType<T>>) ajTypes.get(fromClass); AjType<T> theAjType = weakRefToAjType.get(); if (theAjType != null) { return theAjType; diff --git a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTests.java b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTests.java index 211da98c3..f634d6c73 100644 --- a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTests.java +++ b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTests.java @@ -60,7 +60,7 @@ public class AjTypeTests extends TestCase { } public void testGetSupertype() { - Class stringSuper = String.class.getSuperclass(); + Class<?> stringSuper = String.class.getSuperclass(); AjType ajSuper = stringType.getSupertype(); assertEquals(AjTypeSystem.getAjType(stringSuper),ajSuper); } diff --git a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java index 7b15d3e64..046733b82 100644 --- a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java +++ b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java @@ -42,7 +42,7 @@ import org.aspectj.lang.reflect.TypePatternBasedPerClause; public class AjTypeTestsWithAspects extends TestCase { - private AjType sa; + private AjType<SimpleAspect> sa; protected void setUp() throws Exception { super.setUp(); @@ -50,11 +50,11 @@ public class AjTypeTestsWithAspects extends TestCase { } public void testGetPerClause() { - AjType perThisA = AjTypeSystem.getAjType(PerThisAspect.class); - AjType perTargetA = AjTypeSystem.getAjType(PerTargetAspect.class); - AjType perCflowA = AjTypeSystem.getAjType(PerCflowAspect.class); - AjType perCflowbelowA = AjTypeSystem.getAjType(PerCflowbelowAspect.class); - AjType perTypeWithinA = AjTypeSystem.getAjType(PerTypeWithin.class); + AjType<PerThisAspect> perThisA = AjTypeSystem.getAjType(PerThisAspect.class); + AjType<PerTargetAspect> perTargetA = AjTypeSystem.getAjType(PerTargetAspect.class); + AjType<PerCflowAspect> perCflowA = AjTypeSystem.getAjType(PerCflowAspect.class); + AjType<PerCflowbelowAspect> perCflowbelowA = AjTypeSystem.getAjType(PerCflowbelowAspect.class); + AjType<PerTypeWithin> perTypeWithinA = AjTypeSystem.getAjType(PerTypeWithin.class); PerClause pc = perThisA.getPerClause(); assertEquals(PerClauseKind.PERTHIS,pc.getKind()); |