]> source.dussan.org Git - aspectj.git/commitdiff
refactoring
authoraclement <aclement>
Tue, 15 Sep 2009 19:39:44 +0000 (19:39 +0000)
committeraclement <aclement>
Tue, 15 Sep 2009 19:39:44 +0000 (19:39 +0000)
loadtime/.isJava5 [new file with mode: 0644]
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java

diff --git a/loadtime/.isJava5 b/loadtime/.isJava5
new file mode 100644 (file)
index 0000000..136d063
--- /dev/null
@@ -0,0 +1 @@
+  
\ No newline at end of file
index b4824c83cf74feca2a2bb5f99eec11170f0ddb69..edc1e2b251a1875ebb09ea6339d36c5a2def0787 100644 (file)
@@ -400,6 +400,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                kind.signal(infos, null, null);
        }
 
+       @Override
        public String getContextId() {
                return weavingContext.getId();
        }
@@ -448,8 +449,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                // exclude if in any of the exclude list - note that the user defined name matters for that to happen
                for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
                        Definition definition = (Definition) iterator.next();
-                       for (Iterator aspects = definition.getConcreteAspects().iterator(); aspects.hasNext();) {
-                               Definition.ConcreteAspect concreteAspect = (Definition.ConcreteAspect) aspects.next();
+                       for (Definition.ConcreteAspect concreteAspect : definition.getConcreteAspects()) {
                                if (acceptAspect(concreteAspect.name)) {
                                        info("define aspect " + concreteAspect.name);
                                        ConcreteAspectCodeGen gen = new ConcreteAspectCodeGen(concreteAspect, weaver.getWorld());
@@ -600,6 +600,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                }
        }
 
+       @Override
        protected boolean accept(String className, byte[] bytes) {
                // avoid ResolvedType if not needed
                if (m_excludeTypePattern.isEmpty() && m_includeTypePattern.isEmpty()) {
@@ -708,6 +709,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                return accept;
        }
 
+       @Override
        protected boolean shouldDump(String className, boolean before) {
                // Don't dump before weaving unless asked to
                if (before && !m_dumpBefore) {
@@ -732,6 +734,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
                return false;
        }
 
+       @Override
        protected String getDumpDir() {
                if (dumpDirPerClassloader) {
                        StringBuffer dir = new StringBuffer();
index e58ecae6ff17751ee3316728bf2f2336d52fc234..18176f0e2b6bd62a05bb427e715019cf750f0d33 100644 (file)
@@ -23,9 +23,9 @@ import java.util.Map;
 import org.aspectj.apache.bcel.Constants;
 import org.aspectj.apache.bcel.classfile.JavaClass;
 import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
-import org.aspectj.apache.bcel.classfile.annotation.ElementNameValuePairGen;
-import org.aspectj.apache.bcel.classfile.annotation.ElementValueGen;
-import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValueGen;
+import org.aspectj.apache.bcel.classfile.annotation.ElementValue;
+import org.aspectj.apache.bcel.classfile.annotation.NameValuePair;
+import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValue;
 import org.aspectj.apache.bcel.generic.InstructionConstants;
 import org.aspectj.apache.bcel.generic.InstructionList;
 import org.aspectj.apache.bcel.generic.ObjectType;
@@ -51,10 +51,9 @@ import org.aspectj.weaver.patterns.PerSingleton;
 /**
  * Generates bytecode for concrete-aspect.
  * <p>
- * The concrete aspect is @AspectJ code generated. As it is build during aop.xml
- * definitions registration we perform the type munging for perclause, ie.
- * aspectOf() artifact directly, instead of waiting for it to go thru the weaver
- * (that we are in the middle of configuring).
+ * The concrete aspect is @AspectJ code generated. As it is build during aop.xml definitions registration we perform the type
+ * munging for perclause, ie. aspectOf() artifact directly, instead of waiting for it to go thru the weaver (that we are in the
+ * middle of configuring).
  * 
  * @author Alexandre Vasseur
  * @author Andy Clement
@@ -293,8 +292,7 @@ public class ConcreteAspectCodeGen {
        }
 
        /**
-        * Rebuild the XML snip that defines this concrete aspect, for log error
-        * purpose
+        * Rebuild the XML snip that defines this concrete aspect, for log error purpose
         * 
         * @return string repr.
         */
@@ -388,17 +386,16 @@ public class ConcreteAspectCodeGen {
                } else {
                        // List elems = new ArrayList();
                        List elems = new ArrayList();
-                       elems.add(new ElementNameValuePairGen("value", new SimpleElementValueGen(ElementValueGen.STRING, cg.getConstantPool(),
-                                       perclauseString), cg.getConstantPool()));
+                       elems.add(new NameValuePair("value",
+                                       new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), perclauseString), cg.getConstantPool()));
                        AnnotationGen ag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Aspect"), elems, true, cg
                                        .getConstantPool());
                        cg.addAnnotation(ag);
                }
                if (concreteAspect.precedence != null) {
-                       SimpleElementValueGen svg = new SimpleElementValueGen(ElementValueGen.STRING, cg.getConstantPool(),
-                                       concreteAspect.precedence);
+                       SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), concreteAspect.precedence);
                        List elems = new ArrayList();
-                       elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPool()));
+                       elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                        AnnotationGen agprec = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/DeclarePrecedence"), elems, true,
                                        cg.getConstantPool());
                        cg.addAnnotation(agprec);
@@ -417,10 +414,9 @@ public class ConcreteAspectCodeGen {
                        Definition.Pointcut abstractPc = (Definition.Pointcut) it.next();
                        // TODO AV - respect visibility instead of opening up as public?
                        LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC, Type.VOID, abstractPc.name, EMPTY_TYPES, EMPTY_STRINGS, cg);
-                       SimpleElementValueGen svg = new SimpleElementValueGen(ElementValueGen.STRING, cg.getConstantPool(),
-                                       abstractPc.expression);
+                       SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), abstractPc.expression);
                        List elems = new ArrayList();
-                       elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPool()));
+                       elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
                        AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Pointcut"), elems, true, cg
                                        .getConstantPool());
                        AnnotationAJ max = new BcelAnnotation(mag, world);