Skip to content

Conversation

@zml2008
Copy link
Collaborator

@zml2008 zml2008 commented May 25, 2021

With 21w19a, Mojang changed a lot of their build toolchain around. This PR aims to patch up the decompiler for some of the bytecode changes that resulted.

Objects.requireNonNull

This is the simplest change -- javac generates nullness checks a bit differently. FF is patched to support both the old .getClass() and new Objects.requireNonNull() variants.

Inner classes

It appears that a lot of inner classes have gained a Signature attribute, which causes generic signature processing to activate. This exposed some issues in its handling of synthetic constructor parameters, which I think I've taken care of enough to correctly

(not sure how these changes would react if someone disabled enum handling though)

Visibility changes

There have been broad changes to field and method visibility anywhere inner classes are involved, which appears to be done by a tool that results in inconsistent inner class attributes. I've added an option to suppress that warning, -win=0

try-with-resources (not done yet)

looks like FF isn't collapsing finally blocks properly -- there are a bunch of changes to exception ranges in the bytecode that may be related, haven't looked too much

nextGaussian (not done yet)

#89, will look at applying the proposed fix more properly


I've tested this based off of diffs of 21w19a -- once I make it through the list of issues above I'll do a more thorough comparison on 1.16.5 to ensure nothing regressed on that end.

cc @SuperCoder7979 who I discussed a lot of this with

zml2008 added 3 commits May 13, 2021 22:06
Add more debug logging in prep for further work
Mojang has messed up metadata in recent MC versions, so we expect these warnings
@kashike
Copy link
Contributor

kashike commented May 25, 2021

Please include a diff to show what changes during a decompile with these changes.

@zml2008
Copy link
Collaborator Author

zml2008 commented May 25, 2021

will do once i get through the list, this PR is mostly for tracking purposes.

a 21w19a old -> 21w19a new diff would be super noisy anyways, due to the sheer number of decompile errors. i intend to do before -> after on both 1.16.5 and 21w19a once my work is wrapped up here though.

ideally someone with more free time in their life would take a stab at updating mcpconfig to the latest snapshot and seeing what sort of issues they run into with this PR when I finish my list -- i don't have the time for that though.

@LexManos
Copy link
Member

LexManos commented May 25, 2021

Tho these are all rather needed fixes, I would prefer them all to be seperate PRs and contain the isolated diffs. For both documentation and simplicities sake. Some of these are JDK related changes, be them simple Objects.requireNotNull. Or the more complex access/nest changes. That one will be a bit more complex to support and should be addressed carefully.

No idea about the inner class signature thing, haven't looked into it.

@zml2008
Copy link
Collaborator Author

zml2008 commented Mar 24, 2022

No longer relevant really

@zml2008 zml2008 closed this Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants