aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-02-11 18:22:09 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-02-11 18:22:09 +0000
commit31d25d83b640a4103576cdeb6eec8fe6128e4e7a (patch)
tree3b860ef7c7b10bd3123183217455386411e1a248 /libjava
parente193b4082e8f7ce791f0bae9e2992c15e2d9d7fa (diff)
downloadgcc-31d25d83b640a4103576cdeb6eec8fe6128e4e7a.zip
gcc-31d25d83b640a4103576cdeb6eec8fe6128e4e7a.tar.gz
gcc-31d25d83b640a4103576cdeb6eec8fe6128e4e7a.tar.bz2
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. From-SVN: r77670
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog23
-rw-r--r--libjava/java/net/DatagramSocket.java4
-rw-r--r--libjava/java/net/MulticastSocket.java2
-rw-r--r--libjava/java/net/ServerSocket.java2
-rw-r--r--libjava/java/net/Socket.java10
-rw-r--r--libjava/java/net/URLConnection.java2
-rw-r--r--libjava/java/net/URLStreamHandler.java4
7 files changed, 35 insertions, 12 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ba68afe..db67e40 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 c5920a0..895db94 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 12afc2f..28b76b3 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 a53ebf6..df33809 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 f9cbb7e..4c14e8d 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 4707d9c..2b383b5 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 ec251297..af4335f 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(":");