Kotlin: Simplify trapFilePathForDecl

This commit is contained in:
Ian Lynagh
2022-09-23 12:41:41 +01:00
parent 80968eef47
commit 70dae17d2f

View File

@@ -214,23 +214,17 @@ public class OdasaOutput {
trapFilePathForDecl(sym, signature)); trapFilePathForDecl(sym, signature));
} }
private final Map<String, String> memberTrapPaths = new LinkedHashMap<String, String>();
private static final Pattern dots = Pattern.compile(".", Pattern.LITERAL);
private String trapFilePathForDecl(IrDeclaration sym, String signature) { private String trapFilePathForDecl(IrDeclaration sym, String signature) {
String binaryName = getIrDeclBinaryName(sym); String binaryName = getIrDeclBinaryName(sym);
String binaryNameWithSignature = binaryName + signature; String binaryNameWithSignature = binaryName + signature;
// TODO: Reinstate this? // TODO: Reinstate this?
//if (getTrackClassOrigins()) //if (getTrackClassOrigins())
// classId += "-" + StringDigestor.digest(sym.getSourceFileId()); // classId += "-" + StringDigestor.digest(sym.getSourceFileId());
String result = memberTrapPaths.get(binaryNameWithSignature); String result = CLASSES_DIR + "/" +
if (result == null) { binaryName.replace('.', '/') +
result = CLASSES_DIR + "/" +
dots.matcher(binaryName).replaceAll("/") +
signature + signature +
".members" + ".members" +
".trap.gz"; ".trap.gz";
memberTrapPaths.put(binaryNameWithSignature, result);
}
return result; return result;
} }