BZ #17: toString doesn't behave the same in Method.invoke

Status fields:

creation_ts:2006-02-11 00:30
component:reflection
version:default branch
rep_platform:All
op_sys:Linux
bug_status:RESOLVED
resolution:WORKSFORME
reporter:cacao@pcedev.com
On an simple object, I can have a direct call to toString which is different
than the invocation via Method.invoke. The behaviour is correct with jamvm or
sun jdk.

It happens in Spring tests e.g. :
junit.framework.ComparisonFailure: expected:<name=null; age=0; touchy=null;
spouse={null}> but was:<org.springframework.beans.TestBean@0>
   at junit.framework.Assert.assertEquals (Assert.java:81)
   at junit.framework.Assert.assertEquals (Assert.java:87)
   at
org.springframework.aop.support.DelegatingIntroductionInterceptorTests.testIntroductionI
nterceptorDoesntReplaceToString
(DelegatingIntroductionInterceptorTests.java:201)
   at java.lang.reflect.Method.invokeNative (Native Method)
   at java.lang.reflect.Method.invoke (Method.java:329)
   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.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:478)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:344)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)

Comment #1 by twisti@complang.tuwien.ac.at on 2007-10-06 17:24:52

Could you try that again?

Comment #2 by stefan@complang.tuwien.ac.at on 2012-03-13 16:28:40

No further action possible without instructions for reproduction.