Closed GoogleCodeExporter closed 9 years ago
Changing line 182 of HibernateSerializer.java from:
if (!"class".equals(propName) && !"annotations".equals(propName) &&
!"hibernateLazyInitializer".equals(propName))
to:
if (!"handler".equals(propName) && !"class".equals(propName) &&
!"annotations".equals(propName) && !"hibernateLazyInitializer".equals(propName))
solves the problem.
Original comment by jmcl...@matrixlinks.ca
on 30 May 2008 at 4:38
James,
thanks for the bug and the solution! I just checked it as buikd 1.0.11. Can you
confirm that this fixes it for you?
Thanks,
--mike
Original comment by mni...@gmail.com
on 30 May 2008 at 8:51
I solved this problem changing the IF clause like this at
HibernateSerializer.java
and HibernateDeserializer.java:
if (!"handler".equals(propName) && !"class".equals(propName)
&& !"annotations".equals(propName)
&& !"hibernateLazyInitializer".equals(propName)
&& !"defaultAssertionStatus".equals(propName) && !"workDir".equals(propName)).
Another point is that you have to check about IndexedPropertyDescriptor at
readBean()
on HibernateDeserializer.java method like this to avoid NPE:
if(pd instanceof IndexedPropertyDescriptor) {
val = ((IndexedPropertyDescriptor) pd).getIndexedReadMethod().invoke(obj);
} else {
val = pd.getReadMethod().invoke(obj);
}
I also added a check about collection types at readCollection() method on
HibernateSerializer.java and HibernateDeserializer.java to instantiate any type
of
collection, not only List with ArrayList:
if("java.util.Arrays$ArrayList".equals(obj.getClass().getName())) {
items = new ArrayList();
} else {
items = (Collection<Object>) obj.getClass().newInstance();
}
I hope that it fixes your problem.
Original comment by dfalca...@gmail.com
on 10 Mar 2010 at 2:50
Original issue reported on code.google.com by
jmcl...@matrixlinks.ca
on 30 May 2008 at 2:03Attachments: