mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-21 16:25:57 +00:00
Fix removal of SneakyThrows and PreventNullAnalysis from bytecode
The SneakyThrowsRemover and PreventNullAnalysisRemover were leaving traces of the calls to lombok.Lombok.sneakyThrow and lombok.Lombok.preventNullAnalysis behind because they were using a constructor of ClassWriter which reuses the constant pool of the original class for performance optimizations. So although the calls to sneakyThrows and preventNullAnalysis get removed from the methods there were still entries in the constant pool for them. The constant pool will be regenerated with this change so that the entries for sneakyThrows and preventNullAnalysis gets removed.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
public class PostCompilePreventNullAnalysis {
|
||||
public void test() {
|
||||
Object o = "Hello World!";
|
||||
try {
|
||||
System.out.println(o);
|
||||
} finally {
|
||||
if (o != null) {
|
||||
if (lombok.Lombok.preventNullAnalysis(o) != null) {
|
||||
o.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user