I have found an issue with implementing the _object member as a
SequenceHashtable. In one of my objects I override the hashCode method. For
some reason that was wrecking havac with the object lookup. Castor kept
throwing  the following exception, IllegalArgumentException("ObjectEntry to
be rehash is not found!") in org.exolab.castor.persist.TransactionContext.
Does anyone have any ideas why? I guess my hashcode is not valid.  Should I
also override the equals method.

    public int hashCode() {
          return (  ((this.ipAddress == null)? "" :  this.ipAddress )
+((this.hostName == null)? "" :  this.hostName )).hashCode();
    }


>
>
> Bruce Snyder wrote:
> >
> > This one time, at band camp, Stephen Ince said:
> >
> > SI>    I just included one file
org.apache.turbine.util.SequencedHashtable. It
> > SI>didn't have any dependencies. I didn't use a SequencedHashMap because
it
> > SI>uses Iterator and not an Enumeration. I wanted to minimize the code
impact.
> > SI>I also didn't know if it had to be thread safe or not.
> > SI>
> > SI>   For complex dependencies I will normally use genjar to figure that
out.
> >
> > I'm actually leaning toward bringing the SequencedHashtable directly
> > into The Castor Project under org.exolab.castor.util. The ASL actually
> > allows for this type of behavior. Of course, full credit for the class
> > would be given to the ASF.
>
> Just make sure you leave the original header in the source class.
>
> Also it might be good to do the following:
>
> 1. Add it to the CVS under it's original package name.
>
> 2. Create an org.exolab.castor.util.SequenceHashtable that simply
> extends the Turbine one. This would allow us to change the underlyling
> implementation if we ever desired to do so without having to change code
> in the future.
>
>
> --Keith
>
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
>
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to