stefan-egli commented on code in PR #1419: URL: https://github.com/apache/jackrabbit-oak/pull/1419#discussion_r1566989140
########## oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java: ########## @@ -349,28 +357,24 @@ private void printInfo(VersionGarbageCollector gc, RevisionsOptions options) fmtTimestamp(info.oldestDetailedGCRevisionEstimate)); } - private void collect(final RevisionsOptions options, Closer closer, boolean detailedGCEnabled) - throws IOException { + private void collect(final RevisionsOptions options, Closer closer, boolean detailedGCEnabled) throws IOException { VersionGarbageCollector gc = bootstrapVGC(options, closer, detailedGCEnabled); ExecutorService executor = Executors.newSingleThreadExecutor(); final Semaphore finished = new Semaphore(0); try { // collect until shutdown hook is called final AtomicBoolean running = new AtomicBoolean(true); - Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { - @Override - public void run() { - System.out.println("Detected QUIT signal."); - System.out.println("Stopping Revision GC..."); - running.set(false); - gc.cancel(); - finished.acquireUninterruptibly(); - System.out.println("Stopped Revision GC."); - } + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + System.out.println("Detected QUIT signal."); + System.out.println("Stopping Revision GC..."); + running.set(false); + gc.cancel(); + finished.acquireUninterruptibly(); + System.out.println("Stopped Revision GC."); })); if (options.isContinuous()) { while (running.get()) { - long lastRun = System.currentTimeMillis(); + long lastRun = currentTimeMillis(); Review Comment: Just as a comment, I don't see this as an improvement, the old variant for me at least is more readable and thus more user friendly - the other issue with this is that it increases the change surface of this change (and of the feature branch), i.e. we'll then have code changes that are unrelated (unnecessary) and it makes merging/backporting/source-lookups more difficult. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org