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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 6
    • tools
    • None
    • generic
    • generic

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: