Add verbose mode to RemappedRuntimeInheritanceProvider

This commit is contained in:
Agaricus 2013-01-26 01:16:51 -08:00
parent 89c00557a7
commit 718ffc8bb5
2 changed files with 15 additions and 3 deletions

View File

@ -33,15 +33,27 @@ public class RemappedRuntimeInheritanceProvider extends RuntimeInheritanceProvid
// Remap the input (example: cb -> obf)
String after = JarRemapper.mapTypeName(before, jarMapping.packages, jarMapping.classes);
if (verbose) {
System.out.println("RemappedRuntimeInheritanceProvider getParents "+before+" -> "+after);
}
List<String> beforeParents = super.getParents(after);
if (beforeParents == null) {
if (verbose) {
System.out.println("- none");
}
return null;
}
// Un-remap the output (example: obf -> cb)
List<String> afterParents = new ArrayList<String>();
for (String beforeParent : beforeParents) {
afterParents.add(JarRemapper.mapTypeName(beforeParent, inverseJarMapping.packages, inverseJarMapping.classes));
String afterParent = JarRemapper.mapTypeName(beforeParent, inverseJarMapping.packages, inverseJarMapping.classes);
if (verbose) {
System.out.println("- " + beforeParent + " -> " + afterParent);
}
afterParents.add(afterParent);
}
return afterParents;

View File

@ -35,8 +35,8 @@ import java.util.ArrayList;
* Lookup class inheritance from classes loaded at runtime.
*/
public class RuntimeInheritanceProvider implements IInheritanceProvider {
private final ClassLoader classLoader;
private final boolean verbose;
protected final ClassLoader classLoader;
protected final boolean verbose;
public RuntimeInheritanceProvider(ClassLoader classLoader, boolean verbose) {
this.classLoader = classLoader;