]> source.dussan.org Git - aspectj.git/commitdiff
optimization: made unpacking of the table lazy. With a minor change in AJ itself...
authoraclement <aclement>
Wed, 15 Feb 2006 09:41:19 +0000 (09:41 +0000)
committeraclement <aclement>
Wed, 15 Feb 2006 09:41:19 +0000 (09:41 +0000)
lib/bcel/bcel-src.zip
lib/bcel/bcel.jar
weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java

index 0dfc15ee91b742fe47e136927862dc7994468695..162657a4e01c1a3f7f9002d614973c9691011565 100644 (file)
Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ
index cf2a7826dac02aba13e57443ec1cd40401e3ee79..709d6194d166ccc2060f5c215b89b92fcb86e2cc 100644 (file)
Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ
index dbc48f1255f75a24c0a9d325f628a14b3e26d13c..5e3846e1a651a97e8e99dad97c57c25039e7c478 100644 (file)
@@ -33,7 +33,7 @@ import org.aspectj.bridge.ISourceLocation;
  */
 public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, AnnotatedElement, TypeVariableDeclaringElement, ResolvedMember {
     
-    public String[] parameterNames = null;
+    private String[] parameterNames = null;
     protected UnresolvedType[] checkedExceptions = UnresolvedType.NONE;
     /**
      * if this member is a parameterized version of a member in a generic type,
@@ -490,7 +490,8 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno
                return getDeclaringType().resolve(world).getSourceContext();
        }
 
-       public final String[] getParameterNames() {
+       public String[] getParameterNames() {
+               
                return parameterNames;
        }
        public final void setParameterNames(String[] pnames) {
index b54226745f8e22663020a62727b4ab1fa759160b..beef22a4d078368ced4fdf9c16d106d1c4b9c6f0 100644 (file)
@@ -81,10 +81,22 @@ final class BcelMethod extends ResolvedMemberImpl {
                        ? UnresolvedType.NONE
                        : UnresolvedType.forNames(exnTable.getExceptionNames());
                        
+       }
+       
+       public String[] getParameterNames() {
+               determineParameterNames();
+               return super.getParameterNames();
+       }
+
+       private boolean parameterNamesInitialized = false;
+       
+       public void determineParameterNames() {
+               if (parameterNamesInitialized) return;
+               parameterNamesInitialized=true;
                LocalVariableTable varTable = method.getLocalVariableTable();
                int len = getArity();
                if (varTable == null) {
-                       this.parameterNames = Utility.makeArgNames(len);
+                       setParameterNames(Utility.makeArgNames(len));
                } else {
                        UnresolvedType[] paramTypes = getParameterTypes();
                        String[] paramNames = new String[len];
@@ -98,7 +110,7 @@ final class BcelMethod extends ResolvedMemberImpl {
                                }
                                index += paramTypes[i].getSize();
                        }
-                       this.parameterNames = paramNames;
+                       setParameterNames(paramNames);
                }
        }
 
index 2ec5740d485303ad396e3a5eb95aba56ab3e6848..a5dd6091065bc1e62f58577757e1635d09983aed 100644 (file)
@@ -530,7 +530,7 @@ public class BcelShadow extends Shadow {
                UnresolvedType inType = enclosingMethod.getEnclosingClass().getType();
                
                ResolvedMemberImpl sig = MemberImpl.makeExceptionHandlerSignature(inType, catchType);                                   
-               sig.parameterNames = new String[] {findHandlerParamName(startOfHandler)};
+               sig.setParameterNames(new String[] {findHandlerParamName(startOfHandler)});
                
         BcelShadow s =
             new BcelShadow(