protected -> excluded

This commit is contained in:
md_5 2013-06-11 10:47:37 +10:00
parent 22fdad8e26
commit b2ba97e963
2 changed files with 17 additions and 17 deletions

View File

@ -49,7 +49,7 @@ public class JarMapping {
public final Map<String, String> methods = new HashMap<String, String>();
private InheritanceMap inheritanceMap = new InheritanceMap();
private InheritanceProvider fallbackInheritanceProvider = null;
private Set<String> ignoredPackages = new HashSet<String>();
private Set<String> excludedPackages = new HashSet<String>();
public JarMapping() {
}
@ -75,13 +75,13 @@ public class JarMapping {
* Add a class name prefix to the mapping ignore list.
* Note: this only applies before loading mappings, not after
*/
public void addProtectedPackage(String packageName) {
public void addExcludedPackage(String packageName) {
SpecialSource.log("Protecting Package: " + packageName);
ignoredPackages.add(packageName);
excludedPackages.add(packageName);
}
private boolean isProtectedPackage(String desc) {
for (String packageName : ignoredPackages) {
private boolean isExcludedPackage(String desc) {
for (String packageName : excludedPackages) {
if (desc.startsWith(packageName)) {
return true;
}
@ -325,7 +325,7 @@ public class JarMapping {
oldClassName = temp;
}
if (isProtectedPackage(oldClassName)) {
if (isExcludedPackage(oldClassName)) {
SpecialSource.log("Ignored CL: " + oldClassName + " " + newClassName);
return;
}
@ -354,7 +354,7 @@ public class JarMapping {
oldPackageName = temp;
}
if (isProtectedPackage(oldPackageName)) {
if (isExcludedPackage(oldPackageName)) {
SpecialSource.log("Ignored PK: " + oldPackageName + " -> " + newPackageName);
return;
}
@ -399,7 +399,7 @@ public class JarMapping {
oldFieldName = temp;
}
if (isProtectedPackage(oldClassName)) {
if (isExcludedPackage(oldClassName)) {
SpecialSource.log("Ignored FD: " + oldClassName + "/" + oldFieldName + " -> " + newFieldName);
return;
}
@ -434,7 +434,7 @@ public class JarMapping {
oldMethodName = temp;
}
if (isProtectedPackage(oldClassName)) {
if (isExcludedPackage(oldClassName)) {
SpecialSource.log("Ignored MD: " + oldClassName + "/" + oldMethodName + " -> " + newMethodName);
return;
}

View File

@ -121,7 +121,7 @@ public class SpecialSource {
acceptsAll(asList("d", "identifier"), "Identifier to place on each class that is transformed, by default, none")
.withRequiredArg()
.ofType(String.class);
acceptsAll(asList("p", "ignored-packages"), "A comma seperated list of packages that should not be transformed, even if the srg specifies they should")
acceptsAll(asList("e", "excluded-packages"), "A comma seperated list of packages that should not be transformed, even if the srg specifies they should")
.withRequiredArg()
.ofType(String.class);
}
@ -162,10 +162,10 @@ public class SpecialSource {
identifier = (String)options.valueOf("identifier");
}
String[] ignored = new String[0];
if (options.has("ignored-packages"))
String[] excluded = new String[0];
if (options.has("excluded-packages"))
{
ignored = ((String)options.valueOf("ignored-packages")).split(",");
excluded = ((String)options.valueOf("excluded-packages")).split(",");
}
FileLocator.useCache = !options.has("force-redownload");
@ -182,17 +182,17 @@ public class SpecialSource {
visit(new Pair<Jar>(jar1, jar2), new Pair<JarComparer>(visitor1, visitor2), new Pair<String>(jar1.getMain(), jar2.getMain()));
jarMapping = new JarMapping(visitor1, visitor2, (File) options.valueOf("srg-out"), options.has("compact"), options.has("generate-dupes"));
for (String pkg : ignored)
for (String pkg : excluded)
{
jarMapping.addProtectedPackage(pkg);
jarMapping.addExcludedPackage(pkg);
}
} else if (options.has("srg-in")) {
log("Loading mappings");
jarMapping = new JarMapping();
for (String pkg : ignored)
for (String pkg : excluded)
{
jarMapping.addProtectedPackage(pkg);
jarMapping.addExcludedPackage(pkg);
}
// Loading options