aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2012-01-09 23:47:45 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2012-01-09 23:47:45 +0100
commita59a2c482b504a47a84b72313acfee361c516dbf (patch)
tree27a6232e252c508b79b18f2c32ac7006f541a486 /src
parent2ddf708b37f32e5c618927dd3e7dc8ac0e2e18d4 (diff)
downloadlombok-a59a2c482b504a47a84b72313acfee361c516dbf.tar.gz
lombok-a59a2c482b504a47a84b72313acfee361c516dbf.tar.bz2
lombok-a59a2c482b504a47a84b72313acfee361c516dbf.zip
Updated to ASM4 final.
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/bytecode/AsmUtil.java6
-rw-r--r--src/core/lombok/bytecode/PreventNullAnalysisRemover.java11
-rw-r--r--src/core/lombok/bytecode/SneakyThrowsRemover.java13
3 files changed, 14 insertions, 16 deletions
diff --git a/src/core/lombok/bytecode/AsmUtil.java b/src/core/lombok/bytecode/AsmUtil.java
index 57439c75..b0606a18 100644
--- a/src/core/lombok/bytecode/AsmUtil.java
+++ b/src/core/lombok/bytecode/AsmUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Project Lombok Authors.
+ * Copyright (C) 2010-2012 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,11 +21,11 @@
*/
package lombok.bytecode;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.commons.JSRInlinerAdapter;
class AsmUtil {
@@ -38,7 +38,7 @@ class AsmUtil {
ClassReader reader = new ClassReader(byteCode);
ClassWriter writer = new FixedClassWriter(reader, 0);
- ClassVisitor visitor = new ClassAdapter(writer) {
+ ClassVisitor visitor = new ClassVisitor(Opcodes.ASM4, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);
}
diff --git a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
index cee6b24d..5c1bf124 100644
--- a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
+++ b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Project Lombok Authors.
+ * Copyright (C) 2010-2012 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -29,10 +29,9 @@ import lombok.core.DiagnosticsReceiver;
import lombok.core.PostCompilerTransformation;
import org.mangosdk.spi.ProviderFor;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
@@ -49,9 +48,9 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation {
final AtomicBoolean changesMade = new AtomicBoolean();
- class PreventNullanalysisVisitor extends MethodAdapter {
+ class PreventNullanalysisVisitor extends MethodVisitor {
PreventNullanalysisVisitor(MethodVisitor mv) {
- super(mv);
+ super(Opcodes.ASM4, mv);
}
@Override public void visitMethodInsn(int opcode, String owner, String name, String desc) {
@@ -68,7 +67,7 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation {
}
}
- reader.accept(new ClassAdapter(writer) {
+ reader.accept(new ClassVisitor(Opcodes.ASM4, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new PreventNullanalysisVisitor(super.visitMethod(access, name, desc, signature, exceptions));
}
diff --git a/src/core/lombok/bytecode/SneakyThrowsRemover.java b/src/core/lombok/bytecode/SneakyThrowsRemover.java
index 95fc1679..c5d46496 100644
--- a/src/core/lombok/bytecode/SneakyThrowsRemover.java
+++ b/src/core/lombok/bytecode/SneakyThrowsRemover.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Project Lombok Authors.
+ * Copyright (C) 2010-2012 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,7 @@
*/
package lombok.bytecode;
-import static lombok.bytecode.AsmUtil.*;
+import static lombok.bytecode.AsmUtil.fixJSRInlining;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -31,11 +31,10 @@ import lombok.core.PostCompilerTransformation;
import org.mangosdk.spi.ProviderFor;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
@@ -52,11 +51,11 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
final AtomicBoolean changesMade = new AtomicBoolean();
- class SneakyThrowsRemoverVisitor extends MethodAdapter {
+ class SneakyThrowsRemoverVisitor extends MethodVisitor {
boolean justAddedAthrow = false;
SneakyThrowsRemoverVisitor(MethodVisitor mv) {
- super(mv);
+ super(Opcodes.ASM4, mv);
}
@Override public void visitMethodInsn(int opcode, String owner, String name, String desc) {
@@ -168,7 +167,7 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
}
}
- reader.accept(new ClassAdapter(writer) {
+ reader.accept(new ClassVisitor(Opcodes.ASM4, writer) {
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
return new SneakyThrowsRemoverVisitor(super.visitMethod(access, name, desc, signature, exceptions));
}