Re: RFR for bug JDK-8035633 TEST_BUG: java/net/NetworkInterface/Equals.java and some tests failed on windows intermittently

2014-02-27 Thread Eric Wang

On 2014/2/25 16:59, Alan Bateman wrote:

On 25/02/2014 08:49, Eric Wang wrote:

Hi Everyone,

I'm working on the test bug 
https://bugs.openjdk.java.net/browse/JDK-8035633, There are 4 tests 
(one is in a closed test) failed due to NullPointerException.
All tests failed at similar places "if (isWindows && 
ni.getDisplayName().contains("Teredo"))", the root cause is the 
NetworkInterface may return null if no display name is available.
so the fix is to make sure the display name is not null before 
calling the method "contains("Teredo")", something like "if 
(isWindows && displayName != null && displayName.contains("Teredo"))"


Please let me know if you have any comment. The webrev will be sent 
after internal review.
Yes, NetworkInterface's getDisplyName is allowed to return null and it 
looks like this wasn't taken into account when these tests were 
changed via JDK-8022963 to skip tunnels. Once you have a patch then 
net-dev would be the best list to bring it to.


-Alan.


Thanks Alan to suggest the correct alias!
Below is the webrev for this bug, Can you or anyone else help to review 
the fix?
http://cr.openjdk.java.net/~ewang/JDK-8035633/webrev.00/ 



There is one more closed test fixed, it will be sent in another mail.

Thanks,
Eric


Re: RFR for bug JDK-8035633 TEST_BUG: java/net/NetworkInterface/Equals.java and some tests failed on windows intermittently

2014-02-27 Thread Chris Hegarty

On 27 Feb 2014, at 08:18, Eric Wang  wrote:

>> …..
> 
> Thanks Alan to suggest the correct alias!
> Below is the webrev for this bug, Can you or anyone else help to review the 
> fix?
> http://cr.openjdk.java.net/~ewang/JDK-8035633/webrev.00/ 
> 

The source changes look good to me, but the copyright year change is incorrect. 
You can either, leave the copyright year untouched (my preference), or make it 
a year range. 

Once updated, post a link to the changeset and I can sponsor this for you.

-Chris.

Re: RFR for bug JDK-8035633 TEST_BUG: java/net/NetworkInterface/Equals.java and some tests failed on windows intermittently

2014-02-27 Thread Ivan Gerasimov

Hello Eric

Would you please also correct the comment on the line above your change:
s/seudo/pseudo/

The typo is in all three files.

Sincerely yours,
Ivan


On 27.02.2014 12:18, Eric Wang wrote:

On 2014/2/25 16:59, Alan Bateman wrote:

On 25/02/2014 08:49, Eric Wang wrote:

Hi Everyone,

I'm working on the test bug 
https://bugs.openjdk.java.net/browse/JDK-8035633, There are 4 tests 
(one is in a closed test) failed due to NullPointerException.
All tests failed at similar places "if (isWindows && 
ni.getDisplayName().contains("Teredo"))", the root cause is the 
NetworkInterface may return null if no display name is available.
so the fix is to make sure the display name is not null before 
calling the method "contains("Teredo")", something like "if 
(isWindows && displayName != null && displayName.contains("Teredo"))"


Please let me know if you have any comment. The webrev will be sent 
after internal review.
Yes, NetworkInterface's getDisplyName is allowed to return null and 
it looks like this wasn't taken into account when these tests were 
changed via JDK-8022963 to skip tunnels. Once you have a patch then 
net-dev would be the best list to bring it to.


-Alan.


Thanks Alan to suggest the correct alias!
Below is the webrev for this bug, Can you or anyone else help to 
review the fix?
http://cr.openjdk.java.net/~ewang/JDK-8035633/webrev.00/ 



There is one more closed test fixed, it will be sent in another mail.

Thanks,
Eric






Re: RFR for bug JDK-8035633 TEST_BUG: java/net/NetworkInterface/Equals.java and some tests failed on windows intermittently

2014-02-27 Thread Eric Wang

Hi Ivan & Chris,

Thank you for the comments. I have corrected the typo in the comment and 
reverted the year of copyright. Please help to review it again.
http://cr.openjdk.java.net/~ewang/JDK-8035633/webrev.01/ 



Chris, Could you please be my sponsor to push the fix, if it looks OK.

Thanks a lot!
Eric
On 2014/2/27 17:48, Ivan Gerasimov wrote:

Hello Eric

Would you please also correct the comment on the line above your change:
s/seudo/pseudo/

The typo is in all three files.

Sincerely yours,
Ivan


On 27.02.2014 12:18, Eric Wang wrote:

On 2014/2/25 16:59, Alan Bateman wrote:

On 25/02/2014 08:49, Eric Wang wrote:

Hi Everyone,

I'm working on the test bug 
https://bugs.openjdk.java.net/browse/JDK-8035633, There are 4 tests 
(one is in a closed test) failed due to NullPointerException.
All tests failed at similar places "if (isWindows && 
ni.getDisplayName().contains("Teredo"))", the root cause is the 
NetworkInterface may return null if no display name is available.
so the fix is to make sure the display name is not null before 
calling the method "contains("Teredo")", something like "if 
(isWindows && displayName != null && displayName.contains("Teredo"))"


Please let me know if you have any comment. The webrev will be sent 
after internal review.
Yes, NetworkInterface's getDisplyName is allowed to return null and 
it looks like this wasn't taken into account when these tests were 
changed via JDK-8022963 to skip tunnels. Once you have a patch then 
net-dev would be the best list to bring it to.


-Alan.


Thanks Alan to suggest the correct alias!
Below is the webrev for this bug, Can you or anyone else help to 
review the fix?
http://cr.openjdk.java.net/~ewang/JDK-8035633/webrev.00/ 



There is one more closed test fixed, it will be sent in another mail.

Thanks,
Eric








RFR[9](M): 8035949 : Remove unused macro USE_SELECT and clean up Unix version of net_util_md.{c,h}

2014-02-27 Thread Volker Simonis
Hi,

could you please review the following clean-up change (for a better
formatted description please see the webrev):

http://cr.openjdk.java.net/~simonis/webrevs/8035949/
https://bugs.openjdk.java.net/browse/JDK-8035949

This change removes some unused code and macros from
src/solaris/native/java/net/net_util_md.{c,h} and its dependent files.
It also fixes a small bug which was introduced by 7112670
Inet4AddressImpl should use getaddrinfo/getnameinfo after which we
didn't call gai_strerror() any more.

The change has been build and tested (with the jdk JTreg regression
tests) on Linux/x86_64/ppc64, AIX/ppc64, Solaris/sparcv9 and MacOS X
but I won't be upset if somebody wants to run this through JPRT or any
other automatic test suite :)

Remove USE_SELECT macro.

The macro isn't defined in any Makefile so it can never be defined in
the actual build. So I simply removed all preprocessor tests for
USE_SELECT by:

- unconditionally making the code available which was guarded by
#ifndef USE_SELECT
- removing all code which was guarded by #ifdef USE_SELECT.
- in src/solaris/native/java/net/solaris_close.c I removed the
definition of NET_Select() although this was not guarded by #ifdef
USE_SELECT like the other platform implementations. But NET_Select()
isn't used anywhere else in the code so that should be OK.

src/solaris/native/java/net/net_util_md.{c,h}

- Remove unused typdefs for getaddrinfo_f, freeaddrinfo_f,
getnameinfo_f and gai_strerror_f. gai_strerror_f was actually still
used in src/solaris/native/java/net/net_util_md.c to declare
gai_strerror_ptr. But after the change "7112670: Inet4AddressImpl
should use getaddrinfo/getnameinfo" removed its initialization,
gai_strerror_ptr was always NULL. I think the right solution is to
just call gai_strerror() directly, like this is done with
getaddrinfo()/getnameinfo() after 7112670. And that's exactly what
this change does.
- Removed unused globals getaddrinfo_ptr, freeaddrinfo_ptr and getnameinfo_ptr.
- Rename ThrowUnknownHostExceptionWithGaiError() to
NET_ThrowUnknownHostExceptionWithGaiError() to conform to the other
functions declared in this file (especially
NET_ThrowByNameWithLastError()).
- Reorder the functions such that all NET_ functions are declared at
the beginning of the file and the other utility functions at the end
(as indicated by the comments).

src/aix/native/java/net/aix_close.c
src/solaris/native/java/net/bsd_close.c
src/solaris/native/java/net/linux_close.c
src/solaris/native/java/net/solaris_close.c

- Remove unused NET_Select() function which was previously guarded by
#ifdef USE_SELECT.

src/solaris/native/java/net/Inet4AddressImpl.c
src/solaris/native/java/net/Inet6AddressImpl.c

- Rename ThrowUnknownHostExceptionWithGaiError() to
NET_ThrowUnknownHostExceptionWithGaiError().

Thank you and best regards,
Volker