Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 10192 invoked from network); 2 Oct 2003 03:10:42 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Oct 2003 03:10:42 -0000 Received: (qmail 94475 invoked by uid 500); 2 Oct 2003 03:10:21 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 94227 invoked by uid 500); 2 Oct 2003 03:10:19 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 94214 invoked by uid 500); 2 Oct 2003 03:10:19 -0000 Received: (qmail 94211 invoked from network); 2 Oct 2003 03:10:19 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 2 Oct 2003 03:10:19 -0000 Received: (qmail 10138 invoked by uid 1360); 2 Oct 2003 03:10:37 -0000 Date: 2 Oct 2003 03:10:37 -0000 Message-ID: <20031002031037.10137.qmail@minotaur.apache.org> From: bayard@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/decorators OrderedSet.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N bayard 2003/10/01 20:10:37 Modified: collections/src/java/org/apache/commons/collections/decorators OrderedSet.java Log: Have made the OrderedSet use the underlying List's toString and not the Set's toString. It's important that the toString retains the correct order, else things can get quite confusing when debugging. Fortunately List and Set toStrings are the same, unless someone has custom versions in place. Revision Changes Path 1.3 +13 -2 jakarta-commons/collections/src/java/org/apache/commons/collections/decorators/OrderedSet.java Index: OrderedSet.java =================================================================== RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/decorators/OrderedSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- OrderedSet.java 20 Sep 2003 16:57:47 -0000 1.2 +++ OrderedSet.java 2 Oct 2003 03:10:37 -0000 1.3 @@ -264,6 +264,16 @@ return obj; } + /** + * Uses the underlying List's toString so that order is achieved. + * This means that the decorated Set's toString is not used, so + * any custom toStrings will be ignored. + */ + // Fortunately List.toString and Set.toString look the same + public String toString() { + return setOrder.toString(); + } + //----------------------------------------------------------------------- /** * Internal iterator handle remove. @@ -282,6 +292,7 @@ public Object next() { last = iterator.next(); + System.err.println("RETURNING: "+last); return last; } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org