summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-13 10:44:13 +0000
committeraclement <aclement>2005-10-13 10:44:13 +0000
commit04e8dca2fc16f5f834e124b7abea5847d90c3366 (patch)
tree5e60cd6c4b4dec6f57d4963c52351ce380ff6631 /weaver
parentbd5acac2ea98c79c890b4d8b681c1ec9ae3b4b75 (diff)
downloadaspectj-04e8dca2fc16f5f834e124b7abea5847d90c3366.tar.gz
aspectj-04e8dca2fc16f5f834e124b7abea5847d90c3366.zip
Fix for 112243: incorrect entries in type map. Includes fix for this case and guards to give better info if it ever happens again.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/World.java5
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWorld.java16
2 files changed, 19 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java
index e68bcaf25..423898524 100644
--- a/weaver/src/org/aspectj/weaver/World.java
+++ b/weaver/src/org/aspectj/weaver/World.java
@@ -684,6 +684,11 @@ public abstract class World implements Dump.INode {
System.err.println("Not putting a bounded reference type into the typemap: key="+key+" type="+type);
return type;
}
+ if (type instanceof MissingResolvedTypeWithKnownSignature) {
+ if (debug)
+ System.err.println("Not putting a missing type into the typemap: key="+key+" type="+type);
+ return type;
+ }
if (isExpendable(type)) {
return (ResolvedType) expendableMap.put(key,type);
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
index 0fe339afd..467674042 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
@@ -41,6 +41,7 @@ import org.aspectj.bridge.IMessageHandler;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AdviceKind;
import org.aspectj.weaver.AjAttribute;
+import org.aspectj.weaver.BCException;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.ICrossReferenceHandler;
import org.aspectj.weaver.Member;
@@ -273,8 +274,19 @@ public class BcelWorld extends World implements Repository {
public BcelObjectType addSourceObjectType(JavaClass jc) {
BcelObjectType ret = null;
String signature = UnresolvedType.forName(jc.getClassName()).getSignature();
- ReferenceType nameTypeX = (ReferenceType)typeMap.get(signature);
-
+
+ Object fromTheMap = typeMap.get(signature);
+
+ if (fromTheMap!=null && !(fromTheMap instanceof ReferenceType)) {
+ // what on earth is it then? See pr 112243
+ StringBuffer exceptionText = new StringBuffer();
+ exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
+ exceptionText.append("Signature=["+signature+"] Found=["+fromTheMap+"] Class=["+fromTheMap.getClass()+"]");
+ throw new BCException(exceptionText.toString());
+ }
+
+ ReferenceType nameTypeX = (ReferenceType)fromTheMap;
+
if (nameTypeX == null) {
if (jc.isGeneric()) {
nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()),this);