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]

FYI: Patch: java.net: impl and getImpl().


Hi list,



I commited the attached patch to fix the impl vs getImpl() issue discussed 
earlier with Mohan and Tom.


Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2354
diff -u -b -B -r1.2354 ChangeLog
--- ChangeLog	24 Nov 2003 16:55:40 -0000	1.2354
+++ ChangeLog	24 Nov 2003 21:52:40 -0000
@@ -1,5 +1,16 @@
 2003-11-24  Michael Koch  <konqueror@gmx.de>
 
+	* java/net/ServerSocket.java
+	(accept): Renamed s to socket.
+	(implAccept): Renamed s to socket, use getImpl() instead of impl
+	directly.
+	* java/net/Socket.java
+	(impl): Made private.
+	(getImpl()): Made packge-private to make it accessible from
+	java.net.ServerSocket, added comment about this.
+
+2003-11-24  Michael Koch  <konqueror@gmx.de>
+
 	* javax/swing/BoxLayout.java
 	(serialVersionUIR): New member variable.
 	(X_AXIS, Y_AXIS): Documentation added.
Index: java/net/ServerSocket.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/ServerSocket.java,v
retrieving revision 1.28
diff -u -b -B -r1.28 ServerSocket.java
--- java/net/ServerSocket.java	11 Oct 2003 18:01:35 -0000	1.28
+++ java/net/ServerSocket.java	24 Nov 2003 21:52:40 -0000
@@ -303,10 +303,9 @@
     if (sm != null)
       sm.checkListen (impl.getLocalPort ());
 
-    Socket s = new Socket();
-    implAccept (s);
-
-    return s;
+    Socket socket = new Socket();
+    implAccept (socket);
+    return socket;
   }
 
   /**
@@ -322,14 +321,14 @@
    *
    * @since 1.1
    */
-  protected final void implAccept (Socket s)
+  protected final void implAccept (Socket socket)
     throws IOException
   {
     if (getChannel() != null
         && !getChannel().isBlocking())
       throw new IllegalBlockingModeException();
 	    
-    impl.accept(s.impl);
+    impl.accept(socket.getImpl());
   }
 
   /**
Index: java/net/Socket.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/Socket.java,v
retrieving revision 1.29
diff -u -b -B -r1.29 Socket.java
--- java/net/Socket.java	19 Nov 2003 08:34:21 -0000	1.29
+++ java/net/Socket.java	24 Nov 2003 21:52:40 -0000
@@ -82,7 +82,7 @@
   /**
    * The implementation object to which calls are redirected
    */
-  SocketImpl impl;
+  private SocketImpl impl;
 
   private boolean implCreated = false;
 
@@ -298,7 +298,8 @@
     // that default.  JDK 1.2 doc infers not to do a bind.
   }
 
-  private SocketImpl getImpl()
+  // This has to be accessible from java.net.ServerSocket.
+  SocketImpl getImpl()
     throws SocketException
   {
     try

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