2010/2/28 Ulf Zibis :
> Am 25.02.2010 23:07, schrieb Alan Bateman:
>>
>> Kelly O'Hair wrote:
>>>
>>> Yup. My eyes must be tired, I didn't see that. :^(
>>
>> Too many repositories in the air at the same time. The webrev has been
>> refreshed. Thanks Ulf.
>>
>>
>
> Another thought:
>
> In the const
Am 04.03.2010 19:33, schrieb Marek Kozieł:
Hello,
I would suggest:
public int hashCode() {
int h = hash;
if (h == 0) {
h = 0;
char[] val = value;
for (int i = offset, limit = count + i; i != limit; )
h = 31 * h + val[i++];
@Ulf
Few explanations:
1.
> Intersting alternative, but I'm afraid, this is against the spec.
> Shifting all 0's to 1 would break String's hash definition: h = 31 * h +
> val[i++].
Yes it does, any way i think spec is to tight here. Do we really need
hash of each value even if String have length
Am 04.03.2010 03:08, schrieb Jason Mehrens:
String.hash should only have two known states, zero and the actual
computed hash code.
http://bugs.sun.com/view_bug.do?bug_id=6611830
I far theory yes.
But have you read the evaluation ?
"This bug pattern is endemic in the JDK sources."
-Ulf
Ja
Much thanks for your effort.
Am 04.03.2010 21:31, schrieb Marek Kozieł:
@Ulf
Few explanations:
1.
Intersting alternative, but I'm afraid, this is against the spec.
Shifting all 0's to 1 would break String's hash definition: h = 31 * h +
val[i++].
Yes it does, any way i think spec i
2010/3/4 Ulf Zibis :
>> 5.
>> Intern string do not need hash codes co comparing cos they have same
>> address, so first loop would return true if they are equal, after this
>> we need only to check if they are not equal:
>>
>>>
>>> if (isIntern()&& anotherString.isIntern()) return false;
>>>
>
>
Am 04.03.2010 23:38, schrieb Marek Kozieł:
2010/3/4 Ulf Zibis:
5.
Intern string do not need hash codes co comparing cos they have same
address, so first loop would return true if they are equal, after this
we need only to check if they are not equal:
if (isIntern()&&anotherStr
Changeset: cf26288a114b
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/rev/cf26288a114b
Added tag jdk7-b84 for changeset 2f3ea057d1ad
! .hgtags
Changeset: c67a9df7bc0c
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/corba/rev/c67a9df7bc0c
Added tag jdk7-b84 for changeset 68c8961a82e4
! .hgtags
Changeset: 6c0ccabb430d
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/jaxp/rev/6c0ccabb430d
Added tag jdk7-b84 for changeset 32c0cf01d555
! .hgtags
Changeset: 125eb6a9fccf
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/hotspot/rev/125eb6a9fccf
Added tag jdk7-b84 for changeset ffc8d176b84b
! .hgtags
Changeset: 745c853ee57f
Author:johnc
Date: 2010-01-29 14:51 -0800
URL: http:
Changeset: 8424512588ff
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/jaxws/rev/8424512588ff
Added tag jdk7-b84 for changeset 8bc02839eee4
! .hgtags
Changeset: a9b4fde406d4
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/a9b4fde406d4
Added tag jdk7-b84 for changeset 7cb9388bb1a1
! .hgtags
Changeset: 2ba381560071
Author:dcherepanov
Date: 2010-02-12 19:58 +0300
URL: htt
Changeset: 75d5bd12eb86
Author:mikejwre
Date: 2010-02-18 13:31 -0800
URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/75d5bd12eb86
Added tag jdk7-b84 for changeset d9cd5b8286e4
! .hgtags
Changeset: 136bfc679462
Author:lana
Date: 2010-02-23 10:17 -0800
URL: http
14 matches
Mail list logo