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

Cannot use JavaCompiler to create multiple CompilationTasks for partial compilations

    XMLWordPrintable

Details

    • b136
    • generic
    • generic
    • Verified

    Description

      Using JSR 199, you can get a JavaCompiler object, from which you can get CompilationTask objects to perform compilations.

      Using the Tree API, you can cast a CompilationTask to a JavacTask, to get more control over the compilation, such as calling parse(), analyse() and generate() separately or not at all.

      But starting a CompilationTask establishes a lock on the JavaCompiler object, which prevents further CompilationTask objects from being created until the first compilation is completed. This lock is an issue if the desire is to just use the Tree API to parse and/or analyze files without generating code.

      Attachments

        Activity

          People

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: