Skip to content

Commit 70dae17

Browse files
committed
Kotlin: Simplify trapFilePathForDecl
1 parent 80968ee commit 70dae17

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

java/kotlin-extractor/src/main/java/com/semmle/extractor/java/OdasaOutput.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,23 +214,17 @@ private File trapFileForDecl(IrDeclaration sym, String signature) {
214214
trapFilePathForDecl(sym, signature));
215215
}
216216

217-
private final Map<String, String> memberTrapPaths = new LinkedHashMap<String, String>();
218-
private static final Pattern dots = Pattern.compile(".", Pattern.LITERAL);
219217
private String trapFilePathForDecl(IrDeclaration sym, String signature) {
220218
String binaryName = getIrDeclBinaryName(sym);
221219
String binaryNameWithSignature = binaryName + signature;
222220
// TODO: Reinstate this?
223221
//if (getTrackClassOrigins())
224222
// classId += "-" + StringDigestor.digest(sym.getSourceFileId());
225-
String result = memberTrapPaths.get(binaryNameWithSignature);
226-
if (result == null) {
227-
result = CLASSES_DIR + "/" +
228-
dots.matcher(binaryName).replaceAll("/") +
223+
String result = CLASSES_DIR + "/" +
224+
binaryName.replace('.', '/') +
229225
signature +
230226
".members" +
231227
".trap.gz";
232-
memberTrapPaths.put(binaryNameWithSignature, result);
233-
}
234228
return result;
235229
}
236230

0 commit comments

Comments
 (0)