class RenamePrototypes {
/**
* Runs through the list of properties and tries to rename as many as possible
* with names that were used for them in the previous compilation.
* {@code reservedNames} is updated with the set of reused names.
* @param properties The set of properties to attempt to rename.
*/
private void reusePrototypeNames(Set<Property> properties) {
for (Property prop : properties) {
String prevName = prevUsedRenameMap.lookupNewName(prop.oldName);
if (prevName != null) {
if (reservedNames.contains(prevName)) {
continue;
}
prop.newName = prevName;
reservedNames.add(prevName);
}
}
}
}
|