[Patch] some little cleanups
Michael Koch
konqueror@gmx.de
Sat Feb 19 09:31:00 GMT 2005
Hi list,
I commited the attached patch under the "obvious"-rule. I hope this is
okay. It merges some little differences to GNU classpath.
Michael
2005-02-19 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/SelectorImpl.java:
Reworked import statements.
(register): Removed unused code.
* java/nio/channels/Channels.java: Reformatted.
* java/nio/charset/Charset.java: Likewise.
* java/rmi/server/RemoteObject.java
(serialVersionUID): Made private.
* java/rmi/server/UID.java
(serialVersionUID): Likewise.
-------------- next part --------------
Index: gnu/java/nio/SelectorImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/SelectorImpl.java,v
retrieving revision 1.15
diff -u -r1.15 SelectorImpl.java
--- gnu/java/nio/SelectorImpl.java 24 Sep 2004 06:41:57 -0000 1.15
+++ gnu/java/nio/SelectorImpl.java 19 Feb 2005 09:02:49 -0000
@@ -1,5 +1,5 @@
/* SelectorImpl.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@
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;
@@ -49,11 +50,9 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import gnu.classpath.Configuration;
public class SelectorImpl extends AbstractSelector
{
-
private Set keys;
private Set selected;
@@ -375,24 +374,13 @@
SelectionKeyImpl result;
if (ch instanceof SocketChannelImpl)
- {
- SocketChannelImpl sc = (SocketChannelImpl) ch;
- result = new SocketChannelSelectionKey (ch, this);
- }
+ result = new SocketChannelSelectionKey (ch, this);
else if (ch instanceof DatagramChannelImpl)
- {
- DatagramChannelImpl dc = (DatagramChannelImpl) ch;
- result = new DatagramChannelSelectionKey (ch, this);
- }
+ result = new DatagramChannelSelectionKey (ch, this);
else if (ch instanceof ServerSocketChannelImpl)
- {
- ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
- result = new ServerSocketChannelSelectionKey (ch, this);
- }
+ result = new ServerSocketChannelSelectionKey (ch, this);
else
- {
- throw new InternalError ("No known channel type");
- }
+ throw new InternalError ("No known channel type");
synchronized (keys)
{
Index: java/nio/channels/Channels.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/channels/Channels.java,v
retrieving revision 1.11
diff -u -r1.11 Channels.java
--- java/nio/channels/Channels.java 18 Nov 2004 15:26:38 -0000 1.11
+++ java/nio/channels/Channels.java 19 Feb 2005 09:02:49 -0000
@@ -1,5 +1,5 @@
/* Channels.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.nio.channels;
import gnu.java.nio.ChannelInputStream;
@@ -62,7 +63,10 @@
/**
* This class isn't intended to be instantiated.
*/
- private Channels() {}
+ private Channels()
+ {
+ // Do nothing here.
+ }
/**
* Constructs a stream that reads bytes from the given channel.
Index: java/nio/charset/Charset.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/charset/Charset.java,v
retrieving revision 1.8
diff -u -r1.8 Charset.java
--- java/nio/charset/Charset.java 18 Feb 2005 07:44:59 -0000 1.8
+++ java/nio/charset/Charset.java 19 Feb 2005 09:02:49 -0000
@@ -147,19 +147,19 @@
* Retrieves a charset for the given charset name.
*
* @return A charset object for the charset with the specified name, or
- * <code>null</code> if no such charset exists.
+ * <code>null</code> if no such charset exists.
*
* @throws IllegalCharsetNameException if the name is illegal
*/
- private static Charset charsetForName (String charsetName)
+ private static Charset charsetForName(String charsetName)
{
checkName (charsetName);
return provider ().charsetForName (charsetName);
}
- public static SortedMap availableCharsets ()
+ public static SortedMap availableCharsets()
{
- TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER);
+ TreeMap charsets = new TreeMap(String.CASE_INSENSITIVE_ORDER);
for (Iterator i = provider ().charsets (); i.hasNext (); )
{
@@ -167,15 +167,15 @@
charsets.put (cs.name (), cs);
}
- return Collections.unmodifiableSortedMap (charsets);
+ return Collections.unmodifiableSortedMap(charsets);
}
// XXX: we need to support multiple providers, reading them from
// java.nio.charset.spi.CharsetProvider in the resource directory
// META-INF/services
- private static CharsetProvider provider ()
+ private static CharsetProvider provider()
{
- return Provider.provider ();
+ return Provider.provider();
}
public final String name ()
Index: java/rmi/server/RemoteObject.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/rmi/server/RemoteObject.java,v
retrieving revision 1.6
diff -u -r1.6 RemoteObject.java
--- java/rmi/server/RemoteObject.java 16 Feb 2005 18:51:22 -0000 1.6
+++ java/rmi/server/RemoteObject.java 19 Feb 2005 09:02:49 -0000
@@ -50,7 +50,7 @@
public abstract class RemoteObject
implements Remote, Serializable {
-public static final long serialVersionUID = -3215090123894869218l;
+private static final long serialVersionUID = -3215090123894869218l;
protected transient RemoteRef ref;
Index: java/rmi/server/UID.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/rmi/server/UID.java,v
retrieving revision 1.5
diff -u -r1.5 UID.java
--- java/rmi/server/UID.java 21 Oct 2004 20:14:03 -0000 1.5
+++ java/rmi/server/UID.java 19 Feb 2005 09:02:49 -0000
@@ -45,7 +45,7 @@
public final class UID implements Serializable
{
-public static final long serialVersionUID = 1086053664494604050L;
+private static final long serialVersionUID = 1086053664494604050L;
private static final Object lock = UID.class;
private static long baseTime = System.currentTimeMillis();
More information about the Java-patches
mailing list