You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by "krickert (via GitHub)" <gi...@apache.org> on 2026/10/03 20:20:00 UTC
[I] (fix) Bundled Unicode data accessors fail with ExceptionInInitializerError instead of the documented exceptions (opennlp)
krickert opened a new issue, #1388:
URL: https://github.com/apache/opennlp/issues/1388
PR #1373
`EmojiAnnotations.lookup` and the other bundled Unicode data accessors document `IllegalStateException` for a missing resource and `UncheckedIOException` for an unreadable one. The data is loaded in static initializers, so a caller never sees those exceptions. The first call fails with `ExceptionInInitializerError`, and every call after that fails with `NoClassDefFoundError`, because the JVM caches the failed class initialization.
This affects `Confusables`, `FullCaseFoldCharSequenceNormalizer`, `EmojiAnnotations`, `EmojiEmoticons`, `UnicodeEmojiSequences`, `WordBreakProperty` and `ExtendedPictographic`.
**To reproduce**
Run with the bundled `emoji-annotations` resource removed from the classpath and call `EmojiAnnotations.lookup(...)` twice. Expected: `IllegalStateException` on both calls. Actual: `ExceptionInInitializerError`, then `NoClassDefFoundError`.
**Fix**
Add an internal `BundledUnicodeData` helper that opens the resource, reads lines, strips UCD comments, and loads lazily without caching a failure. Switch the seven classes to it. Parsing and error messages do not change. The documented exceptions now surface on every call and are listed on the public accessors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opennlp.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Bundled Unicode data accessors fail with ExceptionInInitializerError instead of the documented exceptions (opennlp)
Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 closed issue #1388: Bundled Unicode data accessors fail with ExceptionInInitializerError instead of the documented exceptions
URL: https://github.com/apache/opennlp/issues/1388
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org