]> source.dussan.org Git - aspectj.git/commitdiff
minor optimization
authoraclement <aclement>
Wed, 4 Mar 2009 00:51:33 +0000 (00:51 +0000)
committeraclement <aclement>
Wed, 4 Mar 2009 00:51:33 +0000 (00:51 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelMethod.java

index cec13d23d6bf94ca90c10231df08b55c21b8e2b3..2b07291fdab900e578e9663eae3299725e123173 100644 (file)
@@ -133,28 +133,30 @@ class BcelMethod extends ResolvedMemberImpl {
                                for (int i = 0; i < axs.length; i++) {
                                        AnnotationAJ annotationX = axs[i];
                                        String typename = annotationX.getTypeName();
-                                       if (typename.equals("org.aspectj.lang.annotation.Pointcut")
-                                                       || typename.equals("org.aspectj.lang.annotation.Before")
-                                                       || typename.equals("org.aspectj.lang.annotation.Around")
-                                                       || typename.startsWith("org.aspectj.lang.annotation.After")) {
-                                               AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
-                                               if (a != null) {
-                                                       List values = a.getValues();
-                                                       for (Iterator iterator = values.iterator(); iterator.hasNext();) {
-                                                               ElementNameValuePairGen nvPair = (ElementNameValuePairGen) iterator.next();
-                                                               if (nvPair.getNameString().equals("argNames")) {
-                                                                       String argNames = nvPair.getValue().stringifyValue();
-                                                                       StringTokenizer argNameTokenizer = new StringTokenizer(argNames, " ,");
-                                                                       List argsList = new ArrayList();
-                                                                       while (argNameTokenizer.hasMoreTokens()) {
-                                                                               argsList.add(argNameTokenizer.nextToken());
+                                       if (typename.charAt(0) == 'o') {
+                                               if (typename.equals("org.aspectj.lang.annotation.Pointcut")
+                                                               || typename.equals("org.aspectj.lang.annotation.Before")
+                                                               || typename.equals("org.aspectj.lang.annotation.Around")
+                                                               || typename.startsWith("org.aspectj.lang.annotation.After")) {
+                                                       AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
+                                                       if (a != null) {
+                                                               List values = a.getValues();
+                                                               for (Iterator iterator = values.iterator(); iterator.hasNext();) {
+                                                                       ElementNameValuePairGen nvPair = (ElementNameValuePairGen) iterator.next();
+                                                                       if (nvPair.getNameString().equals("argNames")) {
+                                                                               String argNames = nvPair.getValue().stringifyValue();
+                                                                               StringTokenizer argNameTokenizer = new StringTokenizer(argNames, " ,");
+                                                                               List argsList = new ArrayList();
+                                                                               while (argNameTokenizer.hasMoreTokens()) {
+                                                                                       argsList.add(argNameTokenizer.nextToken());
+                                                                               }
+                                                                               int requiredCount = getParameterTypes().length;
+                                                                               while (argsList.size() < requiredCount) {
+                                                                                       argsList.add("arg" + argsList.size());
+                                                                               }
+                                                                               setParameterNames((String[]) argsList.toArray(new String[] {}));
+                                                                               return;
                                                                        }
-                                                                       int requiredCount = getParameterTypes().length;
-                                                                       while (argsList.size() < requiredCount) {
-                                                                               argsList.add("arg" + argsList.size());
-                                                                       }
-                                                                       setParameterNames((String[]) argsList.toArray(new String[] {}));
-                                                                       return;
                                                                }
                                                        }
                                                }
@@ -259,10 +261,7 @@ class BcelMethod extends ResolvedMemberImpl {
        }
 
        public boolean isAjSynthetic() {
-               return (bitflags & IS_AJ_SYNTHETIC) != 0;// isAjSynthetic; // ||
-               // getName(
-               // ).startsWith(NameMangler
-               // .PREFIX);
+               return (bitflags & IS_AJ_SYNTHETIC) != 0;
        }
 
        // FIXME ??? needs an isSynthetic method