]> source.dussan.org Git - aspectj.git/commitdiff
280676: problem 2: allow for target not being generic
authoraclement <aclement>
Wed, 17 Jun 2009 22:27:13 +0000 (22:27 +0000)
committeraclement <aclement>
Wed, 17 Jun 2009 22:27:13 +0000 (22:27 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java

index 9ecf4fc4b767c60bd5571ba2989637938fae050e..ab7f75f91130218e400fc9b626e695d2d5741e49 100644 (file)
@@ -1410,9 +1410,16 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                        if (debug)
                                System.err.println("  Signature that needs parameterizing: " + member);
                        // Retrieve the generic type
-                       ResolvedType onType = world.resolve(member.getDeclaringType()).getGenericType();
-                       member.resolve(world); // Ensure all parts of the member are
-                       // resolved
+                       ResolvedType onTypeResolved = world.resolve(member.getDeclaringType());
+                       ResolvedType onType = onTypeResolved.getGenericType();
+                       if (onType == null) {
+                               // The target is not generic
+                               getWorld().getMessageHandler().handleMessage(
+                                               MessageUtil.error("The target type for the intertype declaration is not generic", munger
+                                                               .getSourceLocation()));
+                               return munger;
+                       }
+                       member.resolve(world); // Ensure all parts of the member are resolved
                        if (debug)
                                System.err.println("  Actual target ontype: " + onType + "  (" + onType.typeKind + ")");
                        // quickly find the targettype in the type hierarchy for this type