From commits-return-1099-apmail-commons-commits-archive=commons.apache.org@commons.apache.org Tue Dec 11 19:33:25 2007 Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 4564 invoked from network); 11 Dec 2007 19:33:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2007 19:33:25 -0000 Received: (qmail 78983 invoked by uid 500); 11 Dec 2007 19:33:12 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 78931 invoked by uid 500); 11 Dec 2007 19:33:11 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 78922 invoked by uid 99); 11 Dec 2007 19:33:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2007 11:33:11 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 11 Dec 2007 19:33:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9BFFA1A9832; Tue, 11 Dec 2007 11:32:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r603339 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java Date: Tue, 11 Dec 2007 19:32:59 -0000 To: commits@commons.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071211193259.9BFFA1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mbenson Date: Tue Dec 11 11:32:58 2007 New Revision: 603339 URL: http://svn.apache.org/viewvc?rev=603339&view=rev Log: [JXPATH-107] misplaced null check reported by Michele Vivoda Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java?rev=603339&r1=603338&r2=603339&view=diff ============================================================================== --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java Tue Dec 11 11:32:58 2007 @@ -114,17 +114,19 @@ */ public void setValue(Object value) { this.value = value; - if (parent.isContainer()) { - parent.setValue(value); - } - else if (parent != null) { - if (index == WHOLE_COLLECTION) { - throw new UnsupportedOperationException( - "Cannot setValue of an object that is not " - + "some other object's property"); + if (parent != null) { + if (parent.isContainer()) { + parent.setValue(value); + } + else { + if (index == WHOLE_COLLECTION) { + throw new UnsupportedOperationException( + "Cannot setValue of an object that is not " + + "some other object's property"); + } + throw new JXPathInvalidAccessException( + "The specified collection element does not exist: " + this); } - throw new JXPathInvalidAccessException( - "The specified collection element does not exist: " + this); } else { throw new UnsupportedOperationException(