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

c.s.t.javac.api.JavacTool.getTask() - more informative exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • tools
    • None
    • b112
    • Verified

      When a source file's name accidentally has whitespace on the end, the exception from getTask() is not clear as to where the issue lies. Adding the data used to make the decision (in this case the filename suffix) to the exception would make this more obvious.

      Exception in thread "main" java.lang.IllegalArgumentException: All compilation units must be of SOURCE kind
              at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:136)
              at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107)
      ...

            ksrini Kumar Srinivasan
            ahgross Andrew Gross
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: