Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 44073 invoked from network); 9 Jul 2007 06:00:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2007 06:00:56 -0000 Received: (qmail 39582 invoked by uid 500); 9 Jul 2007 06:00:58 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 39565 invoked by uid 500); 9 Jul 2007 06:00:58 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 39556 invoked by uid 99); 9 Jul 2007 06:00:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2007 23:00:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jul 2007 23:00:55 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E6577714163 for ; Sun, 8 Jul 2007 23:00:33 -0700 (PDT) Message-ID: <4265401.1183960833940.JavaMail.jira@brutus> Date: Sun, 8 Jul 2007 23:00:33 -0700 (PDT) From: "spark shen (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4321) [classlib][beans] Current java6 bean implementation does not persist some class properly In-Reply-To: <23466686.1183459864745.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] spark shen updated HARMONY-4321: -------------------------------- Attachment: (was: HY-4321.sh) > [classlib][beans] Current java6 bean implementation does not persist some class properly > ---------------------------------------------------------------------------------------- > > Key: HARMONY-4321 > URL: https://issues.apache.org/jira/browse/HARMONY-4321 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: spark shen > Assignee: Leo Li > > class Bar { > public int value; > public void barTalk() { > System.out.println("Bar is coming!"); > } > } > public void test_writeObject_java_lang_reflect_Field() > throws SecurityException, NoSuchFieldException { > ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); > XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream( > byteArrayOutputStream)); > Field value = Bar.class.getField("value"); > encoder.writeObject(value); > encoder.close(); > DataInputStream stream = new DataInputStream(new ByteArrayInputStream( > byteArrayOutputStream.toByteArray())); > XMLDecoder decoder = new XMLDecoder(stream); > Field field = (Field) decoder.readObject(); > assertEquals(value, field); > assertEquals(value.getName(), field.getName()); > } > Test result: > Harmony-branch-java6: > class java.lang.NullPointerException: newInstance is null > org.xml.sax.SAXException: No constructor for class java.lang.reflect.Field found > at org.apache.harmony.beans.Handler.endElement(Handler.java:113) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) > at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) > at java.beans.XMLDecoder.initialize(XMLDecoder.java:128) > at java.beans.XMLDecoder.readObject(XMLDecoder.java:77) > at org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest.test_writeObject_java_lang_reflect_Field(PersistenceDelegateTest.java:266) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:207) > at java.lang.reflect.Method.invoke(Method.java:258) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) > at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) > Caused by: java.lang.NoSuchMethodException: No constructor for class java.lang.reflect.Field found > at java.beans.Statement.findConstructor(Statement.java:242) > at java.beans.Statement.invokeMethod(Statement.java:122) > at java.beans.Expression.getValue(Expression.java:71) > at org.apache.harmony.beans.Command.doRun(Command.java:273) > at org.apache.harmony.beans.Command.exec(Command.java:162) > at org.apache.harmony.beans.Handler.endElement(Handler.java:111) > ... 24 more > RI: > successful > I suspect there are still other classes not properly handle by XMLEncoder. I am trying to implement them. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.