Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 69966 invoked from network); 19 May 2006 15:12:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 May 2006 15:12:38 -0000 Received: (qmail 38759 invoked by uid 500); 19 May 2006 15:12:29 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 38679 invoked by uid 500); 19 May 2006 15:12:29 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 38632 invoked by uid 99); 19 May 2006 15:12:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2006 08:12:29 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [199.103.161.2] (HELO craexchange.cra.com) (199.103.161.2) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2006 08:12:28 -0700 Received: by CRA-EXCHANGE with Internet Mail Service (5.5.2653.19) id ; Fri, 19 May 2006 11:12:10 -0400 Message-ID: <6E78A4E838BABF4EA555A859488EFF991969@CRA-EXCHANGE> From: Joseph Campolongo To: commons-user@jakarta.apache.org Subject: [JXPath] StackOverflow error Date: Fri, 19 May 2006 11:12:02 -0400 X-MS-TNEF-Correlator: <6E78A4E838BABF4EA555A859488EFF991969@CRA-EXCHANGE> MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C67B56.95365E50" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_000_01C67B56.95365E50 Content-Type: text/plain; charset="iso-8859-1" I'm running into a StackOverflow error on a call to 'JXPathContext.createPath()' whenever I have a path that looks like 'a/b[1]/c'. I took a quick look at the code and it appears JXPath, when trying to create its parent pointer, simply recreates an equivalent pointer(???). I'm not sure if my AbstractFactory is incorrect, if JXPath simply doesn't handle the above case(s), or if this is actually a bug in JXPath. Here is code to reproduce the problem. Map map = new HashMap(); map.put("a", null); JXPathContext pathContext = JXPathContext.newContext(map); pathContext.setFactory(new AbstractFactory() { public boolean createObject( JXPathContext context, Pointer pointer, Object parent, String name, int index) { Map parentMap = (Map)parent; System.out.println(parent + ":" + name + ":" + index); if (index > -1) { List list = (List)parentMap.get(name); if (list == null) { list = new ArrayList(); } int size = list.size(); for (int i = size; i <= index; i++) { list.add(i, null); } parentMap.put(name, list); } else { parentMap.put(name, new HashMap()); } return true; } }); pathContext.createPath("a/b[1]/c"); Joseph Campolongo ------_=_NextPart_000_01C67B56.95365E50 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org ------_=_NextPart_000_01C67B56.95365E50--