Skip to content

[Java] isRestrictedJavaVersion() returns wrong value #1786

@combacsa

Description

@combacsa

Describe the bug
isRestrictedJavaVersion check if specVersion (version on local) is greater than or equal to targetVersion (version required to Recognizers-Text), if I understood Java API BigDecimal correctly.

As a result, even if Java >= 11 is installed, result variable always get true, and it will print out warning message, and fallback method will always be applied.

To Reproduce
Steps to reproduce the behavior:
0. Be sure that your local machine runs with Java version > 8

  1. Go to 'Java/samples/simple-console'
  2. Type 'mvn exec:java'
  3. Type anything
  4. See 'WARN: Look-behind groups with no maximum length not supported. Java version <= 8.'

Expected behavior
Not seeing such warning message

Sample input/output
(Described above)

Platform (please complete the following information):

  • Platform: [Java]
  • Environment: [OpenJDK Runtime Environment Zulu11.33+15-CA (build 11.0.4+11-LTS)]
  • Version of package [master branch]

Additional context
I'm digging with the issue #1775 and if I fix the problem described above then more tests fails on Zulu 11 SDK. Strange. However, if I understand correctly, then current behavior of isRestrictedJavaVersion() is somewhat misleading.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions