Skip to content
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

Access-related bugfixes. #11

Merged
merged 2 commits into from
Sep 5, 2013
Merged

Access-related bugfixes. #11

merged 2 commits into from
Sep 5, 2013

Conversation

Lrns123
Copy link
Contributor

@Lrns123 Lrns123 commented Sep 5, 2013

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.

@tonybruess
Copy link

👍 nice work

md-5 added a commit that referenced this pull request Sep 5, 2013
Access-related bugfixes.
@md-5 md-5 merged commit 5e181c8 into md-5:master Sep 5, 2013
@md-5
Copy link
Owner

md-5 commented Sep 5, 2013

I love you

@SuperSpyTX
Copy link

Lrns123 is officially King for md_5's md_5 Loves the King Day!

@tonybruess
Copy link

Does this being merged fix #3 or #5?

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.

4 participants