Commit 31d25d83 by Michael Koch Committed by Michael Koch

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
parent e193b408
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> 2004-02-10 David Jee <djee@redhat.com>
* java/awt/BorderLayout.java * java/awt/BorderLayout.java
......
...@@ -798,7 +798,7 @@ public class DatagramSocket ...@@ -798,7 +798,7 @@ public class DatagramSocket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); 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 ...@@ -837,7 +837,7 @@ public class DatagramSocket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); throw new SocketException("socket is closed");
getImpl().setOption(SocketOptions.SO_BROADCAST, new Boolean(enable)); getImpl().setOption(SocketOptions.SO_BROADCAST, Boolean.valueOf(enable));
} }
/** /**
......
...@@ -255,7 +255,7 @@ public class MulticastSocket extends DatagramSocket ...@@ -255,7 +255,7 @@ public class MulticastSocket extends DatagramSocket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); throw new SocketException("socket is closed");
getImpl().setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable)); getImpl().setOption (SocketOptions.IP_MULTICAST_LOOP, Boolean.valueOf(disable));
} }
/** /**
......
...@@ -471,7 +471,7 @@ public class ServerSocket ...@@ -471,7 +471,7 @@ public class ServerSocket
if (isClosed()) if (isClosed())
throw new SocketException("ServerSocket is closed"); throw new SocketException("ServerSocket is closed");
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); impl.setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
} }
/** /**
......
...@@ -657,7 +657,7 @@ public class Socket ...@@ -657,7 +657,7 @@ public class Socket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); 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 ...@@ -719,7 +719,7 @@ public class Socket
} }
else else
{ {
getImpl().setOption(SocketOptions.SO_LINGER, new Boolean(false)); getImpl().setOption(SocketOptions.SO_LINGER, Boolean.valueOf(false));
} }
} }
...@@ -784,7 +784,7 @@ public class Socket ...@@ -784,7 +784,7 @@ public class Socket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); 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 ...@@ -975,7 +975,7 @@ public class Socket
if (isClosed()) if (isClosed())
throw new SocketException("socket is closed"); 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 ...@@ -1150,7 +1150,7 @@ public class Socket
*/ */
public void setReuseAddress (boolean on) throws SocketException public void setReuseAddress (boolean on) throws SocketException
{ {
getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); getImpl().setOption (SocketOptions.SO_REUSEADDR, Boolean.valueOf(on));
} }
/** /**
......
...@@ -956,7 +956,7 @@ public abstract class URLConnection ...@@ -956,7 +956,7 @@ public abstract class URLConnection
ContentHandler handler; ContentHandler handler;
// No content type so just handle it as the default. // No content type so just handle it as the default.
if (contentType == null || contentType == "") if (contentType == null || contentType.equals(""))
return null; return null;
// See if a handler has been cached for this content type. // See if a handler has been cached for this content type.
......
...@@ -415,7 +415,7 @@ public abstract class URLStreamHandler ...@@ -415,7 +415,7 @@ public abstract class URLStreamHandler
InetAddress addr1 = getHostAddress (url1); InetAddress addr1 = getHostAddress (url1);
InetAddress addr2 = getHostAddress (url2); InetAddress addr2 = getHostAddress (url2);
if (addr1 != null || addr2 != null) if (addr1 != null && addr2 != null)
return addr1.equals (addr2); return addr1.equals (addr2);
String host1 = url1.getHost(); String host1 = url1.getHost();
...@@ -511,7 +511,7 @@ public abstract class URLStreamHandler ...@@ -511,7 +511,7 @@ public abstract class URLStreamHandler
int size = protocol.length() + host.length() + file.length() + 24; int size = protocol.length() + host.length() + file.length() + 24;
StringBuffer sb = new StringBuffer(size); StringBuffer sb = new StringBuffer(size);
if (protocol != null && protocol.length() > 0) if (protocol.length() != 0)
{ {
sb.append(protocol); sb.append(protocol);
sb.append(":"); sb.append(":");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment