Allow other named NetPermissions to be used

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P3
    • 13
    • Component/s: core-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      Allow other named NetPermissions to be used.

      Problem

      The current specification of java.net.NetPermission states: "The following table lists all the possible NetPermission target names ...", which implies that unless the permission target is listed in the table, it cannot be used.

      However, there is no such enforcement in the implementation, and it is useful and somewhat common for applications / libraries to create their own permission target names.

      Solution

      Relax the specification so that non-listed permissions are allowable. The table will remain, but will only document Java SE permissions.

      Specification

      --- a/src/java.base/share/classes/java/net/NetPermission.java
      +++ b/src/java.base/share/classes/java/net/NetPermission.java
      @@ -43,7 +43,7 @@
        * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
        * match, while "*foo" and "a*b" do not.
        * <P>
      - * The following table lists all the possible NetPermission target names,
      + * The following table lists the standard NetPermission target names,
        * and for each provides a description of what the permission allows
        * and a discussion of the risks of granting code the permission.
        *
      

            Assignee:
            Chris Hegarty
            Reporter:
            Chris Hegarty
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: