Open VelizarBG opened 5 months ago
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 :/ Though, quite importantly, the defects only happen in the classes that the cache misses.
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. 🤔
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.
@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... Yep, it's an issue there as well.
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.