ReleaseInfoPlugin doesn't handle input file as UTF-8 properly

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • None
    • Affects Version/s: 26
    • Component/s: tools
    • None
    • Fix Understood
    • generic
    • generic

      The ReleaseInfoPlugin part of jlink uses this code when reading from a file via "--release-info /path/to/file" option:

                      // --release-info <file>
                      Properties props = new Properties();
                      try (FileInputStream fis = new FileInputStream(operation)) {
                          props.load(fis);
                      } catch (IOException exp) {
                          throw new UncheckedIOException(exp);
                      }
                      props.forEach((k, v) -> release.put(k.toString(), v.toString()));

      In other words, the input file when the release-info plugin runs is in UTF-8 (see JDK-8301971), while the Properties.load(InputStream) API assumes the input stream to be in ISO-8859-1.

      This would be visible on a build with non-ASCII characters in the vendor string when building the JDK:

      $ configure --with-vendor-name='ößäakl foo'
      $ make images

      It's best to use Properties.load(Reader) API instead to avoid this.

            Assignee:
            Severin Gehwolf
            Reporter:
            Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: