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

Fix Filer handling of package-info initial elements

    XMLWordPrintable

Details

    • b04

    Backports

      Description

        The annotation processing Filer is obliged to maintain various invariants:

        "During each run of an annotation processing tool, a file with a given pathname may be created only once. If that file already exists before the first attempt to create it, the old contents will be deleted. Any subsequent attempt to create the same file during a run will throw a FilerException, as will attempting to create both a class file and source file for the same type name or same package name. The initial inputs to the tool are considered to be created by the zeroth round; therefore, attempting to create a source or class file corresponding to one of those inputs will result in a FilerException."

        The handling of package-info files and the handling of files for types are subject to the same constraints.

        However, the javac Filer implementation does not correctly catch attempting to open a package-info file through the Filer when the same file has been passed as an initial argument.

        Attachments

          Issue Links

            Activity

              People

                darcy Joe Darcy
                darcy Joe Darcy
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: