<classpathentry kind="lib" path="/lib/commons/commons.jar" sourcepath="/lib/commons/commons-src.zip"/> | <classpathentry kind="lib" path="/lib/commons/commons.jar" sourcepath="/lib/commons/commons-src.zip"/> | ||||
<classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/> | <classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/> | ||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||||
<classpathentry kind="lib" path="/lib/asm/asm-3.1.jar"/> | |||||
<classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/> | <classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/> | ||||
<classpathentry kind="lib" path="/lib/asm/asm-3.3.1.renamed.jar"/> | |||||
<classpathentry kind="output" path="bin"/> | <classpathentry kind="output" path="bin"/> | ||||
</classpath> | </classpath> |
writeBack(world); | writeBack(world); | ||||
byte[] wovenClassFileData = myGen.getJavaClass().getBytes(); | byte[] wovenClassFileData = myGen.getJavaClass().getBytes(); | ||||
// if is java 6 class file | // if is java 6 class file | ||||
if (myGen.getMajor() >= Constants.MAJOR_1_6 && world.shouldGenerateStackMaps() && AsmDetector.isAsmAround) { | |||||
if (((myGen.getMajor() == Constants.MAJOR_1_6 && world.shouldGenerateStackMaps()) || myGen.getMajor() > Constants.MAJOR_1_6) | |||||
&& AsmDetector.isAsmAround) { | |||||
wovenClassFileData = StackMapAdder.addStackMaps(world, wovenClassFileData); | wovenClassFileData = StackMapAdder.addStackMaps(world, wovenClassFileData); | ||||
} | } | ||||
WeaverStateInfo wsi = myType.getWeaverState();// getOrCreateWeaverStateInfo | |||||
// (); | |||||
WeaverStateInfo wsi = myType.getWeaverState();// getOrCreateWeaverStateInfo(); | |||||
if (wsi != null && wsi.isReweavable()) { // && !reweavableDataInserted | if (wsi != null && wsi.isReweavable()) { // && !reweavableDataInserted | ||||
// reweavableDataInserted = true; | // reweavableDataInserted = true; | ||||
return wsi.replaceKeyWithDiff(wovenClassFileData); | return wsi.replaceKeyWithDiff(wovenClassFileData); |
static { | static { | ||||
try { | try { | ||||
Class reader = Class.forName("org.objectweb.asm.ClassReader"); | |||||
Class visitor = Class.forName("org.objectweb.asm.ClassVisitor"); | |||||
Class<?> reader = Class.forName("aj.org.objectweb.asm.ClassReader"); | |||||
Class<?> visitor = Class.forName("aj.org.objectweb.asm.ClassVisitor"); | |||||
Method m = reader.getMethod("accept", new Class[] { visitor, Integer.TYPE }); | Method m = reader.getMethod("accept", new Class[] { visitor, Integer.TYPE }); | ||||
isAsmAround = m != null; | isAsmAround = m != null; | ||||
} catch (Exception e) { | } catch (Exception e) { |
import org.aspectj.weaver.ResolvedType; | import org.aspectj.weaver.ResolvedType; | ||||
import org.aspectj.weaver.UnresolvedType; | import org.aspectj.weaver.UnresolvedType; | ||||
import org.aspectj.weaver.World; | import org.aspectj.weaver.World; | ||||
import org.objectweb.asm.ClassReader; | |||||
import org.objectweb.asm.ClassWriter; | |||||
import aj.org.objectweb.asm.ClassReader; | |||||
import aj.org.objectweb.asm.ClassWriter; | |||||
/** | /** | ||||
* Uses asm to add the stack map attribute to methods in a class. The class is passed in as pure byte data and then a reader/writer | * Uses asm to add the stack map attribute to methods in a class. The class is passed in as pure byte data and then a reader/writer |