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

Pass originating elements from Filer to JavaFileManager

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 18
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Adding new methods to JavaFileManager can cause compatibility issues for subclasses may have a method with the same name and signature, conflicting with the newly added method. Given the names of the proposed methods, this appears to be very unlikely.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      JavaFileManager is enhanced with two new methods used to create new files on behalf of Filer.

      Problem

      Various methods in javax.annotation.processing.Filer, like createSourceFile, allow to specify the Elements from which the content of the file "originates". But these Elements are completely unused, are ignored in Filer, and the JavaFileManager that ultimately creates the files is not aware of them.

      Solution

      Two new methods (getJavaFileForOutputForOriginatingFiles and getFileForOutputForOriginatingFiles), accepting "originating files" are added to JavaFileManager, and the Filer implementation in javac will delegate to these methods, converting originating Elements to JavaFileObjects.

      Specification

      The specdiff is attached as specdiff.01.zip and is also available for convenience here: http://cr.openjdk.java.net/~jlahoda/8272234/specdiff.01/overview-summary.html

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              jlahoda Jan Lahoda
              Reviewed By:
              Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: