diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-11 18:22:09 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-11 18:22:09 +0000 |
commit | 3e38401205b9ce29b86b1a8606095adabd35b585 (patch) | |
tree | 3b860ef7c7b10bd3123183217455386411e1a248 /libjava | |
parent | a0f7343c29c1b9c563a063af23e90798219daf2c (diff) | |
download | gcc-3e38401205b9ce29b86b1a8606095adabd35b585.tar.gz |
2004-02-11 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java
(setReuseAddress): Use Boolean.valueOf() instead of creating a new
Boolean object.
(setBroadcast): Likewise.
* java/net/MulticastSocket.java
(setLoopbackMode): Likewise.
* java/net/ServerSocket.java
(setReuseAddress): Likewise.
* java/net/Socket.java
(setTcpNoDelay): Likewise.
(setSoLinger): Likewise.
(setOOBInline): Likewise.
(setKeepAlive): Likewise.
(setReuseAddress): Likewise.
* java/net/URLConnection.java
(setContentHandler): Replace == with equals().
* java/net/URLStreamHandler.java
(hostSEquals): Fix checking host addresses.
(toExternalForm): Dont check protocol for null. We know already its
not null.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77670 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 23 | ||||
-rw-r--r-- | libjava/java/net/DatagramSocket.java | 4 | ||||
-rw-r--r-- | libjava/java/net/MulticastSocket.java | 2 | ||||
-rw-r--r-- | libjava/java/net/ServerSocket.java | 2 | ||||
-rw-r--r-- | libjava/java/net/Socket.java | 10 | ||||
-rw-r--r-- | libjava/java/net/URLConnection.java | 2 | ||||
-rw-r--r-- | libjava/java/net/URLStreamHandler.java | 4 |
7 files changed, 35 insertions, 12 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ba68afef486..db67e406552 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,26 @@ +2004-02-11 Michael Koch <konqueror@gmx.de> + + * java/net/DatagramSocket.java + (setReuseAddress): Use Boolean.valueOf() instead of creating a new + Boolean object. + (setBroadcast): Likewise. + * java/net/MulticastSocket.java + (setLoopbackMode): Likewise. + * java/net/ServerSocket.java + (setReuseAddress): Likewise. + * java/net/Socket.java + (setTcpNoDelay): Likewise. + (setSoLinger): Likewise. + (setOOBInline): Likewise. + (setKeepAlive): Likewise. + (setReuseAddress): Likewise. + * java/net/URLConnection.java + (setContentHandler): Replace == with equals(). + * java/net/URLStreamHandler.java + (hostSEquals): Fix checking host addresses. + (toExternalForm): Dont check protocol for null. We know already its + not null. + 2004-02-10 David Jee <djee@redhat.com> * java/awt/BorderLayout.java diff --git a/libjava/java/net/DatagramSocket.java b/libjava/java/net/DatagramSocket.java index c5920a09424..895db94fa52 100644 --- a/libjava/java/net/DatagramSocket.java +++ b/libjava/java/net/DatagramSocket.java @@ -798,7 +798,7 @@ public class DatagramSocket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); + getImpl().setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); } /** @@ -837,7 +837,7 @@ public class DatagramSocket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption(SocketOptions.SO_BROADCAST, new Boolean(enable)); + getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable)); } /** diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java index 12afc2f50c3..28b76b365ee 100644 --- a/libjava/java/net/MulticastSocket.java +++ b/libjava/java/net/MulticastSocket.java @@ -255,7 +255,7 @@ public class MulticastSocket extends DatagramSocket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable)); + getImpl().setOption (SocketOptions.IP_MULTICAST_LOOP, Boolean.valueOf(disable)); } /** diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java index a53ebf674d1..df338091291 100644 --- a/libjava/java/net/ServerSocket.java +++ b/libjava/java/net/ServerSocket.java @@ -471,7 +471,7 @@ public class ServerSocket if (isClosed()) throw new SocketException("ServerSocket is closed"); - impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); + impl.setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); } /** diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java index f9cbb7e6cb3..4c14e8d99b3 100644 --- a/libjava/java/net/Socket.java +++ b/libjava/java/net/Socket.java @@ -657,7 +657,7 @@ public class Socket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption(SocketOptions.TCP_NODELAY, new Boolean(on)); + getImpl().setOption(SocketOptions.TCP_NODELAY, Boolean.valueOf(on)); } /** @@ -719,7 +719,7 @@ public class Socket } else { - getImpl().setOption(SocketOptions.SO_LINGER, new Boolean(false)); + getImpl().setOption(SocketOptions.SO_LINGER, Boolean.valueOf(false)); } } @@ -784,7 +784,7 @@ public class Socket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption(SocketOptions.SO_OOBINLINE, new Boolean(on)); + getImpl().setOption(SocketOptions.SO_OOBINLINE, Boolean.valueOf(on)); } /** @@ -975,7 +975,7 @@ public class Socket if (isClosed()) throw new SocketException("socket is closed"); - getImpl().setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on)); + getImpl().setOption(SocketOptions.SO_KEEPALIVE, Boolean.valueOf(on)); } /** @@ -1150,7 +1150,7 @@ public class Socket */ public void setReuseAddress (boolean on) throws SocketException { - getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); + getImpl().setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); } /** diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java index 4707d9cf3a9..2b383b5502a 100644 --- a/libjava/java/net/URLConnection.java +++ b/libjava/java/net/URLConnection.java @@ -956,7 +956,7 @@ public abstract class URLConnection ContentHandler handler; // No content type so just handle it as the default. - if (contentType == null || contentType == "") + if (contentType == null || contentType.equals("")) return null; // See if a handler has been cached for this content type. diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java index ec251297453..af4335f4f44 100644 --- a/libjava/java/net/URLStreamHandler.java +++ b/libjava/java/net/URLStreamHandler.java @@ -415,7 +415,7 @@ public abstract class URLStreamHandler InetAddress addr1 = getHostAddress (url1); InetAddress addr2 = getHostAddress (url2); - if (addr1 != null || addr2 != null) + if (addr1 != null && addr2 != null) return addr1.equals (addr2); String host1 = url1.getHost(); @@ -511,7 +511,7 @@ public abstract class URLStreamHandler int size = protocol.length() + host.length() + file.length() + 24; StringBuffer sb = new StringBuffer(size); - if (protocol != null && protocol.length() > 0) + if (protocol.length() != 0) { sb.append(protocol); sb.append(":"); |