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, ..."
"
...
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, ..."
- duplicates
-
JDK-6592285 DNS resolution is not required explicitly for SocketPermission.implies/equals methods
-
- Open
-