Hi, this small patch cleans some imports and 'new Integer' invocations to 'Integer.valueOf'.
This is in preparation of getting the latest Classpath changes in the NIO area
to gcj.
ChangeLog:
2006-09-27 Robert Schuster <[EMAIL PROTECTED]>
* vm/reference/gnu/java/nio/VMChannel.java: Removed unneeded imports.
* vm/reference/gnu/java/nio/VMPipe.java: Removed unneeded imports.
* gnu/java/nio/EpollSelectorImpl.java:
(doSelect): Use Integer.valueOf() instead of constructor call.
(register): Use Integer.valueOf() instead of constructor call.
cya
Robert
Index: gnu/java/nio/EpollSelectorImpl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/EpollSelectorImpl.java,v
retrieving revision 1.3
diff -u -r1.3 EpollSelectorImpl.java
--- gnu/java/nio/EpollSelectorImpl.java 23 Sep 2006 06:44:13 -0000 1.3
+++ gnu/java/nio/EpollSelectorImpl.java 27 Sep 2006 21:20:02 -0000
@@ -138,7 +138,7 @@
EpollSelectionKeyImpl key = (EpollSelectionKeyImpl) it.next();
epoll_delete(epoll_fd, key.fd);
key.valid = false;
- keys.remove(new Integer(key.fd));
+ keys.remove(Integer.valueOf(key.fd));
it.remove();
}
@@ -161,7 +161,7 @@
ByteBuffer b = selected.slice();
int fd = selected_fd(b);
EpollSelectionKeyImpl key
- = (EpollSelectionKeyImpl) keys.get(new Integer(fd));
+ = (EpollSelectionKeyImpl) keys.get(Integer.valueOf(fd));
if (key == null)
throw new IOException("fd was selected, but no key found");
key.selectedOps = selected_ops(b) & key.interestOps;
@@ -228,7 +228,7 @@
int native_fd = channel.getState().getNativeFD();
synchronized (keys)
{
- if (keys.containsKey(new Integer(native_fd)))
+ if (keys.containsKey(Integer.valueOf(native_fd)))
throw new IllegalArgumentException("channel already registered");
EpollSelectionKeyImpl result =
new EpollSelectionKeyImpl(this, ch, native_fd);
@@ -240,7 +240,7 @@
result.attach(att);
result.key = System.identityHashCode(result);
epoll_add(epoll_fd, result.fd, ops);
- keys.put(new Integer(native_fd), result);
+ keys.put(Integer.valueOf(native_fd), result);
return result;
}
}
Index: vm/reference/gnu/java/nio/VMChannel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/reference/gnu/java/nio/VMChannel.java,v
retrieving revision 1.3
diff -u -r1.3 VMChannel.java
--- vm/reference/gnu/java/nio/VMChannel.java 25 Sep 2006 21:54:44 -0000 1.3
+++ vm/reference/gnu/java/nio/VMChannel.java 27 Sep 2006 21:20:02 -0000
@@ -39,12 +39,7 @@
package gnu.java.nio;
import gnu.classpath.Configuration;
-import gnu.classpath.Pointer;
import gnu.classpath.jdwp.exception.NotImplementedException;
-import gnu.java.net.PlainSocketImpl;
-import gnu.java.nio.PipeImpl.SinkChannelImpl;
-import gnu.java.nio.PipeImpl.SourceChannelImpl;
-import gnu.java.nio.FileChannelImpl;
import java.io.IOException;
import java.net.Inet4Address;
Index: vm/reference/gnu/java/nio/VMPipe.java
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/reference/gnu/java/nio/VMPipe.java,v
retrieving revision 1.3
diff -u -r1.3 VMPipe.java
--- vm/reference/gnu/java/nio/VMPipe.java 17 Sep 2006 07:31:43 -0000 1.3
+++ vm/reference/gnu/java/nio/VMPipe.java 27 Sep 2006 21:20:02 -0000
@@ -38,7 +38,6 @@
package gnu.java.nio;
import java.io.IOException;
-import java.nio.channels.spi.SelectorProvider;
import gnu.classpath.Configuration;
/**
signature.asc
Description: OpenPGP digital signature
