From bad51fe007432d0741b7f6f7723bfe6869b661b8 Mon Sep 17 00:00:00 2001 From: tromey Date: Mon, 5 Feb 2007 21:05:10 +0000 Subject: [PATCH] * java/net/Proxy.java (equals): Handle case where address==null. (hashCode): Likewise. (toString): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121609 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/ChangeLog | 6 ++++++ libjava/classpath/java/net/Proxy.java | 10 ++++++---- libjava/classpath/lib/java/net/Proxy.class | Bin 1522 -> 1590 bytes 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index bcba0a9..f82f64a 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,9 @@ +2007-02-05 Tom Tromey + + * java/net/Proxy.java (equals): Handle case where address==null. + (hashCode): Likewise. + (toString): Likewise. + 2007-01-31 Tom Tromey * resource/gnu/classpath/tools/jar/messages.properties diff --git a/libjava/classpath/java/net/Proxy.java b/libjava/classpath/java/net/Proxy.java index 7b4ef29..6f9f1b6 100644 --- a/libjava/classpath/java/net/Proxy.java +++ b/libjava/classpath/java/net/Proxy.java @@ -1,5 +1,5 @@ /* Proxy.java -- Represends a proxy for a network connection - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -112,7 +112,8 @@ public class Proxy Proxy tmp = (Proxy) obj; return (type.equals(tmp.type) - && address.equals(tmp.address)); + && (address == null ? tmp.address == null + : address.equals(tmp.address))); } /** @@ -122,7 +123,7 @@ public class Proxy */ public final int hashCode() { - return type.hashCode() ^ address.hashCode(); + return type.hashCode() ^ (address == null ? 0 : address.hashCode()); } /** @@ -132,6 +133,7 @@ public class Proxy */ public String toString() { - return type.toString() + ":" + address.toString(); + return type.toString() + (address == null ? "" + : (":" + address.toString())); } } diff --git a/libjava/classpath/lib/java/net/Proxy.class b/libjava/classpath/lib/java/net/Proxy.class index 9c7f6d87abdcf7d15c5fdba974e929fac1f7bd22..4da6ba2fdac9f3d4caf5b364e517bdb68b509cd4 100644 GIT binary patch delta 395 zcmXYs&n^Q|6vlsdW~%L&R@wzd)t|(os+Cluk`Xkh|0I^)0THZqC$*kfc!F-aAY=$) zEAaxJ!o~xLGjnHgzkAO4zWaUW{`Los{q^_y0n|8nu)mEVQmiSIXJgW^sk7m*$(H|P zEIwAvYn8sm5DHfOcdO8zDnBv)Nv0BAgI#jrAnXE4cOz0{@I>&GG-qTv zXOs)7T(T_nh_DmdoJsnmlNhEcqeNR{MrH;%D)K^+5w_5hfeH(WEe6c$b&_Tm+doVU zx33~oM{8nJC028>!7*0Ed2iH@w8#7l3(qWRr&PY##SO{)YCH^B4`>B!YrL0q{k?3o gdWRx6H0XrMC3LhGM;q)!@?G}iwk3K%&VJMV2fOe*a{vGU delta 326 zcmZ9Hy-EW?6otQ;Fq%Mh!Fh$?|lIuz+My^?YGirNTDdBD2TSc zfR7-EN!(Et( zQ!Gx&di;vHqTo953udo+$4E`(nY?5$`RE#UWrCzw7&?$Y661 nEZnm+(Dp26+;vT!jq88#^FQ!P4!3NksV%nEL$P~RJMGdB^YJcD -- 2.7.4