[PATCH] InetAddress windows fix

Andrew gnu.andrew at redhat.com
Fri Jan 17 10:38:10 PST 2014



----- Original Message -----
> 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
> 
> 

I'm ok with the parts of this that mirror the UNIX changes.  What strikes me as odd is:

-void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {
+JNIEXPORT
+void JNICALL setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {

Why was this necessary?  The UNIX files use these functions without this change.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



More information about the jdk6-dev mailing list