-
Notifications
You must be signed in to change notification settings - Fork 213
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
Decompiler cache causes suboptimal results when reused #1117
Comments
Humm, intresting. I can see that being an issue, the easy fix for this is to not share the caches between diffrent versions. Or take into account the entire class hierarchy when calcuating the cache key. 🤔 |
Just tested it with access wideners, and it seems to be an issue there as well :/ |
Not sharing cache between versions would be a huge bummer. A lot of the times there a loads of cache hits as you probably know. |
Updated the title and description to better suite the scope of the issue. I'd also post actual examples, but not sure if that's a great idea. |
@modmuss50 Thanks so much for the fix! All of the defects seem to be gone, except for the one with the weird imports for inner classes(sometimes they are imported explicitly, other times referenced by their fully qualified name). It's not a big deal but it'd be nice if it could be mitigated. |
Are you seeing this when switching between MC versions or when enabling/disabling AWs? |
I tested the former. Let me also try the latter... |
Ok, thanks. Ill take another look. Ill re-open the issue so I dont forget 👍 |
When the decompiler cache gets reused weird changes occur, which aren't present when generating the sources without using the cache.
This seems to happen when a big amount of cache hits are present, as is the case between two versions of the game that are adjacent in time, and when adding/removing an access widener entry. In the first case it pollutes the diff quite a lot, and reduces readability in both cases.
Steps to reproduce
gradlew genSourcesWithVineflower --use-cache
gradlew genSourcesWithVineflower --no-use-cache
@Override
annotations, unnecessary casts, missing generics, and so on).PS: This also applies to the CFR decompiler. Haven't tested FernFlower.
The text was updated successfully, but these errors were encountered: