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

Cannot use JavaCompiler to create multiple CompilationTasks for partial compilations

XMLWordPrintable

    • b136
    • generic
    • generic
    • Verified

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: