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 addition of access checks (private/static) has introduced two of bugs that result in SpecialSource only partially remapping jars, with obvious consequences.
The first bug involves the tryClimb function checking the access parameter. This parameter can be -1 if it cannot be deduced from the code (and this happens quite often). As Modifier.isPrivate and similar methods treat this as a bitmask, they all return true, thus aborting the inheritance lookup and not remapping the field or method, while in reality it should be.
The first commit solves this by skipping Modifier checks if access is equal to -1.
The second bug is caused by your reimplementation of the Remapper class. You've changed the class to pass along an access parameter to map functions, but since this introduces an API change, you've left a fallback method that just passes 0 as argument. Your use of the RemappingClassAdapter causes a problem, as your overriden methods call the superclass, which in turn call the old mapping methods. This causes the mapFieldName and mapMethodName functions to be called more often than necessary, and with invalid access information (namely, 0), which causes fields to be incorrectly renamed.
The second commit solves this by making a custom implementation of RemappingClassAdapter that extends ClassAdapter directly, but has your changes merged into it. This way, super calls ClassVisitor instead of asm's RemappingClassAdapter, solving the problems mentioned above.