Skip to content

Conversation

@rsvoboda
Copy link
Contributor

Enhance opennlp.tools.util.Version to parse suffixed version without error.

Backport of #899 into opennlp-2.x branch

Without this change, versions like 1.5.4.foobar-007 end with java.lang.NumberFormatException: For input string: "4.foobar" when parsed by opennlp.tools.util.Version

Quarkus LangChain4J uses opennlp library transitively. We faced the above exception during startup when the dependency got productized - RedHat (part of IBM) rebuilds dependencies from the sources and adds a suffix to avoid GAV collision with the upstream project.

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions for build issues and submit an update to your PR as soon as possible.

Signed-off-by: Rostislav Svoboda <rosta.svo@gmail.com>
@rzo1 rzo1 requested a review from mawiesne November 28, 2025 08:34
@rzo1
Copy link
Contributor

rzo1 commented Nov 29, 2025

Thx @rsvoboda

@rzo1 rzo1 merged commit 707148a into apache:opennlp-2.x Nov 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants