-
Notifications
You must be signed in to change notification settings - Fork 44
improve decompilation experience #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve decompilation experience #418
Conversation
Commits best reviewed in isolation. I'm not sure about the last commit, actually. It imposes an artificial restriction on generating lambdas so that the behavior is consistent between the default and debug mode. I tried to find a way to allow defining parameters before captures in the debug mode, but failed, and this extra restriction isn't terribly bad, so I felt I'll just submit this and see what you think. |
02131c5
to
694c3a8
Compare
This is to workaround the IntelliJ IDEA decompiler (FernFlower) deficiency where it ignores all synthetic members of decompiled classes. Since we used to mark all members as synthetic, a decompiled class would be just empty, which is certainly not good. We still mark the generated classes/interfaces as synthetic, which should be good enough of a marker to everyone that all members are also synthetic.
This is in inticipation of another change: in the debugging mode, we'll generate lambdas that use the classic `LambdaMetafactory` translation strategy instead of our custom one. Our custom strategy cannot pass through decompilation, which is not good.
694c3a8
to
8169f98
Compare
Previously, the counter was present in `BlockCreatorImpl` and so was unique for each block. This is not necessarily correct; it is possible for one method to have multiple blocks and each of those blocks to generate an anonymous class. With this commit, the counter is present in `TypeCreatorImpl` and so is unique to each generated type. This is always correct.
This is (likely) slower and bigger than our custom translation strategy, but is supported by decompilers (at least by FernFlower), so it should be used in the debug mode. The following limitations exist: - serializable lambdas are not supported yet (but they are not supported by our custom translation strategy either) - captures must be defined first, before parameters
This is to unify the behavior in the standard ("release") mode and debug mode when it comes to lambdas. Our custom translation strategy doesn't care about ordering between defining captures and parameters, but the standard one (based on `LambdaMetafactory`) does, so this restriction brings them both on par.
8169f98
to
93b6e3a
Compare
Fixes #416