2003-06-20 Michael Koch <konqueror@gmx.de>
* java/net/URLStreamHandler.java (hostsEqual): Rewritten. From-SVN: r68260
This commit is contained in:
parent
c52c9fec50
commit
f8b7363eed
|
@ -1,3 +1,8 @@
|
||||||
|
2003-06-20 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* java/net/URLStreamHandler.java
|
||||||
|
(hostsEqual): Rewritten.
|
||||||
|
|
||||||
2003-06-20 Michael Koch <konqueror@gmx.de>
|
2003-06-20 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* gnu/java/nio/MappedByteFileBuffer.java,
|
* gnu/java/nio/MappedByteFileBuffer.java,
|
||||||
|
|
|
@ -380,12 +380,20 @@ public abstract class URLStreamHandler
|
||||||
* @exception UnknownHostException If an unknown host is found
|
* @exception UnknownHostException If an unknown host is found
|
||||||
*/
|
*/
|
||||||
protected boolean hostsEqual (URL url1, URL url2)
|
protected boolean hostsEqual (URL url1, URL url2)
|
||||||
throws UnknownHostException
|
|
||||||
{
|
{
|
||||||
InetAddress addr1 = InetAddress.getByName (url1.getHost ());
|
InetAddress addr1 = getHostAddress (url1);
|
||||||
InetAddress addr2 = InetAddress.getByName (url2.getHost ());
|
InetAddress addr2 = getHostAddress (url2);
|
||||||
|
|
||||||
|
if (addr1 != null || addr2 != null)
|
||||||
return addr1.equals (addr2);
|
return addr1.equals (addr2);
|
||||||
|
|
||||||
|
String host1 = url1.getHost();
|
||||||
|
String host2 = url2.getHost();
|
||||||
|
|
||||||
|
if (host1 != null && host2 != null)
|
||||||
|
return host1.equalsIgnoreCase (host2);
|
||||||
|
|
||||||
|
return host1 == null && host2 == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue