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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • None
    • Affects Version/s: 6
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: