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

No exceptions specified for SocketPermission constructor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • core-libs
    • None
    • Fix Understood
    • x86
    • linux

      In class level specification something like BNF for constructor parameter is specified. However behavior in case of violation of such grammar is not specified.

      JDK usually throws IAE however absense of expection specification means that other implementations may behave in different manner violating "compile once run everywhere" idea.

      Yet sometimes JDK does not throw any exception event if grammar is violated:

      * '*' is allowed as port number violating rule
          portrange = portnumber | -portnumber | portnumber-[portnumber]
      * port number may be empty while ':' is used violating rule
          host = (hostname | IPv4address | iPv6reference) [:portrange]
      * lead/trailng spaces are allowed in action names
      * action comparison looks case-insentive (while it is specified nowhere)

      I thing it would be useful to add something like "IAE is thrown if grammar for either host or action is violated" and clarify case-sensitivity for actions (for hostnames it is clear that they are case-insensitivy as consequrence of RFCs for DNS).

            michaelm Michael McMahon
            sreznick Sergey Reznick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: