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

Joern Kottmann commented on OPENNLP-835:
----------------------------------------

Just had a look now, sorry for the delay.

The patch is good. The close method should set eventIt again to an empty 
iterator instead of null. A user might call again read and in that case a NPE 
would be thrown otherwise. The underlying streams at some point probably throw 
an exception when read is called again because the closed their resources 
already.

I will apply the patch with this modification. Thanks for sending this!

> Various bugs in SequenceStreamEventStream
> -----------------------------------------
>
>                 Key: OPENNLP-835
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-835
>             Project: OpenNLP
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: Steven Taschuk
>            Assignee: Joern Kottmann
>              Labels: easyfix, patch-available
>             Fix For: 1.6.1
>
>         Attachments: apache-opennlp-1.6.0-fix-seqstreameventstream.patch
>
>
> The class SequenceStreamEventStream has a few bugs.
> (1) It truncates the stream early if any sequence is empty.
> (2) After reset, it will emit the remaining elements from the underlying 
> sequence that was being iterated over before the reset, and then start over 
> from the beginning.
> (3) It leaks memory by not discarding references to objects it doesn't need 
> anymore.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to