harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r417737 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java
Date Wed, 28 Jun 2006 11:56:20 GMT
Author: gharley
Date: Wed Jun 28 04:56:20 2006
New Revision: 417737

URL: http://svn.apache.org/viewvc?rev=417737&view=rev
Log:
HARMONY 686 : Refactor SocketAdapter.checkClosedAndCreate(boolean) in o.a.h.nio.internal.SocketChannelImpl

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java?rev=417737&r1=417736&r2=417737&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/SocketChannelImpl.java
Wed Jun 28 04:56:20 2006
@@ -769,7 +769,7 @@
          * @see java.net.Socket#getKeepAlive()
          */
         public boolean getKeepAlive() throws SocketException {
-            checkClosedAndCreate(true);
+            checkOpen();
             return ((Boolean) socketImpl.getOption(SocketOptions.SO_KEEPALIVE))
                     .booleanValue();
         }
@@ -779,7 +779,7 @@
          * @see java.net.Socket#getOOBInline()
          */
         public boolean getOOBInline() throws SocketException {
-            checkClosedAndCreate(true);
+            checkOpen();
             return ((Boolean) socketImpl.getOption(SocketOptions.SO_OOBINLINE))
                     .booleanValue();
         }
@@ -789,7 +789,7 @@
          * @see java.net.Socket#getSoLinger()
          */
         public int getSoLinger() throws SocketException {
-            checkClosedAndCreate(true);
+            checkOpen();
             return ((Integer) socketImpl.getOption(SocketOptions.SO_LINGER))
                     .intValue();
         }
@@ -799,7 +799,7 @@
          * @see java.net.Socket#getTcpNoDelay()
          */
         public boolean getTcpNoDelay() throws SocketException {
-            checkClosedAndCreate(true);
+            checkOpen();
             return ((Boolean) socketImpl.getOption(SocketOptions.TCP_NODELAY))
                     .booleanValue();
         }
@@ -822,18 +822,12 @@
         }
 
         /*
-         * checl if channel is close or create a new one.
+         * Checks whether the channel is open
          */
-        private void checkClosedAndCreate(boolean create)
-                throws SocketException {
+        private void checkOpen() throws SocketException {
             if (isClosed()) {
                 throw new SocketException(Msg.getString(ERRCODE_CHANNEL_CLOSED));
             }
-            if (!create && !isConnected()) {
-                throw new SocketException(Msg
-                        .getString(ERRCODE_CHANNEL_NOT_CONNECTED));
-            }
-            // FIXME check if need cread fd
         }
 
         /*



Mime
View raw message