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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P3
    • None
    • 6
    • tools
    • None
    • generic
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: