From 7cbd1918f597f5b1078a1d7e1441de1ea09f00c5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 19 Jun 2003 01:19:27 +0000 Subject: Inet6Address.java (isAnyLocalAddress): Don't use "==" on arrays. * java/net/Inet6Address.java (isAnyLocalAddress): Don't use "==" on arrays. (isLoopbackAddress): Likewise. * java/net/Inet4Address.java (isAnyLocalAddress): Don't use "==" on arrays. From-SVN: r68173 --- libjava/java/net/Inet6Address.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libjava/java/net/Inet6Address.java') diff --git a/libjava/java/net/Inet6Address.java b/libjava/java/net/Inet6Address.java index 8d3c0c3..ee6e666 100644 --- a/libjava/java/net/Inet6Address.java +++ b/libjava/java/net/Inet6Address.java @@ -1,5 +1,5 @@ /* Inet6Address.java - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,6 +38,7 @@ exception statement from your version. */ package java.net; import java.io.IOException; +import java.util.Arrays; /** * @author Michael Koch @@ -91,7 +92,7 @@ public final class Inet6Address extends InetAddress byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - return ipaddress == anylocal; + return Arrays.equals(ipaddress, anylocal); } /** @@ -104,7 +105,7 @@ public final class Inet6Address extends InetAddress byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; - return ipaddress == loopback; + return Arrays.equals(ipaddress, loopback); } /** -- cgit v1.1