[ https://issues.apache.org/jira/browse/OPENNLP-1044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16000181#comment-16000181 ]
ASF GitHub Bot commented on OPENNLP-1044: ----------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/opennlp/pull/192 > Add validate() which checks validity of parameters in the process of the > framework > ---------------------------------------------------------------------------------- > > Key: OPENNLP-1044 > URL: https://issues.apache.org/jira/browse/OPENNLP-1044 > Project: OpenNLP > Issue Type: Improvement > Reporter: Koji Sekiguchi > Assignee: Koji Sekiguchi > Priority: Minor > > When I worked on OPENNLP-1039, I saw the client codes throw > IllegalArgumentException when isValid() returns false, but I think such kind > of methods should throw the Exception by themselves and the timing of use > should be controlled by the framework. > So it should look like: > {code} > public abstract class AbstractTrainer { > @Depracated > public boolean isValid() { ... } > // if the subclass overrides this, it should call super.validate(); > public void validate() throws IllegalArgumentException { > // default implementation here > } > // this is the controller of the flow of training... > public final void train() { > // initializing > init(); > // validating parameters > validate(); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)