]> source.dussan.org Git - aspectj.git/commitdiff
generics: promoted getGenericType up to ResolvedTypeX - it will throw an exception...
authoraclement <aclement>
Mon, 4 Jul 2005 16:20:08 +0000 (16:20 +0000)
committeraclement <aclement>
Mon, 4 Jul 2005 16:20:08 +0000 (16:20 +0000)
weaver/src/org/aspectj/weaver/ReferenceType.java
weaver/src/org/aspectj/weaver/ResolvedTypeX.java

index 85bd291efb82bc4f59fd7f9e976a5ddac1c125bd..467428f564b9c1de66e6e48738217d56ef6ccc4a 100644 (file)
@@ -225,5 +225,9 @@ public class ReferenceType extends ResolvedTypeX {
        public void setGenericType(ReferenceType rt) {
                this.genericType = rt;
        }
+       
+       public ResolvedTypeX getGenericType() {
+               return genericType;
+       }
 
 }
\ No newline at end of file
index 803597d5ef54e9c3fb1c5def282e129b5e4f12c7..77afa2c38f3ca18e676b80a41185b1fd78de037b 100644 (file)
@@ -1411,5 +1411,15 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
        public WeaverStateInfo getWeaverState() {
                return null;
        }
+       
+       /**
+        * Overridden by ReferenceType to return a sensible answer for parameterized and raw types.
+        * @return
+        */
+       public ResolvedTypeX getGenericType() {
+               if (!(isParameterized() || isRawType()))
+                       throw new BCException("The type "+getBaseName()+" is not parameterized or raw - it has no generic type");
+               return null;
+       }
 
 }