]> source.dussan.org Git - aspectj.git/commitdiff
265729: fault in binary aspects for itds/decps and search for them correctly
authoraclement <aclement>
Tue, 24 Feb 2009 19:17:27 +0000 (19:17 +0000)
committeraclement <aclement>
Tue, 24 Feb 2009 19:17:27 +0000 (19:17 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java

index f27e4880660466ef7bc7fda7751c28587533d461..dd3335c4149344fb3be85362fcbc7aaf3c5207ba 100644 (file)
@@ -747,7 +747,7 @@ public class ReferenceType extends ResolvedType {
                return declares;
        }
 
-       protected Collection getTypeMungers() {
+       public Collection getTypeMungers() {
                return delegate.getTypeMungers();
        }
 
index 0479420ea0a9c93dc1f1e0c385dffb5ebda8b30d..84b58f8bc8393ca0037790ae028b9b0055a8db8f 100644 (file)
@@ -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;
        }
 
index 0c666cac887b76106f9404f6eb0f6d5318338821..43ba641d44198db2a349684e03d0b4922e41946b 100644 (file)
@@ -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() {