]> source.dussan.org Git - aspectj.git/commitdiff
231396: Comment #4: Big Refactoring
authoraclement <aclement>
Wed, 28 May 2008 23:53:31 +0000 (23:53 +0000)
committeraclement <aclement>
Wed, 28 May 2008 23:53:31 +0000 (23:53 +0000)
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java

index 3dd07c694236c94cc6831f1e7e32883e6373e90e..3dd748a7bd99b57c0d84748468d2d46c1591f591 100644 (file)
@@ -146,12 +146,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
         
         bcelWorld = new LTWWorld(
                        classLoader, weavingContext, // TODO when the world works in terms of the context, we can remove the loader...
-                       getMessageHandler(), new ICrossReferenceHandler() {
-                    public void addCrossReference(ISourceLocation from, ISourceLocation to, IRelationship.Kind kind, boolean runtimeTest) {
-                        ;// for tools only
-                    }
-                }
-        );
+                       getMessageHandler(), null);
 
         weaver = new BcelWeaver(bcelWorld);
 
index 89dc420fb79dfcee8b372bf41b624e23d2d0b479..08f52664d63bb45bf0160b07ec28a756b6b5a2bd 100644 (file)
@@ -13,14 +13,14 @@ package org.aspectj.weaver.loadtime;
 
 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.generic.InstructionConstants;
 import org.aspectj.apache.bcel.generic.InstructionList;
 import org.aspectj.apache.bcel.generic.ObjectType;
 import org.aspectj.apache.bcel.generic.Type;
-import org.aspectj.apache.bcel.generic.annotation.AnnotationGen;
-import org.aspectj.apache.bcel.generic.annotation.ElementNameValuePairGen;
-import org.aspectj.apache.bcel.generic.annotation.ElementValueGen;
-import org.aspectj.apache.bcel.generic.annotation.SimpleElementValueGen;
 import org.aspectj.bridge.IMessage;
 import org.aspectj.bridge.Message;
 import org.aspectj.weaver.AnnotationX;
@@ -303,24 +303,24 @@ public class ConcreteAspectCodeGen {
                 new ObjectType("org/aspectj/lang/annotation/Aspect"),
                 Collections.EMPTY_LIST,
                 true,
-                cg.getConstantPoolGen()
+                cg.getConstantPool()
         );
-        cg.addAnnotation(ag.getAnnotation());
+        cg.addAnnotation(ag);
         if (m_concreteAspect.precedence != null) {
             SimpleElementValueGen svg = new SimpleElementValueGen(
                     ElementValueGen.STRING,
-                    cg.getConstantPoolGen(),
+                    cg.getConstantPool(),
                     m_concreteAspect.precedence
             );
             List elems = new ArrayList();
-            elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPoolGen()));
+            elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPool()));
             AnnotationGen agprec = new AnnotationGen(
                     new ObjectType("org/aspectj/lang/annotation/DeclarePrecedence"),
                     elems,
                     true,
-                    cg.getConstantPoolGen()
+                    cg.getConstantPool()
             );
-            cg.addAnnotation(agprec.getAnnotation());
+            cg.addAnnotation(agprec);
         }
 
         // default constructor
@@ -357,18 +357,18 @@ public class ConcreteAspectCodeGen {
             );
             SimpleElementValueGen svg = new SimpleElementValueGen(
                     ElementValueGen.STRING,
-                    cg.getConstantPoolGen(),
+                    cg.getConstantPool(),
                     abstractPc.expression
             );
             List elems = new ArrayList();
-            elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPoolGen()));
+            elems.add(new ElementNameValuePairGen("value", svg, cg.getConstantPool()));
             AnnotationGen mag = new AnnotationGen(
                     new ObjectType("org/aspectj/lang/annotation/Pointcut"),
                     elems,
                     true,
-                    cg.getConstantPoolGen()
+                    cg.getConstantPool()
             );
-            AnnotationX max = new AnnotationX(mag.getAnnotation(), m_world);
+            AnnotationX max = new AnnotationX(mag, m_world);
             mg.addAnnotation(max);
 
             InstructionList body = mg.getBody();