Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD5076490 for ; Wed, 6 Jul 2011 11:55:40 +0000 (UTC) Received: (qmail 72816 invoked by uid 500); 6 Jul 2011 11:55:39 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 72133 invoked by uid 500); 6 Jul 2011 11:55:39 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 71955 invoked by uid 99); 6 Jul 2011 11:55:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 11:55:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 11:55:37 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0E8684551F for ; Wed, 6 Jul 2011 11:55:17 +0000 (UTC) Date: Wed, 6 Jul 2011 11:55:17 +0000 (UTC) From: "Simone Tripodi (JIRA)" To: issues@commons.apache.org Message-ID: <1124963283.3716.1309953317056.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (DIGESTER-133) Class fields are not set if class is inherited from HashMap if commons-beanutils-1.8.0 is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIGESTER-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Simone Tripodi closed DIGESTER-133. ----------------------------------- included in Apache Commons Digester 3.0 release > Class fields are not set if class is inherited from HashMap if commons-beanutils-1.8.0 is used > ---------------------------------------------------------------------------------------------- > > Key: DIGESTER-133 > URL: https://issues.apache.org/jira/browse/DIGESTER-133 > Project: Commons Digester > Issue Type: Bug > Affects Versions: 1.6, 1.7, 1.8, 2.0 > Environment: OS: Kubuntu 8.0.4, Java version is 1.5.0_15 > Windows XP, Java version 1.5.0_11-b03 > Reporter: Alexander Kovalenko > Assignee: Simone Tripodi > Priority: Minor > Fix For: 3.0 > > > Class fields are not set if class is inherited from HashMap, value is put in HashMap instead. > I tried this simple test with Digester 1.6, 1.7, 1.8 and 2.0. It works with commons-beanutils-1.7.0, but does not work with commons-beanutils-1.8.0. JUnit 4.4 was used for testing. > ================ Class to be instantiated from XML ========================== > import java.util.HashMap; > public class MyClass extends HashMap { > private boolean flag = false; > public boolean isFlag() > { > return flag; > } > public void setFlag(boolean flag) > { > this.flag = flag; > } > } > ================= Test =================== > import static org.junit.Assert.assertTrue; > import java.io.ByteArrayInputStream; > import java.io.IOException; > import org.apache.commons.digester.Digester; > import org.junit.Test; > import org.xml.sax.SAXException; > public class TestDigester { > > @Test > public void testDigester() throws IOException, SAXException { > final String xml = ""; > > final Digester digester = new Digester(); > digester.addObjectCreate("myclass", MyClass.class); > digester.addSetProperties("myclass"); > > final MyClass res = (MyClass) digester.parse(new ByteArrayInputStream(xml.getBytes())); > assertTrue(res.isFlag()); > } > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira