Return-Path: Delivered-To: apmail-xmlgraphics-general-archive@www.apache.org Received: (qmail 1043 invoked from network); 13 Dec 2010 19:44:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 19:44:10 -0000 Received: (qmail 14676 invoked by uid 500); 13 Dec 2010 19:44:10 -0000 Mailing-List: contact general-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list general@xmlgraphics.apache.org Received: (qmail 14668 invoked by uid 99); 13 Dec 2010 19:44:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 19:44:10 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [195.241.79.175] (HELO smtp-out0.tiscali.nl) (195.241.79.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 19:44:01 +0000 Received: from [212.182.186.10] (helo=vuurvlinder.home.leverkruid.eu) by smtp-out0.tiscali.nl with esmtp (Exim) (envelope-from ) id 1PSEJA-0006xm-Kn for general@xmlgraphics.apache.org; Mon, 13 Dec 2010 20:43:40 +0100 Received: from simon by vuurvlinder.home.leverkruid.eu with local (Exim 4.72 #1 (Debian)) id 1PSEJD-0000lE-2r; Mon, 13 Dec 2010 20:43:43 +0100 Date: Mon, 13 Dec 2010 20:43:43 +0100 From: Simon Pepping To: general@xmlgraphics.apache.org Subject: Re: [VOTE] Merge XGC color branch into Trunk Message-ID: <20101213194342.GA2327@leverkruid.eu> Mail-Followup-To: general@xmlgraphics.apache.org References: <4CCF231A.8020709@gmail.com> <20101103083043.982D.60BA733C@jeremias-maerki.ch> <20101213155241.559D.60BA733C@jeremias-maerki.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101213155241.559D.60BA733C@jeremias-maerki.ch> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Dec 13, 2010 at 03:54:44PM +0100, Jeremias Maerki wrote: > I think I have addressed all concerns now. I've switched from using > equals() to ColorUtil.isSameColor(Color, Color). That should take care > of the equals contract problem. If the color branch is now in a state > that everybody is happy with, I'll restart the vote. Don't you mean the following with the class test: //Consider same-ness only between colors of the same class (not subclasses) //but consider a ColorWithAlternatives without alternatives to be the same as a Color. Class cl1 = col1.getClass(); if (cl1 == ColorWithAlternatives.class && !((ColorWithAlternatives)col1).hasAlternativeColors()) { cl1 = Color.class; } Class cl2 = col2.getClass(); if (cl2 == ColorWithAlternatives.class && !((ColorWithAlternatives)col2).hasAlternativeColors()) { cl2 = Color.class; } if (cl1 != cl2) { return false; } Even so, subclasses of ColorWithAlternatives may come out unexpectedly: An object of ColorWithAlternatives with no alternative colors, and a Color object will be equal. In contrast, an object of a Subclass of ColorWithAlternatives with no alternative colors, and a Color object will not be equal. Why is that so? The part where alternative colors are compared, could well be a method of ColorWithAlternatives, putting the logic in the right class. Simon --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: general-help@xmlgraphics.apache.org