@@ -218,23 +218,6 @@ private String trapFilePathForDecl(IrElement sym, String signature) {
218
218
return result ;
219
219
}
220
220
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
-
238
221
/*
239
222
* Trap writers.
240
223
*/
@@ -516,32 +499,12 @@ public int compare(Pair<File, TrapClassVersion> p1, Pair<File, TrapClassVersion>
516
499
}
517
500
}
518
501
}
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
- }
534
502
}
535
503
536
504
/*
537
505
* Class version tracking.
538
506
*/
539
507
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
-
545
508
private static class TrapClassVersion {
546
509
private int majorVersion ;
547
510
private int minorVersion ;
@@ -709,27 +672,4 @@ public String toString() {
709
672
return majorVersion + "." + minorVersion + "-" + lastModified + "-" + extractorName ;
710
673
}
711
674
}
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
-
735
675
}
0 commit comments