mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 22:16:11 +00:00
bugfix for the sneakyThrows remover: In rare cases would erroneously delete an ATHROW opcode.
This commit is contained in:
1 parent
c10b91309e
commit
05c97e8bfa
1 file changed
+2
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user