Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 49174 invoked from network); 27 Oct 2006 17:57:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2006 17:57:30 -0000 Received: (qmail 63963 invoked by uid 500); 27 Oct 2006 17:57:37 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 63899 invoked by uid 500); 27 Oct 2006 17:57:37 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 63804 invoked by uid 99); 27 Oct 2006 17:57:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 10:57:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 10:57:22 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 20A757142D2 for ; Fri, 27 Oct 2006 10:56:19 -0700 (PDT) Message-ID: <26957025.1161971779130.JavaMail.root@brutus> Date: Fri, 27 Oct 2006 10:56:19 -0700 (PDT) From: "James Schopp (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Created: (JXPATH-73) ValueUtils should catch IndexOutOfBoundsException instead of ArrayIndexOutOfBoundsException (for XmlBeans support) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ValueUtils should catch IndexOutOfBoundsException instead of ArrayIndexOutOfBoundsException (for XmlBeans support) ------------------------------------------------------------------------------------------------------------------ Key: JXPATH-73 URL: http://issues.apache.org/jira/browse/JXPATH-73 Project: Commons JXPath Issue Type: Bug Affects Versions: 1.2 Final Environment: XmlBeans with JDK 1.4.2 and JXpath 1.2 Reporter: James Schopp Basically, I want to do createPathAndSetValue on an XmlBean . But, my xpath statement inlcudes a collection (an array, actually), so the missing elements in the array need to be created. JXPath checks for this condition (ie. that array elements are missing and need to be created) by catching an ArrayIndexOutOfBoundsException. Unfortunately, XmlBeans does not throw that type of exception. It throws an IndexOutOfBoundsException exception instead. So, instead of detecting that the array is too small and needs to be grown (by calling my AbstractFactory), it just propogates the exception up the chain. The fix is quite simple: on line 423 of ValueUtils, just change the "catch" clause to catch a "IndexOutOfBoundsException" instead. This should not break any existing code since ArrayIndexOutOfBoundsException is actually a subclass of IndexOutOfBoundsException anyway. I made this fix to my local source tree, and everything works perfectly (ie. existing code did not break, but now I can also use JXPath on top of my XmlBeans beans too with my own custom AbstractFactory). Thanks! James -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org