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

Joern Kottmann commented on OPENNLP-368:
----------------------------------------

There is no need to use generics either, because we just need an Object and 
then call equals, client code also does not need to cast.
Don't see how generics could improve the code, the only thing you get is that 
the compiler can check that a client is always calling it with the same type, 
and nothing is passed in accidentally.

I am a little worried that the patch might introduce bugs, which could be quite 
hard to find later on. That is why we should do extensive testing before 
applying it. For some parts this is currently not possible e.g. coref.

In other parts we have good junit test coverage, there it would be safe to 
apply your changes.
                
> loops improved in opennlp-tools
> -------------------------------
>
>                 Key: OPENNLP-368
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-368
>             Project: OpenNLP
>          Issue Type: Improvement
>    Affects Versions: tools-1.5.3-incubating
>            Reporter: Aliaksandr Autayeu
>            Priority: Minor
>              Labels: patch
>         Attachments: 0008-loops-improved-in-tools.patch
>
>
> Many old-style indexed loops replaced with Java5 for each loops to improve 
> code readability and reduce possibility of bugs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to