commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stain <...@git.apache.org>
Subject [GitHub] commons-rdf pull request #49: Cleanup for FindBugs and PMD warnings in -simp...
Date Wed, 14 Feb 2018 18:53:40 GMT
Github user stain commented on a diff in the pull request:

    https://github.com/apache/commons-rdf/pull/49#discussion_r168274256
  
    --- Diff: 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) {
    --- End diff --
    
    A final ThreadGroup that is not thread safe.. The whole purpose of it is to group threads?
    
    It is true that they should not be used for security purpose, but that is not why it is
here. The ThreadGroup is mainly useful for debugging as people might see these "Commons RDF
Parser" tree grouped together in the debugger (e.g. in Eclipse) rather than the generic no-name
you get from the ExecutorService.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message