You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Koji Sekiguchi (JIRA)" <ji...@apache.org> on 2017/05/08 01:44:04 UTC
[jira] [Assigned] (OPENNLP-1044) Add validate() which checks
validity of parameters in the process of the framework
[ https://issues.apache.org/jira/browse/OPENNLP-1044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Koji Sekiguchi reassigned OPENNLP-1044:
---------------------------------------
Assignee: Koji Sekiguchi
> 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)