Fix incomplete shade relocation of .srg files

.csrg OK
This commit is contained in:
Agaricus 2013-02-20 20:39:54 -08:00
parent f643febd34
commit 7ab477500c

View File

@ -269,17 +269,17 @@ public class JarMapping {
" -> " + newFull + " in line="+line); " -> " + newFull + " in line="+line);
} }
String oldClassName = oldFull.substring(0, splitOld); String oldClassName = inputTransformer.transformClassName(oldFull.substring(0, splitOld));
String oldFieldName = oldFull.substring(splitOld + 1); String oldFieldName = oldFull.substring(splitOld + 1);
String newClassName = newFull.substring(0, splitNew); //String newClassName = newFull.substring(0, splitNew); // redundant and ignored
String newFieldName = newFull.substring(splitNew + 1); String newFieldName = newFull.substring(splitNew + 1);
fields.put(oldClassName + "/" + oldFieldName, newFieldName); fields.put(oldClassName + "/" + oldFieldName, newFieldName);
} else if (kind.equals("MD:")) { } else if (kind.equals("MD:")) {
String oldFull = tokens[1]; String oldFull = tokens[1];
String oldMethodDescriptor = tokens[2]; String oldMethodDescriptor = inputTransformer.transformMethodDescriptor(tokens[2]);
String newFull = tokens[3]; String newFull = tokens[3];
String newMethodDescriptor = tokens[4]; //String newMethodDescriptor = tokens[4]; // redundant and ignored
// Split the qualified field names into their classes and actual names TODO: refactor with above // Split the qualified field names into their classes and actual names TODO: refactor with above
int splitOld = oldFull.lastIndexOf('/'); int splitOld = oldFull.lastIndexOf('/');
@ -289,13 +289,11 @@ public class JarMapping {
" -> " + newFull + " in line="+line); " -> " + newFull + " in line="+line);
} }
String oldClassName = oldFull.substring(0, splitOld); String oldClassName = inputTransformer.transformClassName(oldFull.substring(0, splitOld));
String oldMethodName = oldFull.substring(splitOld + 1); String oldMethodName = oldFull.substring(splitOld + 1);
String newClassName = newFull.substring(0, splitNew); //String newClassName = newFull.substring(0, splitNew); // redundant and ignored
String newMethodName = newFull.substring(splitNew + 1); String newMethodName = newFull.substring(splitNew + 1);
// TODO: validate newMethodDescriptor instead of completely ignoring it
methods.put(oldClassName + "/" + oldMethodName + " " + oldMethodDescriptor, newMethodName); methods.put(oldClassName + "/" + oldMethodName + " " + oldMethodDescriptor, newMethodName);
} else { } else {
throw new IllegalArgumentException("Unable to parse srg file, unrecognized mapping type in line="+line); throw new IllegalArgumentException("Unable to parse srg file, unrecognized mapping type in line="+line);