commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Closed: (DIGESTER-114) SetPropertyRule throws /java.lang.IllegalArgumentException: No name specified/ when matched element has no attributes
Date Tue, 21 Aug 2007 16:42:30 GMT

     [ 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.


Mime
View raw message