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

package-info.java should be compiled if any class in the package is

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      If I have a package containing some classes and if there is a package-info.java in that package that has annotations, then I would expect that compiling any class in the package would cause the package-info.java to be compiled too. Currently this does not happen, which means that code that depends on the package will only see the annotation if the package-info.java file was compiled explicitly. This is inconsistent with the usual behaviour of javac, which compiles every dependency starting from any source file. Furthermore, there is no way for a Java source file to cause this to happen by referencing package-info explicitly, since package-info is by design not a valid Java identifier.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                emcmanus Eamonn McManus
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: