Fix removal of SneakyThrows and PreventNullAnalysis from bytecode #3602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Relevant javadoc of the ClassWriter contructor: https://asm.ow2.io/javadoc/org/objectweb/asm/ClassWriter.html#%3Cinit%3E(org.objectweb.asm.ClassReader,int)
Fixes #3601