You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Martin Wiesner (Jira)" <ji...@apache.org> on 2026/09/16 05:37:00 UTC

[jira] [Assigned] (OPENNLP-1949) ADSentenceStream.read() loops forever on an empty sentence at end of file

     [ https://issues.apache.org/jira/browse/OPENNLP-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Wiesner reassigned OPENNLP-1949:
---------------------------------------

    Assignee: Kristian Rickert

> ADSentenceStream.read() loops forever on an empty sentence at end of file
> -------------------------------------------------------------------------
>
>                 Key: OPENNLP-1949
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1949
>             Project: OpenNLP
>          Issue Type: Bug
>    Affects Versions: 2.5.12, 3.0.0-M6
>            Reporter: Richard Zowalla
>            Assignee: Kristian Rickert
>            Priority: Minor
>             Fix For: 3.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {{ADSentenceStream.read\(\)}} \(lines 481\-531\): at EOF with {{sentenceStarted == true}} and an empty buffer, neither branch returns, so the {{while \(true\)}} loop calls {{samples.read\(\)}} forever.
> _Repro:_
> {code:java}
> new ADSentenceStream\(ObjectStreamUtils.createObjectStream\(""\)\).read\(\); // never returns
> {code}
> Verified: still running after 3 s.
> A truncated or damaged Arvores Deitadas file hangs training instead of failing.
> _Fix:_ return {{null}} \(or throw {{InvalidFormatException}} naming the unclosed sentence\) when EOF is reached with an empty started sentence, and add a test.



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