Skip to content

Commit 0cf309b

Browse files
authored
Merge pull request #14369 from igfoo/igfoo/remove_unused
Kotlin: Remove some unused code
2 parents 602bb40 + ec3f080 commit 0cf309b

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

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

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -218,23 +218,6 @@ private String trapFilePathForDecl(IrElement sym, String signature) {
218218
return result;
219219
}
220220

221-
/*
222-
* Deletion of existing trap files.
223-
*/
224-
225-
private void deleteTrapFileAndDependencies(IrElement sym, String signature) {
226-
File trap = trapFileForDecl(sym, signature);
227-
if (trap.exists()) {
228-
trap.delete();
229-
File depFile = new File(trap.getParentFile(), trap.getName().replace(".trap.gz", ".dep"));
230-
if (depFile.exists())
231-
depFile.delete();
232-
File metadataFile = new File(trap.getParentFile(), trap.getName().replace(".trap.gz", ".metadata"));
233-
if (metadataFile.exists())
234-
metadataFile.delete();
235-
}
236-
}
237-
238221
/*
239222
* Trap writers.
240223
*/
@@ -516,32 +499,12 @@ public int compare(Pair<File, TrapClassVersion> p1, Pair<File, TrapClassVersion>
516499
}
517500
}
518501
}
519-
520-
private LockDirectory getExtractorLockDir() {
521-
return LockDirectory.instance(currentSpecFileEntry.getTrapFolder(), log);
522-
}
523-
524-
private void lockTrapFile(File trapFile) {
525-
getExtractorLockDir().blockingLock(LockingMode.Exclusive, trapFile, "Java extractor lock");
526-
}
527-
528-
private void unlockTrapFile(File trapFile) {
529-
boolean success = getExtractorLockDir().maybeUnlock(LockingMode.Exclusive, trapFile);
530-
if (!success) {
531-
log.warn("Trap file was not locked: " + trapFile);
532-
}
533-
}
534502
}
535503

536504
/*
537505
* Class version tracking.
538506
*/
539507

540-
private static final String MAJOR_VERSION = "majorVersion";
541-
private static final String MINOR_VERSION = "minorVersion";
542-
private static final String LAST_MODIFIED = "lastModified";
543-
private static final String EXTRACTOR_NAME = "extractorName";
544-
545508
private static class TrapClassVersion {
546509
private int majorVersion;
547510
private int minorVersion;
@@ -709,27 +672,4 @@ public String toString() {
709672
return majorVersion + "." + minorVersion + "-" + lastModified + "-" + extractorName;
710673
}
711674
}
712-
713-
private TrapClassVersion readVersionInfo(File trap) {
714-
int majorVersion = 0;
715-
int minorVersion = 0;
716-
long lastModified = 0;
717-
String extractorName = null;
718-
File metadataFile = new File(trap.getAbsolutePath().replace(".trap.gz", ".metadata"));
719-
if (metadataFile.exists()) {
720-
Map<String,String> metadataMap = FileUtil.readPropertiesCSV(metadataFile);
721-
try {
722-
majorVersion = Integer.parseInt(metadataMap.get(MAJOR_VERSION));
723-
minorVersion = Integer.parseInt(metadataMap.get(MINOR_VERSION));
724-
lastModified = Long.parseLong(metadataMap.get(LAST_MODIFIED));
725-
extractorName = metadataMap.get(EXTRACTOR_NAME);
726-
} catch (NumberFormatException e) {
727-
log.warn("Invalid class file version for " + trap.getAbsolutePath(), e);
728-
}
729-
} else {
730-
log.warn("Trap metadata file does not exist: " + metadataFile.getAbsolutePath());
731-
}
732-
return new TrapClassVersion(majorVersion, minorVersion, lastModified, extractorName);
733-
}
734-
735675
}

0 commit comments

Comments
 (0)