diff options
author | aclement <aclement> | 2009-09-15 19:39:44 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-09-15 19:39:44 +0000 |
commit | 23357ade788be1f2231b17a934e97a7b340ae697 (patch) | |
tree | 327e64cf495bdbabec40c7d9d9a10f564757f23d /loadtime | |
parent | f78041b18d297d23b5a7f1ada3d8226ad1c45fa3 (diff) | |
download | aspectj-23357ade788be1f2231b17a934e97a7b340ae697.tar.gz aspectj-23357ade788be1f2231b17a934e97a7b340ae697.zip |
refactoring
Diffstat (limited to 'loadtime')
-rw-r--r-- | loadtime/.isJava5 | 1 | ||||
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java | 7 | ||||
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java | 30 |
3 files changed, 19 insertions, 19 deletions
diff --git a/loadtime/.isJava5 b/loadtime/.isJava5 new file mode 100644 index 000000000..136d06384 --- /dev/null +++ b/loadtime/.isJava5 @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index b4824c83c..edc1e2b25 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -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(); diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java index e58ecae6f..18176f0e2 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java @@ -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); |