[OJB-developers] BUG in PersistenceBrokerImpl
Brought to you by:
thma
From: Jesper L. <je...@da...> - 2002-05-07 10:11:08
|
Execution an ODMG query against an interface/extent that returns an empty result set, and you get this error: [junit] [BOOT] INFO: loading XML took 1752 msecs [junit] [ODMG] ERROR: null [junit] java.lang.NullPointerException [junit] at ojb.odmg.oql.OQLQueryImpl.execute(OQLQueryImpl.java:241) [junit] at dk.pine.mosaic.meta.CreateRepositoryTest.testCreate(CreateRep ositoryTest.java:88) [junit] at java.lang.reflect.Method.invoke(Native Method) .. ***** Fix/hack: Index: PersistenceBrokerImpl.java =================================================================== RCS file: /cvsroot/objectbridge/ojb-1- 0/src/java/ojb/broker/singlevm/PersistenceBrokerImpl.java,v retrieving revision 1.10 diff -r1.10 PersistenceBrokerImpl.java 1005c1005,1006 < if (tmpMap.size() > 0) --- > > if (result == null) 1007c1008,1012 < if (result == null) --- > try > { > result = (ManageableCollection) collectionClass.newInstance(); > } > catch (Throwable t) 1009,1016c1014 < try < { < result = (ManageableCollection) collectionClass.newInstance(); < } < catch (Throwable t) < { < throw new PersistenceBrokerException(t); < } --- > throw new PersistenceBrokerException(t); 1017a1016,1019 > } > > if (tmpMap.size() > 0) > { At least the above solved my problem, but with no warranties whatsoever. So, please, PersistenceBrokerImpl guru, check that above fix it correct before checking in. Thanks! Jesper |