stefan-egli commented on code in PR #1419:
URL: https://github.com/apache/jackrabbit-oak/pull/1419#discussion_r1566990954


##########
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.");

Review Comment:
   Same thing here - this might be something to discuss in general in oak, but 
I fail to see the advantage of doing these changes (see other comment also).



-- 
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

Reply via email to