Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 68158 invoked from network); 8 Jan 2005 09:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Jan 2005 09:39:27 -0000 Received: (qmail 76521 invoked by uid 500); 8 Jan 2005 09:39:24 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 76489 invoked by uid 500); 8 Jan 2005 09:39:24 -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 76471 invoked by uid 99); 8 Jan 2005 09:39:24 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 08 Jan 2005 01:39:23 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (8.12.11/8.12.11) with ESMTP id j089dKSY025037 for ; Sat, 8 Jan 2005 10:39:20 +0100 Received: (from nobody@localhost) by ajax.apache.org (8.12.11/8.12.11/Submit) id j089dKHu025035; Sat, 8 Jan 2005 10:39:20 +0100 Date: Sat, 8 Jan 2005 10:39:20 +0100 Message-Id: <200501080939.j089dKHu025035@ajax.apache.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 32925] - [digester] XML Rule for stack param takes useless boolean instead of int arg X-Bugzilla-Reason: AssignedTo X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32925 ------- Additional Comments From skitching@apache.org 2005-01-08 10:39 ------- The version of CallParamRule that takes a boolean is not useless at all. It stores the object which is on top of the stack *at the time the CallParamRule fires* for passing to a target method. The target method will be on the object which is on top of the stack *at the time the CallMethodRule fires*. Below is some code from the digester unit tests which uses CallParamRule(int, boolean) in the usual manner. The code which allows CallParamRule to take an arbitrary stack offset was added later, and is really only needed for unusual cases. However you are right that it should be accessable via the xmlrules module. Would you be interested in providing a patch for xmlrules that adds this *extra* functionality? (rather than changing the existing behaviour, which is not a good idea as it will break existing programs that use CallParamRule(int, bool) or its xmlrules mapping). Code from digester unit tests: /** * This tests the call methods params enhancement that provides * for more complex stack-based calls. */ public void testParamsFromStack() throws SAXException, IOException { StringBuffer xml = new StringBuffer(). append(""). append(""). append(" "). append(" "). append(""); digester.addObjectCreate("map", HashMap.class); digester.addCallMethod("map", "put", 2); digester.addObjectCreate("map/key", AlphaBean.class); digester.addSetProperties("map/key"); digester.addCallParam("map/key", 0, true); digester.addObjectCreate("map/value", BetaBean.class); digester.addSetProperties("map/value"); digester.addCallParam("map/value", 1, true); Map map = (Map) digester.parse(new StringReader(xml.toString())); assertNotNull(map); assertEquals(1, map.size()); assertEquals("The key", ((AlphaBean)map.keySet().iterator().next()).getName()); assertEquals("The value", ((BetaBean)map.values().iterator().next()).getName()); } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org