nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
equal
deleted
inserted
replaced
441 filesDeleted++; |
441 filesDeleted++; |
442 } catch (final Exception e) { |
442 } catch (final Exception e) { |
443 // does not increase filesDeleted |
443 // does not increase filesDeleted |
444 } |
444 } |
445 files[i] = null; // gc eligible |
445 files[i] = null; // gc eligible |
446 }; |
446 } |
447 } |
447 } |
448 |
448 |
449 private static Path[] getAllRegularFilesInLastModifiedOrder() throws IOException { |
449 private static Path[] getAllRegularFilesInLastModifiedOrder() throws IOException { |
450 try (final Stream<Path> filesStream = Files.walk(baseCacheDir.toPath())) { |
450 try (final Stream<Path> filesStream = Files.walk(baseCacheDir.toPath())) { |
451 // TODO: rewrite below once we can use JDK8 syntactic constructs |
451 // TODO: rewrite below once we can use JDK8 syntactic constructs |
452 return filesStream |
452 return filesStream |
453 .filter(new Predicate<Path>() { |
453 .filter(new Predicate<Path>() { |
454 @Override |
454 @Override |
455 public boolean test(final Path path) { |
455 public boolean test(final Path path) { |
456 return !Files.isDirectory(path); |
456 return !Files.isDirectory(path); |
457 }; |
457 } |
458 }) |
458 }) |
459 .map(new Function<Path, PathAndTime>() { |
459 .map(new Function<Path, PathAndTime>() { |
460 @Override |
460 @Override |
461 public PathAndTime apply(final Path path) { |
461 public PathAndTime apply(final Path path) { |
462 return new PathAndTime(path); |
462 return new PathAndTime(path); |