Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338815

Add separation to exception message in JavacFileManager.DirectoryContainer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools

      When JavacFileManager.DirectoryContainer.list encounters an InvalidPathException, it rethrows this as an IOException where the message includes the directory concatenated with the toString of the InvalidPathException:

      {code}
      throw new IOException("error accessing directory " + directory + e);
      {code}

      The directory and the exception toString has no separation, resulting in compilation errors like the following:

      {code}
      error accessing directory Z:\invalid-pathjava.nio.file.InvalidPathException: Illegal char <:> at index 4: file:txt
      {code}

      The solution is to inject a separator between the directory and the exception toString

            eirbjo Eirik Bjørsnøs
            eirbjo Eirik Bjørsnøs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: