[PATCH] InetAddress windows fix

Alex Kasko mail at alexkasko.com
Thu Jan 2 23:47:06 PST 2014


Hi,

ServerSocketChannel and some other network classes are broken in windows 
6b29 after d621c66dd504 changes [1]. Fields hostName, address and family 
were removed from InetAddress class [2]. Access to these fields was 
reimplemented through getters/setters in java.net module 
(setInetAddress_addr(...) etc), but they are still referenced directly 
from native code in windows networking implementation [3] 
(Java_sun_nio_ch_ServerSocketChannelImpl_initIDs function). So Tomcat 
won't start in Windows with "No such field error" thrown from native code.

I exported getters and setters for address and family and use them in 
sun.nio.ch too,
webrev - 
http://cr.openjdk.java.net/~akasko/jdk6/webrev_inet_addr_windows.01/

I am not fully comprehending mapfile-vers logic, maybe its changes are 
not needed here.

Results were tested running Tomcat in windows and linux.


[1] http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/d621c66dd504
[2] 
http://hg.openjdk.java.net/jdk6/jdk6/jdk/diff/d621c66dd504/src/share/classes/java/net/InetAddress.java
[3] 
http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/956e1047786a/src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c

-- 
Regards,
Alex Kasko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3742 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.openjdk.java.net/pipermail/jdk6-dev/attachments/20140103/4278b6ef/smime.p7s 


More information about the jdk6-dev mailing list