diff options
author | aclement <aclement> | 2004-08-23 08:19:04 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-23 08:19:04 +0000 |
commit | eed1b054c9c27d6d112e9e66de290dd5f6188f47 (patch) | |
tree | c09c2fc2114f273ec51ec4a8044b8082016b9898 /weaver/src | |
parent | df55b490f7059bda21e2e116f577ee7482dc3618 (diff) | |
download | aspectj-eed1b054c9c27d6d112e9e66de290dd5f6188f47.tar.gz aspectj-eed1b054c9c27d6d112e9e66de290dd5f6188f47.zip |
Two more "cant find types" dealt with.
Diffstat (limited to 'weaver/src')
-rw-r--r-- | weaver/src/org/aspectj/weaver/WeaverMessages.java | 3 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 23 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/weaver-messages.properties | 2 |
3 files changed, 26 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/WeaverMessages.java b/weaver/src/org/aspectj/weaver/WeaverMessages.java index ced85c507..c8351b5f7 100644 --- a/weaver/src/org/aspectj/weaver/WeaverMessages.java +++ b/weaver/src/org/aspectj/weaver/WeaverMessages.java @@ -73,6 +73,9 @@ public class WeaverMessages { public static final String CANT_FIND_TYPE = "cantFindType"; public static final String CANT_FIND_CORE_TYPE = "cantFindCoreType"; public static final String CANT_FIND_TYPE_WITHINPCD = "cantFindTypeWithinpcd"; + public static final String CANT_FIND_TYPE_DURING_AROUND_WEAVE = "cftDuringAroundWeave"; + public static final String CANT_FIND_TYPE_DURING_AROUND_WEAVE_PREINIT = "cftDuringAroundWeavePreinit"; + public static final String DECP_BINARY_LIMITATION = "decpBinaryLimitation"; public static final String OVERWRITE_JSR45 = "overwriteJSR45"; diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index d521ed52d..83abe334f 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -43,7 +43,9 @@ import org.aspectj.apache.bcel.generic.SWAP; import org.aspectj.apache.bcel.generic.StoreInstruction; import org.aspectj.apache.bcel.generic.TargetLostException; import org.aspectj.apache.bcel.generic.Type; +import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; +import org.aspectj.bridge.Message; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.AjcMemberMaker; @@ -56,6 +58,7 @@ import org.aspectj.weaver.ResolvedTypeX; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.TypeX; +import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; import org.aspectj.weaver.ast.Var; @@ -1456,7 +1459,14 @@ public class BcelShadow extends Shadow { // !!! THIS BLOCK OF CODE SHOULD BE IN A METHOD CALLED weaveAround(...); Member mungerSig = munger.getSignature(); - ResolvedTypeX declaringType = world.resolve(mungerSig.getDeclaringType()); + ResolvedTypeX declaringType = world.resolve(mungerSig.getDeclaringType(),true); + if (declaringType == ResolvedTypeX.MISSING) { + IMessage msg = new Message( + WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_DURING_AROUND_WEAVE,declaringType.getClassName()), + "",IMessage.ERROR,getSourceLocation(),null, + new ISourceLocation[]{ munger.getSourceLocation()}); + world.getMessageHandler().handleMessage(msg); + } //??? might want some checks here to give better errors BcelObjectType ot = BcelWorld.getBcelObjectType(declaringType); @@ -1793,11 +1803,20 @@ public class BcelShadow extends Shadow { returnConversionCode.append(InstructionConstants.ALOAD_0); // put "this" back on the stack for (int i = 0, len = stateTypes.length; i < len; i++) { + TypeX bcelTX = BcelWorld.fromBcel(stateTypes[i]); + ResolvedTypeX stateRTX = world.resolve(bcelTX,true); + if (stateRTX == ResolvedTypeX.MISSING) { + IMessage msg = new Message( + WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_DURING_AROUND_WEAVE_PREINIT,bcelTX.getClassName()), + "",IMessage.ERROR,getSourceLocation(),null, + new ISourceLocation[]{ munger.getSourceLocation()}); + world.getMessageHandler().handleMessage(msg); + } stateTempVar.appendConvertableArrayLoad( returnConversionCode, fact, i, - world.resolve(BcelWorld.fromBcel(stateTypes[i]))); + stateRTX); } } else { returnConversionCode = diff --git a/weaver/src/org/aspectj/weaver/weaver-messages.properties b/weaver/src/org/aspectj/weaver/weaver-messages.properties index febd44ff7..128016fb2 100644 --- a/weaver/src/org/aspectj/weaver/weaver-messages.properties +++ b/weaver/src/org/aspectj/weaver/weaver-messages.properties @@ -76,6 +76,8 @@ aspectNeeded=aspect {0} is needed when using type {1} cantFindType=can''t find type {0} cantFindCoreType=can''t find critical required type {0} cantFindTypeWithinpcd=Unable to find type {0} whilst processing within() pointcut at this source location +cftDuringAroundWeave=Can't find type {0} whilst applying around advice +cftDuringAroundWeavePreinit=Can't find type {0} whilst applying around advice to preinitialization join point # Implementation limitations... decpBinaryLimitation=can''t use declare parents to change superclass of binary form ''{0}'' (implementation limitation) |