This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: socket timeout patch: formatting changes




Here's a small formatting change diff for the class
PlainSocketImpl.java.

It would really help me if this was applied to the CVS (I can more
easily merge my real changes).


Note: I've not paid much attention to line breaks, the rest of the
code doesn't seem to. Are line breaks *such* an issue these days?



Nic


Index: PlainSocketImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/PlainSocketImpl.java,v
retrieving revision 1.8
diff -u -r1.8 PlainSocketImpl.java
--- PlainSocketImpl.java	2000/12/08 10:28:32	1.8
+++ PlainSocketImpl.java	2001/12/12 21:56:03
@@ -9,19 +9,17 @@
 details.  */
 
 package java.net;
-import java.io.*;
 
-/**
- * @author Per Bothner <bothner@cygnus.com>
- * @date February 22, 1999.
- */
+import java.io.*;
 
 /**
  * Written using on-line Java Platform 1.2 API Specification, as well
  * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
  * Status:  Believed complete and correct.
+ *
+ * @author Per Bothner <bothner@cygnus.com>
+ * @date February 22, 1999.
  */
-
 class PlainSocketImpl extends SocketImpl
 {
   // These fields are mirrored for use in native code to avoid cpp conflicts
@@ -35,6 +33,18 @@
                    _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF,
                    _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF;
 
+  /** the socket's file handle.
+   * This is the socket handle that is returned from the creation
+   * of the socket. It is used for read and writes to the socket and
+   * to close the socket.
+   *
+   * {@link SocketImpl#fd} is created from this like so:
+   * <pre>
+   *   fd=new FileDescriptor(fnum);
+   * </pre>
+   *
+   * When the socket is closed this is reset to -1.
+   */
   int fnum = -1;
 
   // This value is set/read by setOption/getOption.
@@ -43,9 +53,9 @@
   // localAddress cache
   InetAddress localAddress;
 
-  public native void setOption(int optID, Object value) throws SocketException;
+  public native void setOption (int optID, Object value) throws SocketException;
 
-  public native Object getOption(int optID) throws SocketException;
+  public native Object getOption (int optID) throws SocketException;
 
   protected native void create (boolean stream)  throws IOException;
 
@@ -62,6 +72,7 @@
   protected native void listen (int backlog) throws IOException;
 
   private native void accept (PlainSocketImpl s) throws IOException;
+  
   protected void accept (SocketImpl s) throws IOException
   {
     accept((PlainSocketImpl) s);
@@ -70,7 +81,7 @@
   private InputStream in;
   private OutputStream out;
 
-  protected InputStream getInputStream() throws IOException
+  protected InputStream getInputStream () throws IOException
   {
     // FIXME: TODO - Implement class SocketInputStream timeouts in read();
     if (in == null)
@@ -78,7 +89,7 @@
     return in;
   }
 
-  protected OutputStream getOutputStream() throws IOException
+  protected OutputStream getOutputStream () throws IOException
   {
     if (out == null)
       out = new FileOutputStream (fd);
@@ -87,12 +98,14 @@
 
   protected int available () throws IOException
   {
-    return in.available();
+    return in.available ();
   }
 
   protected void close () throws IOException
   {
-    if (fd.valid())
-      fd.close();
+    if (fd.valid ())
+      fd.close ();
   }
 }
+
+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]