Re: Constructor `String(String)` does not copy `hashIsZero`

2021-11-22 Thread Japris Pogrammer
Thanks, I've created the PR [1] with the fix.

[1]: https://github.com/openjdk/jdk/pull/6511

вт, 23 нояб. 2021 г., 01:42 Claes Redestad :

> Hi,
>
> this appears to be unintentionally left out. I've filed a bug[1].
>
> While marked as an @IntrinsicCandidate, I can't see that HotSpot/C2 is
> actually intrinsifying this constructor. The signature is used for
> some pattern matching in the legacy stringopts.cpp code, though. So
> the trivial fix should help a bit.
>
> Thanks
> Claes
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8277606
>
> On 2021-11-22 22:20, Japris Pogrammer wrote:
> > According to openjdk/jdk [1] current copy-constructor of String class
> does
> > not copy the value of hashIsZero field which may lead to 0-hash being
> > recalculated on copy even if it is known to be 0.
> > Could you please tell me if I am right with this point or if this
> behaviour
> > is intentional?
> > If this is actually a bug then I am ready to propose a trivial fix for
> > it[2].
> >
> > [1]:
> >
> https://github.com/openjdk/jdk/blob/05a9a51dbfc46eb52bc28f1f9a618c75ee2597e9/src/java.base/share/classes/java/lang/String.java#L259-L264
> > [2]: https://github.com/JarvisCraft/jdk/tree/String-copy-zero-hashCode
> >
>


Constructor `String(String)` does not copy `hashIsZero`

2021-11-22 Thread Japris Pogrammer
According to openjdk/jdk [1] current copy-constructor of String class does
not copy the value of hashIsZero field which may lead to 0-hash being
recalculated on copy even if it is known to be 0.
Could you please tell me if I am right with this point or if this behaviour
is intentional?
If this is actually a bug then I am ready to propose a trivial fix for
it[2].

[1]:
https://github.com/openjdk/jdk/blob/05a9a51dbfc46eb52bc28f1f9a618c75ee2597e9/src/java.base/share/classes/java/lang/String.java#L259-L264
[2]: https://github.com/JarvisCraft/jdk/tree/String-copy-zero-hashCode


AbstractProcessor overrides process(..) for no reason

2021-10-16 Thread Japris Pogrammer
Hi there, I've seen that javax.annotation.processing.AbstractProcessor
overrides `Processor#process(..)` method without any changes to it [1]:
- it still is abstract
- signature is untouched
- javadoc is untouched
Is this done intentionally or this redundant override can be eliminated?

[1]:
https://github.com/openjdk/jdk/blob/bfcf6a29a16bc12d77a897fbec304868957c3188/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java#L167-L171


Thanks,
Peter