You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/13 06:43:49 UTC

[groovy] 02/02: Workaround javadoc bug

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/install-graphviz
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit d8015a3b8d31fdc6f04231a5363952bda3adf28a
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jun 13 14:43:14 2021 +0800

    Workaround javadoc bug
---
 .../provider/collection/runtime/QueryableHelper.groovy   | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
index 709549a..c6eb594 100644
--- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
+++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/QueryableHelper.groovy
@@ -23,7 +23,6 @@ import groovy.transform.CompileStatic
 import java.util.concurrent.CompletableFuture
 import java.util.concurrent.ExecutorService
 import java.util.concurrent.Executors
-import java.util.concurrent.ThreadFactory
 import java.util.concurrent.TimeUnit
 import java.util.function.Function
 import java.util.function.Supplier
@@ -128,16 +127,13 @@ class QueryableHelper {
 
     private static class ThreadPoolHolder {
         static final ExecutorService THREAD_POOL
+        static int seq;
         static {
-            THREAD_POOL = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() {
-                private int seq
-                @Override
-                Thread newThread(Runnable r) {
-                    Thread t = new Thread(r)
-                    t.setName("ginq-thread-" + seq++)
-                    t.setDaemon(true)
-                    return t
-                }
+            THREAD_POOL = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), (Runnable r) -> {
+                Thread t = new Thread(r)
+                t.setName("ginq-thread-" + seq++)
+                t.setDaemon(true)
+                return t
             })
         }
         private ThreadPoolHolder() {}