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

Add javac -Xlint warning to list exposed types which are not accessible

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b140
    • CPU:
      x86
    • OS:
      windows_8
    • Verification:
      Verified

      Description

      A DESCRIPTION OF THE REQUEST :
      In a module, it's possible for types to be exposed even though they aren't accessible. This is most likely not the intended behavior, and should therefore result in an -Xlint warning like:

      com.foo.impl
           type X is exposed by member Y of accessible type Z


      JUSTIFICATION :
      Exposure of inaccessible types is most likely not intended (I can't readily think of use cases where this would be an appropriate thing to do).

      I have already proposed this enhancement on the jigsaw mailing list [1], and there seemed to be consensus that this would be a fine thing to have.

      There was some discussion on whether this should be an error or a (-Xlint) warning. I believe this should be an -Xlint warning for the reasons described in [2]

      [1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/007014.html
      [2] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-March/007043.html



        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: