From: aclement Date: Tue, 24 Feb 2009 19:17:27 +0000 (+0000) Subject: 265729: fault in binary aspects for itds/decps and search for them correctly X-Git-Tag: pre268419~86 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57d21ed5c724ff0b123aeef34875f8786cb21d36;p=aspectj.git 265729: fault in binary aspects for itds/decps and search for them correctly --- diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java index f27e48806..dd3335c41 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java @@ -747,7 +747,7 @@ public class ReferenceType extends ResolvedType { return declares; } - protected Collection getTypeMungers() { + public Collection getTypeMungers() { return delegate.getTypeMungers(); } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index 0479420ea..84b58f8bc 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -665,7 +665,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl return Collections.EMPTY_LIST; } - protected Collection getTypeMungers() { + public Collection getTypeMungers() { return Collections.EMPTY_LIST; } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java index 0c666cac8..43ba641d4 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java @@ -118,6 +118,16 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { */ protected String signature; + /** + * Calculated on first request - the package name (java.lang for type java.lang.String) + */ + private String packageName; + + /** + * Calculated on first request - the class name (String for type java.lang.String) + */ + private String className; + /** * The erasure of the signature. Contains only the Java signature of the type with all supertype, superinterface, type variable, * and parameter information removed. @@ -831,16 +841,19 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { } public String getPackageName() { - String name = getName(); - if (name.indexOf("<") != -1) { - name = name.substring(0, name.indexOf("<")); - } - int index = name.lastIndexOf('.'); - if (index == -1) { - return ""; - } else { - return name.substring(0, index); + if (packageName == null) { + String name = getName(); + if (name.indexOf("<") != -1) { + name = name.substring(0, name.indexOf("<")); + } + int index = name.lastIndexOf('.'); + if (index == -1) { + packageName = ""; + } else { + packageName = name.substring(0, index); + } } + return packageName; } public UnresolvedType[] getTypeParameters() { @@ -851,13 +864,16 @@ public class UnresolvedType implements Traceable, TypeVariableDeclaringElement { * Doesn't include the package */ public String getClassName() { - String name = getName(); - int index = name.lastIndexOf('.'); - if (index == -1) { - return name; - } else { - return name.substring(index + 1); + if (className == null) { + String name = getName(); + int index = name.lastIndexOf('.'); + if (index == -1) { + className = name; + } else { + className = name.substring(index + 1); + } } + return className; } public TypeVariable[] getTypeVariables() {