You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2007/08/21 18:42:30 UTC
[jira] Closed: (DIGESTER-114) SetPropertyRule throws
/java.lang.IllegalArgumentException: No name specified/ when matched
element has no attributes
[ https://issues.apache.org/jira/browse/DIGESTER-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell closed DIGESTER-114.
----------------------------------
Resolution: Fixed
Patch applied.
> SetPropertyRule throws /java.lang.IllegalArgumentException: No name specified/ when matched element has no attributes
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: DIGESTER-114
> URL: https://issues.apache.org/jira/browse/DIGESTER-114
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 1.8
> Reporter: Britt Levy
> Fix For: 1.8.1
>
> Attachments: DIGESTER-114.patch
>
>
> A /java.lang.IllegalArgumentException: No name specified/ is thrown from the SetPropertyRule.begin(Attributes attributes) method if the attributes list is empty (attributes.getLength() = 0). The method should check the length of the attributes list and simply return if there are no attributes.
> Add the follwowing to org.apache.commons.digester.SetPropertyRuleTestCase to reproduce:
> /**
> * Simple test xml document used in the tests.
> */
> protected final static String TEST_XML_3 =
> "<?xml version='1.0'?><root>" +
> "<set/>" +
> "</root>";
> /**
> * Test SetPropertyRule when matched XML element has no attributes.
> */
> public void testElementWithNoAttributes() throws Exception {
> // Set up the rules we need
> digester.addObjectCreate("root",
> "org.apache.commons.digester.SimpleTestBean");
> digester.addSetProperty("root/set", "name", "value");
> // Parse the input - should not throw an exception
> SimpleTestBean bean =
> (SimpleTestBean) digester.parse(xmlTestReader(TEST_XML_3));
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.