commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: Patch: java.text - more merging


From: Michael Koch
Subject: Re: FYI: Patch: java.text - more merging
Date: Fri, 9 Jan 2004 09:18:23 +0100
User-agent: Mutt/1.3.28i

On Thu, Jan 08, 2004 at 11:06:56AM +0100, Mark Wielaard wrote:
> Hi,
> 
> On Wed, 2004-01-07 at 10:31, Michael Koch wrote:
> > 2004-01-07  Michael Koch  <address@hidden>
> > 
> >     * java/text/CollationElementIterator.java
> >     (collator): Made package-private.
> >     (text): Likewise.
> >     (index): Likewise.
> >     (textIndex): Likewise.
> 
> Why? They are not used outside this class.

Because I'm on the way to megre with libgcj's algorithm. This algorithm
needs the package-private members in other classes (RuleBaseCollator).
I wanna merge both algorithms as both have their good things.

> >         * java/text/CollationKey.java
> >         (hashCode): Reimplemented.
> 
> Are you sure this new implementation is correct?
> My Class Libraries book says that the hash code is not based on the
> string from which the key was created. Seems you want to base it on the
> toByteArray() (key) form.
> You should at least document the hashCode() algorithm in the api doc.
> Best would be to write a little mauve test for it to see if the equals()
> then same hashCode() contract is still obeyed, looks like the equals()

After re-reading online API I think this has to be revisited too. I will
think about it and post a patch for confirmation later.

> method might also be wrong since the Class Libraries book says "It is
> not necessary for the strings from which the keys were created to be
> equal."

Hmm, online API doesn't has this comment.


Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]