changeset 536:a1b1ad4811d5

Cleanups before pushing 4640544 to jdk7
author alanb
date Sat, 23 Aug 2008 15:44:24 +0100
parents 3ad90c246ac7
children 60c2df70a57c
files src/share/classes/sun/nio/ch/DatagramChannelImpl.java src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java src/share/classes/sun/nio/ch/SocketChannelImpl.java src/solaris/native/sun/nio/ch/Net.c src/windows/native/sun/nio/ch/Net.c test/java/nio/channels/TestUtil.java
diffstat 6 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Sat Aug 23 15:38:19 2008 +0100
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Sat Aug 23 15:44:24 2008 +0100
@@ -62,8 +62,8 @@
 
     // Cached InetAddress and port for unconnected DatagramChannels
     // used by receive0
-    private InetAddress cachedSenderInetAddress = null;
-    private int cachedSenderPort = 0;
+    private InetAddress cachedSenderInetAddress;
+    private int cachedSenderPort;
 
     // Lock held by current reading or connecting thread
     private final Object readLock = new Object();
@@ -85,14 +85,14 @@
     private int state = ST_UNINITIALIZED;
 
     // Binding
-    private SocketAddress localAddress = null;
-    private SocketAddress remoteAddress = null;
+    private SocketAddress localAddress;
+    private SocketAddress remoteAddress;
 
     // Our socket adaptor, if any
-    private DatagramSocket socket = null;
+    private DatagramSocket socket;
 
     // Multicast support
-    private MembershipRegistry registry = null;
+    private MembershipRegistry registry;
 
     // -- End of fields protected by stateLock
 
--- a/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Sat Aug 23 15:38:19 2008 +0100
+++ b/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Sat Aug 23 15:44:24 2008 +0100
@@ -74,7 +74,7 @@
     private int state = ST_UNINITIALIZED;
 
     // Binding
-    private SocketAddress localAddress = null; // null => unbound
+    private SocketAddress localAddress; // null => unbound
 
     // Our socket adaptor, if any
     ServerSocket socket;
--- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Sat Aug 23 15:38:19 2008 +0100
+++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Sat Aug 23 15:44:24 2008 +0100
@@ -60,7 +60,7 @@
     // Lock held by current reading or connecting thread
     private final Object readLock = new Object();
 
-    // Lock held by current writing or connecting threatod
+    // Lock held by current writing or connecting thread
     private final Object writeLock = new Object();
 
     // Lock held by any thread that modifies the state fields declared below
@@ -79,8 +79,8 @@
     private int state = ST_UNINITIALIZED;
 
     // Binding
-    private SocketAddress localAddress = null;
-    private SocketAddress remoteAddress = null;
+    private SocketAddress localAddress;
+    private SocketAddress remoteAddress;
 
     // Input/Output open
     private boolean isInputOpen = true;
@@ -88,7 +88,7 @@
     private boolean readyToConnect = false;
 
     // Socket adaptor, created on demand
-    private Socket socket = null;
+    private Socket socket;
 
     // -- End of fields protected by stateLock
 
--- a/src/solaris/native/sun/nio/ch/Net.c	Sat Aug 23 15:38:19 2008 +0100
+++ b/src/solaris/native/sun/nio/ch/Net.c	Sat Aug 23 15:44:24 2008 +0100
@@ -537,7 +537,10 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_Net_shutdown(JNIEnv *env, jclass cl, jobject fdo, jint how) {
+Java_sun_nio_ch_Net_shutdown(JNIEnv *env, jclass cl, jobject fdo, jint jhow)
+{
+    int how = (jhow == sun_nio_ch_Net_SHUT_RD) ? SHUT_RD :
+        (jhow == sun_nio_ch_Net_SHUT_WR) ? SHUT_WR : SHUT_RDWR;
     if (shutdown(fdval(env, fdo), how) < 0)
         handleSocketError(env, errno);
 }
--- a/src/windows/native/sun/nio/ch/Net.c	Sat Aug 23 15:38:19 2008 +0100
+++ b/src/windows/native/sun/nio/ch/Net.c	Sat Aug 23 15:44:24 2008 +0100
@@ -483,7 +483,9 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_Net_shutdown(JNIEnv *env, jclass cl, jobject fdo, jint how) {
+Java_sun_nio_ch_Net_shutdown(JNIEnv *env, jclass cl, jobject fdo, jint jhow) {
+    int how = (jhow == sun_nio_ch_Net_SHUT_RD) ? SD_RECEIVE :
+        (jhow == sun_nio_ch_Net_SHUT_WR) ? SD_SEND : SD_BOTH;
     if (shutdown(fdval(env, fdo), how) == SOCKET_ERROR) {
         NET_ThrowNew(env, WSAGetLastError(), "shutdown");
     }
--- a/test/java/nio/channels/TestUtil.java	Sat Aug 23 15:38:19 2008 +0100
+++ b/test/java/nio/channels/TestUtil.java	Sat Aug 23 15:44:24 2008 +0100
@@ -38,7 +38,7 @@
     // executing in a different network.
     public static final String HOST = "javaweb.sfbay.sun.com";
     public static final String REFUSING_HOST = "jano1.sfbay.sun.com";
-    public static final String FAR_HOST = "theclub.ireland.sun.com";
+    public static final String FAR_HOST = "irejano.ireland.sun.com";
     public static final String UNRESOLVABLE_HOST = "blah-blah.blah-blah.blah";
 
     private TestUtil() { }
@@ -102,5 +102,4 @@
     static boolean onWindows() {
         return osName.startsWith("Windows");
     }
-
 }