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

Unspecified comparison by resolved IP address in SocketPermission.equals(Object obj) method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • None
    • x86
    • solaris

      Specification for java.net.SocketPermission.equals(Object obj) method reads:

      "
      ...
      Returns:
          true if obj is a SocketPermission, and has ***the same hostname***, port range, and actions as this SocketPermission object.
      "

      Though specification requires hostnames to be the same, SocketPermission.equals() method in JDK6 returns true for the SocketPermissions with URIs: "sun.com", "www.sun.com" or "72.5.124.61". I don't think that we can say that "72.5.124.61" and "sun.com" are the same hostnames, though DNS name "sun.com" is resolved into "72.5.124.61" IPv4 address.

      I suggest specifying this behaviour by adding something like following statement in the equals() specification: "and has the same hostname *or its hostname can be resolved to the same IP address*, port range, ..."

            Unassigned Unassigned
            mismirno Mikhail Smirnov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: