RE: [OJB-developers] DListImpl remove
Brought to you by:
thma
From: Matthew B. <ma...@so...> - 2002-06-10 06:36:08
|
Hi Georg, I've added that code (not committed yet), and will test. I'll need to write a test case for it first, if you don't have one. m -----Original Message----- From: Georg Schneider [mailto:ge...@me...] Sent: Monday, May 27, 2002 4:45 AM To: Mahler Thomas Cc: obj...@li... Subject: [OJB-developers] DListImpl remove Hi Thomas, It seems, that the remove method in DListImpl is not fully implemented. First of all the entry never gets deleted from the entry list, the size isn't reduced by one and although it says in the comment above the method, that when removing an element the index of the subsequent elements will be shifted to the left, the code for doing that is not there. The following lines show how I corrected that (unfortunately I can't send a diff, because DListImpl is still one of those files that have extra line feeds in the repository). if (tx != null) { tx.markDelete(entry); } ==> added from here on this.size--; elements.remove(index); // changing the position markers of entries: int offset = 0; try { offset = ((DListEntry) elements.get(index)).getPosition(); } catch (Exception ignored) { } for (int i = offset; i < elements.size(); i++) { entry = (DListEntry) elements.get(i); entry.setPosition(i); } ==> end of added code return entry.getRealSubject(); Cheers Georg _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |