From: aclement Date: Wed, 17 Jun 2009 22:27:13 +0000 (+0000) Subject: 280676: problem 2: allow for target not being generic X-Git-Tag: V1_6_5~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=60c1f1ca927f1a3b5fbac21f1781c34355f662a6;p=aspectj.git 280676: problem 2: allow for target not being generic --- diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index 9ecf4fc4b..ab7f75f91 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -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