You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2026/10/21 19:24:44 UTC

[PR] GH-1506: Make AbstractClassPathModelFinder.findModels thread-safe (opennlp)

rzo1 opened a new pull request, #1507:
URL: https://github.com/apache/opennlp/pull/1507

   Fixes #1506
   
   findModels now builds the model set locally and publishes it as an unmodifiable set through a volatile field; a lock makes concurrent first calls scan the classpath once. The Javadoc of the finder and provider types states their thread safety, and the README lists the unmodifiable result as a breaking change.


-- 
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: commits-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-1506: Make AbstractClassPathModelFinder.findModels thread-safe (opennlp)

Posted by "krickert (via GitHub)" <gi...@apache.org>.
krickert commented on code in PR #1507:
URL: https://github.com/apache/opennlp/pull/1507#discussion_r4342934288


##########
opennlp-api/src/main/java/opennlp/tools/models/ClassPathModelFinder.java:
##########
@@ -22,6 +22,8 @@
  * Describes a scanner which detects OpenNLP specific model files in an applications's classpath.
  * If compatible models are present at runtime, each discovered element is made available
  * as {@link ClassPathModelEntry}.
+ * <p>
+ * Thread safety is implementation specific.

Review Comment:
   Not sure if this is needed?  Doesn't tell me much. 



-- 
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: commits-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-1506: Make AbstractClassPathModelFinder.findModels thread-safe (opennlp)

Posted by "mawiesne (via GitHub)" <gi...@apache.org>.
mawiesne commented on code in PR #1507:
URL: https://github.com/apache/opennlp/pull/1507#discussion_r4345349510


##########
opennlp-api/src/main/java/opennlp/tools/models/ClassPathModelFinder.java:
##########
@@ -22,6 +22,8 @@
  * Describes a scanner which detects OpenNLP specific model files in an applications's classpath.
  * If compatible models are present at runtime, each discovered element is made available
  * as {@link ClassPathModelEntry}.
+ * <p>
+ * Thread safety is implementation specific.

Review Comment:
   Agree, comment in line 26 could be dropped.



-- 
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: commits-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-1506: Make AbstractClassPathModelFinder.findModels thread-safe (opennlp)

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 merged PR #1507:
URL: https://github.com/apache/opennlp/pull/1507


-- 
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: commits-unsubscribe@opennlp.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org