aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-09-30 21:43:03 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-09-30 21:43:03 +0200
commit05c97e8bfa25dd577a21b680760b2736fc541849 (patch)
treefd642f0fe9f568f6d2ed9deb2b81a5c51487ff63
parentc10b91309ecb6fe4b38e0097cd93cc124c78436c (diff)
downloadlombok-05c97e8bfa25dd577a21b680760b2736fc541849.tar.gz
lombok-05c97e8bfa25dd577a21b680760b2736fc541849.tar.bz2
lombok-05c97e8bfa25dd577a21b680760b2736fc541849.zip
bugfix for the sneakyThrows remover: In rare cases would erroneously delete an ATHROW opcode.
-rw-r--r--src/core/lombok/bytecode/SneakyThrowsRemover.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lombok/bytecode/SneakyThrowsRemover.java b/src/core/lombok/bytecode/SneakyThrowsRemover.java
index fde29924..71596f60 100644
--- a/src/core/lombok/bytecode/SneakyThrowsRemover.java
+++ b/src/core/lombok/bytecode/SneakyThrowsRemover.java
@@ -71,7 +71,7 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
return writer.toByteArray();
}
- @Override public byte[] applyTransformations(byte[] original, String className, DiagnosticsReceiver diagnostics) {
+ @Override public byte[] applyTransformations(byte[] original, String fileName, DiagnosticsReceiver diagnostics) {
if (!new ClassFileMetaData(original).usesMethod("lombok/Lombok", "sneakyThrow")) return null;
byte[] fixedByteCode = fixJSRInlining(original);
@@ -89,6 +89,7 @@ public class SneakyThrowsRemover implements PostCompilerTransformation {
}
@Override public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+ justAddedAthrow = false;
boolean hit = true;
if (hit && opcode != Opcodes.INVOKESTATIC) hit = false;
if (hit && !"sneakyThrow".equals(name)) hit = false;