Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3851

JsonReader EN locale assumption leads to NPE in natively compiled Java

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.0
    • Affects Version/s: 4.1.0
    • Component/s: JSON
    • None
    • Fully Compatible

      GraalVM native images only supports a single locale, which is leading to an NPE in the mongodb driver, see this quarkus issue

      The problem is in the JsonReader, which assumes EN as an available locale. When the user changes the language to something else, e.g. Italian, the NPE appears. JsonReader should assume the locale provided by the user and not EN.

      I've created a temporary substitution that avoids the problem by returning a date as soon as its found (without checking the length), see here. I'm unsure whether such fix would work for mongodb in general. The real fix should be to use the language provided by the user, and then it'd be no problems.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            galder@redhat.com Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: