diff options
author | aclement <aclement> | 2009-11-13 18:23:24 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-11-13 18:23:24 +0000 |
commit | 1524023405b6b1e596986fa44a6db48e5d401acc (patch) | |
tree | 41a510f548112e0cb9164edd0fd941cd56564dfd /org.aspectj.matcher | |
parent | f2f918dcfd63e5a344678c589d860506233f31b4 (diff) | |
download | aspectj-1524023405b6b1e596986fa44a6db48e5d401acc.tar.gz aspectj-1524023405b6b1e596986fa44a6db48e5d401acc.zip |
cache resolved ontype
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java index ce08ad23c..20a5bbe29 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java @@ -57,15 +57,19 @@ public abstract class ResolvedTypeMunger { private ISourceLocation location; // Lost during serialize/deserialize ! + private ResolvedType onType = null; + public ResolvedTypeMunger(Kind kind, ResolvedMember signature) { this.kind = kind; this.signature = signature; UnresolvedType declaringType = signature != null ? signature.getDeclaringType() : null; if (declaringType != null) { - if (declaringType.isRawType()) + if (declaringType.isRawType()) { throw new IllegalStateException("Use generic type, not raw type"); - if (declaringType.isParameterizedType()) + } + if (declaringType.isParameterizedType()) { throw new IllegalStateException("Use generic type, not parameterized type"); + } } // boolean aChangeOccurred = false; // @@ -100,9 +104,12 @@ public abstract class ResolvedTypeMunger { // } public boolean matches(ResolvedType matchType, ResolvedType aspectType) { - ResolvedType onType = matchType.getWorld().resolve(signature.getDeclaringType()); - if (onType.isRawType()) - onType = onType.getGenericType(); + if (onType == null) { + onType = matchType.getWorld().resolve(signature.getDeclaringType()); + if (onType.isRawType()) { + onType = onType.getGenericType(); + } + } // System.err.println("matching: " + this + " to " + matchType + " onType = " + onType); if (matchType.equals(onType)) { if (!onType.isExposedToWeaver()) { @@ -160,8 +167,9 @@ public abstract class ResolvedTypeMunger { protected static Set<ResolvedMember> readSuperMethodsCalled(VersionedDataInputStream s) throws IOException { Set<ResolvedMember> ret = new HashSet<ResolvedMember>(); int n = s.readInt(); - if (n < 0) + if (n < 0) { throw new BCException("Problem deserializing type munger"); + } for (int i = 0; i < n; i++) { ret.add(ResolvedMemberImpl.readResolvedMember(s, null)); } @@ -187,8 +195,9 @@ public abstract class ResolvedTypeMunger { protected static ISourceLocation readSourceLocation(VersionedDataInputStream s) throws IOException { // Location persistence for type mungers was added after 1.2.1 was shipped... - if (s.getMajorVersion() < AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) + if (s.getMajorVersion() < AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) { return null; + } SourceLocation ret = null; ObjectInputStream ois = null; try { @@ -213,8 +222,9 @@ public abstract class ResolvedTypeMunger { return null; } catch (ClassNotFoundException e) { } finally { - if (ois != null) + if (ois != null) { ois.close(); + } } return ret; } |