md-5/SpecialSource — pull request #11 by Lrns123 (2013-09-05 17:45:43+00:00)
Title: Access-related bugfixes.

The addition of access checks (private/static) have introduced a 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.