8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Daniel Fuchs

Hi,

Please find below a fix for

8248703 Clarify the behavior of java.net.NetworkInterface::equals
https://bugs.openjdk.java.net/browse/JDK-8248703

CSR:https://bugs.openjdk.java.net/browse/JDK-8248704
webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.00/

NetworkInterface::equals is specified to compare the interface names and 
raw IP addresses. However, on some systems, some interface addresses can 
be dynamically updated while an application is running. Two 
NetworkInterface objects may therefore compare unequal even though they 
represent the same logical underlying interface.


both fix and CSR need reviewers.


best regards,

-- daniel


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Alan Bateman




On 02/07/2020 14:12, Daniel Fuchs wrote:

Hi,

Please find below a fix for

8248703 Clarify the behavior of java.net.NetworkInterface::equals
https://bugs.openjdk.java.net/browse/JDK-8248703

CSR:    https://bugs.openjdk.java.net/browse/JDK-8248704
webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.00/

NetworkInterface::equals is specified to compare the interface names 
and raw IP addresses. However, on some systems, some interface 
addresses can be dynamically updated while an application is running. 
Two NetworkInterface objects may therefore compare unequal even though 
they represent the same logical underlying interface.


both fix and CSR need reviewers.
I assume the "Note" can be an @apiNote. I think that part reads okay 
(and doesn't a CSR).


NetworkInterface is currently spec'ed to use phrases like "InetAddresses 
bound to the network interface" and I think we should try to keep that 
consistent if possible. That is, introducing the term "raw" into the 
javadoc would require it to be defined and I don't think we need it. 
Also some reader might think it has something to do with "raw sockets".


-Alan


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Daniel Fuchs

On 02/07/2020 14:29, Alan Bateman wrote:
I assume the "Note" can be an @apiNote. I think that part reads okay 
(and doesn't a CSR).


OK - I'll withdraw it and hide it away then :-)

NetworkInterface is currently spec'ed to use phrases like "InetAddresses 
bound to the network interface" and I think we should try to keep that 
consistent if possible. That is, introducing the term "raw" into the 
javadoc would require it to be defined and I don't think we need it. 
Also some reader might think it has something to do with "raw sockets".


Good point. I was momentarily confused by the @see InetAddress.getAddress.

Webrev updated:
http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.01/

Is this still appropriate to push to 15 or should I rather aim at 16?

best regards,

-- daniel


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Chris Hegarty



> On 2 Jul 2020, at 15:32, Daniel Fuchs  wrote:
> 
> ...
> 
> Webrev updated:
> http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.01/
> 
> Is this still appropriate to push to 15 or should I rather aim at 16?

LGTM.  I don’t have a strong opinion which release this goes into.

-Chris.



Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Alan Bateman

On 02/07/2020 15:32, Daniel Fuchs wrote:


Good point. I was momentarily confused by the @see 
InetAddress.getAddress.


Webrev updated:
http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.01/

Is this still appropriate to push to 15 or should I rather aim at 16?
"if both name and bound IP addresses are the same for both" is okay but 
might be more consistent with some of the other methods if you tweak it 
something like "if the names are equal and the set of {@code 
InetAddress}es bound to the interfaces are equal".


This a javadoc only change so okay if it goes to jdk/jdk15.

-Alan


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Daniel Fuchs

Thanks Alan!

On 02/07/2020 18:26, Alan Bateman wrote:
"if both name and bound IP addresses are the same for both" is okay but 
might be more consistent with some of the other methods if you tweak it 
something like "if the names are equal and the set of {@code 
InetAddress}es bound to the interfaces are equal".


This a javadoc only change so okay if it goes to jdk/jdk15.


I made the requested changes:

http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.02

If I don't hear any objections I will proceed and push
to 15 by tomorrow.

best regards,

-- daniel


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Alan Bateman




On 02/07/2020 18:47, Daniel Fuchs wrote:


I made the requested changes:

http://cr.openjdk.java.net/~dfuchs/webrev_8248703/webrev.02

If I don't hear any objections I will proceed and push
to 15 by tomorrow.
Looks okay although I assume you mean "are equal" rather than "are 
equals" ("equals" would be okay if it were clear it means the equals 
method).


-Alan


Re: 8248703 Clarify the behavior of java.net.NetworkInterface::equals

2020-07-02 Thread Daniel Fuchs

On 02/07/2020 19:35, Alan Bateman wrote:
Looks okay although I assume you mean "are equal" rather than "are 
equals" ("equals" would be okay if it were clear it means the equals 
method).




Darn. I'll fix the typo! Thanks Alan.