summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-14 11:53:02 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-14 11:53:02 +0000
commitd493b8a1d36cc7a1dd0a3541c0b2b5779efd4404 (patch)
treeb079e077f62874b5e1b42c98455301dc0d73a902
parent4faba3def3f57302ce1c0b192c2c5790a0143c60 (diff)
downloadppe42-gcc-d493b8a1d36cc7a1dd0a3541c0b2b5779efd4404.tar.gz
ppe42-gcc-d493b8a1d36cc7a1dd0a3541c0b2b5779efd4404.zip
2003-06-14 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileChannelImpl.java (map_address): Removed incorrect comment. * gnu/java/nio/SelectorImpl.java (register): Remove code duplication and code for file channel handling. * gnu/java/nio/ServerSocketChannelImpl.java (serverSocket): Renamed from sock_object. (ServerSocketChannel): Initialize serverSocket. (socket): Return serverSocket. * gnu/java/nio/SocketChannelImpl.java (socket): Renamed from sock_object. (isConnectionPenging): Simplified. (socket): Return socket. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67940 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog14
-rw-r--r--libjava/gnu/java/nio/FileChannelImpl.java3
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java39
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java6
-rw-r--r--libjava/gnu/java/nio/SocketChannelImpl.java14
5 files changed, 34 insertions, 42 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 59e7b5aa9a2..f2d62925748 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,19 @@
2003-06-14 Michael Koch <konqueror@gmx.de>
+ * gnu/java/nio/FileChannelImpl.java
+ (map_address): Removed incorrect comment.
+ * gnu/java/nio/SelectorImpl.java
+ (register): Remove code duplication and code for file channel handling.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (serverSocket): Renamed from sock_object.
+ (ServerSocketChannel): Initialize serverSocket.
+ (socket): Return serverSocket.
+ * gnu/java/nio/SocketChannelImpl.java
+ (socket): Renamed from sock_object.
+ (isConnectionPenging): Simplified.
+ (socket): Return socket.
+2003-06-14 Michael Koch <konqueror@gmx.de>
+
* java/security/BasicPermission.java:
New version from classpath.
diff --git a/libjava/gnu/java/nio/FileChannelImpl.java b/libjava/gnu/java/nio/FileChannelImpl.java
index 79a7a58eb90..cedf3978682 100644
--- a/libjava/gnu/java/nio/FileChannelImpl.java
+++ b/libjava/gnu/java/nio/FileChannelImpl.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
import java.io.EOFException;
@@ -64,8 +65,6 @@ import gnu.gcj.RawData;
public class FileChannelImpl extends FileChannel
{
- // GCJ LOCAL: This variable stores a pointer to the memory
- // where the file is mapped.
RawData map_address;
int length;
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
index e3eed255501..f2281a68d5a 100644
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ b/libjava/gnu/java/nio/SelectorImpl.java
@@ -250,50 +250,31 @@ public class SelectorImpl extends AbstractSelector
protected SelectionKey register (AbstractSelectableChannel ch, int ops,
Object att)
{
-// // filechannel is not selectable ?
-// if (ch instanceof FileChannelImpl)
-// {
-// FileChannelImpl fc = (FileChannelImpl) ch;
-// SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, fc.fd);
-// keys.add (impl);
-// impl.interestOps (ops);
-// impl.attach (att);
-// return impl;
-// }
-// else
-
+ SelectionKeyImpl result;
+
if (ch instanceof SocketChannelImpl)
{
SocketChannelImpl sc = (SocketChannelImpl) ch;
- SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, sc.fd);
- add (impl);
- impl.interestOps (ops);
- impl.attach (att);
- return impl;
+ result = new SelectionKeyImpl (ch, this, sc.fd);
}
else if (ch instanceof DatagramChannelImpl)
{
DatagramChannelImpl dc = (DatagramChannelImpl) ch;
- SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, dc.fd);
- add (impl);
- impl.interestOps (ops);
- impl.attach (att);
- return impl;
+ result = new SelectionKeyImpl (ch, this, dc.fd);
}
else if (ch instanceof ServerSocketChannelImpl)
{
ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
- SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, ssc.fd);
- add (impl);
- impl.interestOps (ops);
- impl.attach (att);
- return impl;
+ result = new SelectionKeyImpl (ch, this, ssc.fd);
}
else
{
- System.err.println ("INTERNAL ERROR, no known channel type");
+ throw new InternalError ("No known channel type");
}
- return null;
+ add (result);
+ result.interestOps (ops);
+ result.attach (att);
+ return result;
}
}
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index 0b3fc66e981..aded2207880 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -47,7 +47,7 @@ import java.nio.channels.spi.SelectorProvider;
class ServerSocketChannelImpl extends ServerSocketChannel
{
- ServerSocket sock_object;
+ ServerSocket serverSocket;
int fd;
// int local_port;
boolean blocking = true;
@@ -62,7 +62,7 @@ class ServerSocketChannelImpl extends ServerSocketChannel
try
{
- sock_object = new ServerSocket ();
+ serverSocket = new ServerSocket ();
}
catch (IOException e)
{
@@ -106,6 +106,6 @@ class ServerSocketChannelImpl extends ServerSocketChannel
public ServerSocket socket ()
{
- return sock_object;
+ return serverSocket;
}
}
diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java
index 48cf585cb05..820d62f3b6c 100644
--- a/libjava/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/gnu/java/nio/SocketChannelImpl.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
import java.io.IOException;
@@ -50,7 +51,7 @@ import gnu.classpath.Configuration;
public class SocketChannelImpl extends SocketChannel
{
- Socket sock_object;
+ Socket socket;
int fd;
int local_port;
boolean blocking = true;
@@ -141,20 +142,17 @@ public class SocketChannelImpl extends SocketChannel
public boolean isConnectionPending ()
{
- if (blocking)
- return true;
-
- return false;
+ return blocking ? true : false;
}
public Socket socket ()
{
- if (sock_object != null)
+ if (socket != null)
{
- //sock_object.ch = this;
+ //socket.ch = this;
}
- return sock_object;
+ return socket;
}
public int read (ByteBuffer dst) throws IOException
OpenPOWER on IntegriCloud