Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 37024 invoked from network); 6 May 2007 10:05:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 May 2007 10:05:29 -0000 Received: (qmail 91258 invoked by uid 500); 6 May 2007 10:05:36 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 91234 invoked by uid 500); 6 May 2007 10:05:35 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 91222 invoked by uid 500); 6 May 2007 10:05:35 -0000 Received: (qmail 91219 invoked by uid 99); 6 May 2007 10:05:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 May 2007 03:05:35 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 May 2007 03:05:28 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 272171A9838; Sun, 6 May 2007 03:05:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r535591 - in /db/torque: runtime/trunk/src/java/org/apache/torque/util/Criteria.java runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java site/trunk/xdocs/changes.xml Date: Sun, 06 May 2007 10:05:07 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070506100508.272171A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tfischer Date: Sun May 6 03:05:04 2007 New Revision: 535591 URL: http://svn.apache.org/viewvc?view=rev&rev=535591 Log: Fixed Null Pointer Exceptions in Criteria.equals() and Criteria.hashCode() if joins are null. Thanks to Sean Gilligan. Fixes TORQUE-90. Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/Criteria.java db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java db/torque/site/trunk/xdocs/changes.xml Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/Criteria.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/Criteria.java?view=diff&rev=535591&r1=535590&r2=535591 ============================================================================== --- db/torque/runtime/trunk/src/java/org/apache/torque/util/Criteria.java (original) +++ db/torque/runtime/trunk/src/java/org/apache/torque/util/Criteria.java Sun May 6 03:05:04 2007 @@ -1843,7 +1843,7 @@ && orderByColumns.equals(criteria.getOrderByColumns()) && ObjectUtils.equals(aliases, criteria.getAliases()) && asColumns.equals(criteria.getAsColumns()) - && joins.equals(criteria.getJoins()) + && ObjectUtils.equals(joins, criteria.getJoins()) ) { isEquiv = true; @@ -1890,7 +1890,7 @@ result = 37 * result + orderByColumns.hashCode(); result = 37 * result + (aliases == null ? 0 : aliases.hashCode()); result = 37 * result + asColumns.hashCode(); - result = 37 * result + joins.hashCode(); + result = 37 * result + (joins == null ? 0 : joins.hashCode()); result = 37 * result + super.hashCode(); return result; } Modified: db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java?view=diff&rev=535591&r1=535590&r2=535591 ============================================================================== --- db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java (original) +++ db/torque/runtime/trunk/src/test/org/apache/torque/util/CriteriaTest.java Sun May 6 03:05:04 2007 @@ -633,6 +633,20 @@ } /** + * Test that {@link Criteria#equals(Object)} works correctly for a simple + * Criteria object. + * @throws TorqueException + */ + public void testEquals() throws TorqueException + { + c.addSelectColumn("Author.NAME"); + c.addSelectColumn("Author.AUTHOR_ID"); + c.add("Author.NAME", "foobar"); + Criteria cClone = (Criteria) SerializationUtils.clone(c); + assertTrue(c.equals(cClone)); + } + + /** * Checks whether orderBy works. */ public void testOrderBy() throws TorqueException Modified: db/torque/site/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?view=diff&rev=535591&r1=535590&r2=535591 ============================================================================== --- db/torque/site/trunk/xdocs/changes.xml (original) +++ db/torque/site/trunk/xdocs/changes.xml Sun May 6 03:05:04 2007 @@ -31,6 +31,10 @@ + + Fixed Null Pointer Exceptions in Criteria.equals() and + Criteria.hashCode() if joins are null. + Changed the maven2 plugin's datadump goal to accept only a single schema xml. Multiple schema xmls produced illegal output. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org