[GitHub] stain commented on a change in pull request #49: Cleanup for FindBugs and PMD warnings in -simple and -jena

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] stain commented on a change in pull request #49: Cleanup for FindBugs and PMD warnings in -simple and -jena

GitBox
stain commented on a change in pull request #49: Cleanup for FindBugs and PMD warnings in -simple and -jena
URL: https://github.com/apache/commons-rdf/pull/49#discussion_r245311836
 
 

 ##########
 File path: commons-rdf-simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
 ##########
 @@ -58,8 +60,12 @@
  */
 public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> implements RDFParser, Cloneable {
 
-    public static final ThreadGroup threadGroup = new ThreadGroup("Commons RDF parsers");
-    private static final ExecutorService threadpool = Executors.newCachedThreadPool(r -> new Thread(threadGroup, r));
+    public static final AtomicInteger threadCount = new AtomicInteger();
+    private static Thread newThread(Runnable r) {
 
 Review comment:
   OK, so I see [ThreadGroup](https://stackoverflow.com/a/3265726) is criticized by Joshua Block, but I don't think we would get many of these threads in the pool, so no big need to group them. However we don't need that counter of the `threadCount`, which also don't need to be public, they can just be called `Commons RDF Parser` without a number.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]