[ 
https://issues.apache.org/jira/browse/OPENNLP-1413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17649219#comment-17649219
 ] 

ASF GitHub Bot commented on OPENNLP-1413:
-----------------------------------------

mawiesne commented on code in PR #459:
URL: https://github.com/apache/opennlp/pull/459#discussion_r1051953520


##########
opennlp-tools/src/main/java/opennlp/tools/util/ext/ExtensionLoader.java:
##########
@@ -41,20 +42,23 @@ static void setOSGiAvailable() {
 
   // Pass in the type (interface) of the class to load
   /**
-   * Instantiates an user provided extension to OpenNLP.
+   * Instantiates a user provided extension to OpenNLP.
    * <p>
    * The extension is either loaded from the class path or if running
    * inside an OSGi environment via an OSGi service.
    * <p>
-   * Initially it tries using the public default
-   * constructor. If it is not found, it will check if the class follows the 
singleton
-   * pattern: a static field named <code>INSTANCE</code> that returns an 
object of the type
-   * <code>T</code>.
+   * Initially, the load is conducted using the public no-arg constructor.
+   * If no such constructor is not found, it is checked if the class follows 
the
+   * {@code Singleton} pattern: a static field named {@code INSTANCE} that
+   * returns an object of the type {@link T}.
    *
-   * @param clazz
-   * @param extensionClassName
+   * @param clazz A reference to {@link Class<T>}.
+   * @param extensionClassName The (fully-qualified) name of the class
+   *                           by which the extension shall be loaded.
    *
    * @return the instance of the extension class
+   *
+   * @throws ExtensionNotLoadedException Thrown if the load operation failed.
    */
   // TODO: Throw custom exception if loading fails ...

Review Comment:
   @kinow Thanks for helping out here.
   
   In discussion with @rzo1, we opted to remove the existing TODO as it is 
"ancient" in a terms of what the code today does. The catch-block around line 
99/100 must be empty, as afterwards another attempt is made to compensate for 
this via OSGi loading mechanism. Therefore, the `ExtensionNotLoadedException` 
will be thrown any way, if that compensation attempt also fails. In our 
(re)view of the code, there is no hard need to introduce other exceptions here. 
Thus, I'll remove the forgotten TODO.





> Enhance JavaDoc in opennlp.tools.util package
> ---------------------------------------------
>
>                 Key: OPENNLP-1413
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1413
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 2.1.0
>            Reporter: Martin Wiesner
>            Assignee: Martin Wiesner
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> The JavaDoc the _opennlp.tools.util_ package suffers from several 
> inconsistencies and missing descriptions. Moreover, several typos are present 
> that need sanitizing.
> It needs enhancements and/or additions to provide more clarity for readers.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to