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

javax.tools.JavaCompiler spec contains errors in sample code

    XMLWordPrintable

Details

    • b68
    • generic, x86
    • generic, windows_vista
    • Not verified

    Description

      The sample code in the spec for javax.tools.JavaCompiler interface contains some sample code. This code contains some typos and is not compiled.

             Files[] files1 = ... ; // input for first compilation task
             Files[] files2 = ... ; // input for second compilation task

      Files[] -> File[] ?

             System.out.format("Error on line %d in %d%n",
                               diagnostic.getLineNumber()
                               diagnostic.getSource().toUri());

      There are no comma (,) in second line and method toUri() is not known.

                  public void flush() {
                      logger.entering(StandardJavaFileManager.class.getName(), "flush");
                      super.flush();
                      logger.exiting(StandardJavaFileManager.class.getName(), "flush");
                  }

      super.flush(); => Unhandled IOException, perhaps invalid flush() method signature, add throws block

      Attachments

        Activity

          People

            vromero Vicente Arturo Romero Zaldivar
            ydanilev Yury Danilevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: