diff options
author | aclement <aclement> | 2010-08-06 19:52:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-08-06 19:52:09 +0000 |
commit | 782187124b8390eca6e45f189dd7c46a1bf3c900 (patch) | |
tree | 438f4bed7ba9ffa3a4ada783806f46fadceef421 /org.aspectj.matcher/src/org/aspectj | |
parent | b700ab3bfb4ac02f78d093a190afc0def383b4bc (diff) | |
download | aspectj-782187124b8390eca6e45f189dd7c46a1bf3c900.tar.gz aspectj-782187124b8390eca6e45f189dd7c46a1bf3c900.zip |
278496: some attempted improvements
Diffstat (limited to 'org.aspectj.matcher/src/org/aspectj')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/World.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/org/aspectj/weaver/World.java index d4b435129..6a5a39b30 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/World.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/World.java @@ -313,6 +313,7 @@ public abstract class World implements Dump.INode { // Pulling in the type may have already put the right entry in the map ResolvedType result = typeMap.get(signature); if (result == null && !ret.isMissing()) { + ret = ensureRawTypeIfNecessary(ret); typeMap.put(signature, ret); return ret; } @@ -391,11 +392,7 @@ public abstract class World implements Dump.INode { * @return a type suitable for putting into the world */ private ResolvedType ensureRawTypeIfNecessary(ResolvedType type) { - if (!isInJava5Mode()) { - // Don't care, not running in 1.5 mode - return type; - } - if (type.isRawType()) { + if (!isInJava5Mode() || type.isRawType()) { return type; } // Key requirement here is if it is generic, create a RAW entry to be put in the map that points to it @@ -1068,18 +1065,23 @@ public abstract class World implements Dump.INode { } List<ConcreteTypeMunger> typeMungers = type.getInterTypeMungers(); if (typeMungers == null || typeMungers.size() == 0) { - tMap.remove(key); - insertInExpendableMap(key, type); - demotionCounter++; - } + tMap.remove(key); + insertInExpendableMap(key, type); + demotionCounter++; } } + } addedSinceLastDemote.clear(); } else { // Compile time demotion strategy List<String> forRemoval = new ArrayList<String>(); for (String key : addedSinceLastDemote) { ResolvedType type = tMap.get(key); + if (type == null) { + // TODO not 100% sure why it is not there, where did it go? + forRemoval.add(key); + continue; + } if (!writtenClasses.contains(type.getName())) { // COSTLY continue; } @@ -1201,6 +1203,13 @@ public abstract class World implements Dump.INode { return type; } + // TODO should this be in as a permanent assertion? + /* + if ((type instanceof ReferenceType) && type.getWorld().isInJava5Mode() + && (((ReferenceType) type).getDelegate() != null) && type.isGenericType()) { + throw new BCException("Attempt to add generic type to typemap " + type.toString() + " (should be raw)"); + }*/ + if (w.isExpendable(type)) { if (useExpendableMap) { // Dont use reference queue for tracking if not profiling... |