yong-hu / objenesis

Automatically exported from code.google.com/p/objenesis
0 stars 0 forks source link

Invalid object state for classes defining public default constructor #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
just found while adapting fast serialization (github) to android.

What steps will reproduce the problem?
1. Create Externalizable ArrayList Subclass
2. use objenesis new instance
3. add an element to the arraylist subclass (=> exception)

What is the expected output? What do you see instead?
no excpetion

What version of the product are you using? On what operating system?
2.1

Please provide any additional information below.

the issue is, SunReflectionFactoryInstantiator always uses the 
"newConstructorForSerialization". However if there is public noarg constructor 
for an externalizable, this should be used instead (else initial state might be 
wrong).

Original issue reported on code.google.com by moru0...@gmail.com on 13 Dec 2014 at 1:20