Thanks, I will check in this patch (but put IdentityArrayList under ...broker.util package instead of making an inner class).

regards,
Armin

Guillaume Nodet wrote:

Hi Armin

Here is simple class than can be included in PersistenceBrokerImpl as a
replacement for the ArrayList. Just replacing the nowStoring and
markedForDelete lists with this one. This seems to work fine

        /**
         * List inheriting ArrayList, modified for checking objects on
         * object equality with '==' instead of 'equals'
         */
        private static class IdentityArrayList extends ArrayList
        {
                public boolean contains(Object elem)
                {
                        return indexOf(elem) >= 0;
                }
                public int indexOf(Object elem)
                {
                        for (int i = 0; i < size(); i++)
                                if (elem == get(i))
                                        return i;
                        return -1;
                }
                public int lastIndexOf(Object elem)
                {
                        for (int i = size()-1; i >= 0; i--)
                                if (elem == get(i))
                                        return i;
                        return -1;
                }
        }


Regards, Guillaume




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to