harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "spark shen (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4326) [classlib][java6][beans] Current java6 bean implementation does not persist java.lang.refect.Method properly
Date Wed, 04 Jul 2007 02:50:05 GMT
[classlib][java6][beans] Current java6 bean implementation does not persist java.lang.refect.Method
properly
------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4326
                 URL: https://issues.apache.org/jira/browse/HARMONY-4326
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: spark shen


The following test case will fail on Harmony branch java6, but pass on RI 6.
public void test_writeObject_java_lang_reflect_Method() throws SecurityException, NoSuchMethodException{
		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
		XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
			byteArrayOutputStream));
		Method method = Bar.class.getMethod("barTalk", (Class[])null);

		encoder.writeObject(method);
		encoder.close();
		DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
				byteArrayOutputStream.toByteArray()));
		XMLDecoder decoder = new XMLDecoder(stream);
		Method aMethod = (Method) decoder.readObject();
		assertEquals(method, aMethod);
		assertEquals(method.getName(), aMethod.getName());
		assertEquals("barTalk", aMethod.getName());
	}
Harmony-branch-java6:
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(U
nknown 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_la
ng_reflect_Method(PersistenceDelegateTest.java:283)
        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:6
72)
        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.Method
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)
RI:
successful

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