Building Lambda and a Closure Question
Rémi Forax
forax at univ-mlv.fr
Sun Nov 20 11:26:47 PST 2011
On 11/20/2011 07:13 PM, Mike Duigou wrote:
> On Nov 20 2011, at 09:33 , David Harrigan wrote:
>
>> Hi,
>>
>> A new user :-) (well, at least to jdk8).
> Welcome!
>
>
>> My first question is:
>>
>> Is the reference to asm-all-4.0 in build.xml in defender-prototype
>> really a reference to asm-all-3.3.1 but symlinked to asm-all-4.0?
> The defender prototype was developed against ASM 4.0 RC1 which does have the missing classes that later builds lack.
>
> The prototype hasn't been updated to use the ASM 4.0 final yet. As a temporary component it's possible that it might not be updated (patches welcome of course) to use current versions of ASM.
Here is the patch you ask :)
Rémi
diff --git a/src/jsr335/agent/MappingVisitor.java
b/src/jsr335/agent/MappingVisitor.java
--- a/src/jsr335/agent/MappingVisitor.java
+++ b/src/jsr335/agent/MappingVisitor.java
@@ -28,10 +28,10 @@
import java.util.ArrayList;
import java.util.List;
import org.objectweb.asm.Attribute;
-import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* Collect information about an interface/class, particularly its
default methods.
@@ -39,7 +39,7 @@
* @author Brian Goetz
* @author Robert Field
*/
-public class MappingVisitor extends EmptyVisitor {
+public class MappingVisitor extends ClassVisitor {
private final ClassLoader classLoader;
@@ -48,6 +48,7 @@
private String className;
public MappingVisitor(final ClassLoader classLoader) {
+ super(Opcodes.ASM4);
this.classLoader = classLoader;
}
@@ -77,7 +78,7 @@
final RawMethod method = new RawMethod(cm, methodName,
methodSignature, genericSignature, access, exceptions);
methods.add(method);
if (cm.isInterface()) {
- return new MethodAdapter(super.visitMethod(access,
methodName, methodSignature, genericSignature, exceptions)) {
+ return new MethodVisitor(Opcodes.ASM4,
super.visitMethod(access, methodName, methodSignature, genericSignature,
exceptions)) {
@Override
public void visitAttribute(Attribute attr) {
diff --git a/src/jsr335/agent/WeaveClassVisitor.java
b/src/jsr335/agent/WeaveClassVisitor.java
--- a/src/jsr335/agent/WeaveClassVisitor.java
+++ b/src/jsr335/agent/WeaveClassVisitor.java
@@ -30,7 +30,6 @@
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Type;
@@ -44,7 +43,7 @@
* @author Brian Goetz
* @author Robert Field
*/
-public class WeaveClassVisitor extends ClassAdapter {
+public class WeaveClassVisitor extends ClassVisitor {
private static final String WEAVE_FAILURE_ANNOTATION =
"Ljsr335/agent/runtime/WeaveFailure;";
private static final String WOVEN_ANNOTATION =
"Ljsr335/agent/runtime/Woven;";
@@ -52,7 +51,7 @@
private final ClassModel cm;
public WeaveClassVisitor(ClassVisitor cv, Collection<Weave>
weaves, ClassModel cm) {
- super(cv);
+ super(Opcodes.ASM4, cv);
this.weaves = weaves;
this.cm = cm;
}
More information about the lambda-dev
mailing list