<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Well, the sign has no impact here - the most significant 32 bits duplicated from the original sign bit are immediately discarded in the subsequent int cast truncation to the least significant 32 bits. However, how there is such a difference from before OpenJDK
 was published is still intriguing.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Naoto Sato <naoto.sato@oracle.com><br>
<b>Sent:</b> Wednesday, April 30, 2025 3:11 PM<br>
<b>To:</b> core-libs-dev@openjdk.org <core-libs-dev@openjdk.org><br>
<b>Subject:</b> Re: JavaDoc fix in java.util.Date</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Interestingly, the implementation of Date.hashCode() does use the signed
<br>
right shift ">>".<br>
<br>
Naoto<br>
<br>
On 4/30/25 1:06 PM, Chen Liang wrote:<br>
> Indeed, Joe is right. Unsigned right shift does not appear often and is <br>
> equivalent to signed right shift if the sign bit is 0.<br>
> <br>
> However, this piece of quote can get an upgrade - it can become <br>
> `Long.hashCode(this.getTime())`.<br>
> <br>
>   *<br>
>     Chen<br>
> <br>
> ------------------------------------------------------------------------<br>
> *From:* core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of <br>
> Joseph D. Darcy <joe.darcy@oracle.com><br>
> *Sent:* Wednesday, April 30, 2025 2:54 PM<br>
> *To:* Steffen Nießing <zuniquex@protonmail.com>; core-libs- <br>
> dev@openjdk.org <core-libs-dev@openjdk.org><br>
> *Subject:* Re: JavaDoc fix in java.util.Date<br>
> Unsigned right shift is non-existent?<br>
> <br>
> "The operators << (left shift), >> (signed right shift), and >>> <br>
> (unsigned right shift) are called the shift operators. The left-hand <br>
> operand of a shift operator is the value to be shifted; the right-hand <br>
> operand specifies the shift distance. "<br>
> <br>
> <a href="https://docs.oracle.com/javase/specs/jls/se24/html/jls-15.html#jls-15.19">
https://docs.oracle.com/javase/specs/jls/se24/html/jls-15.html#jls-15.19</a> <br>
> <<a href="https://docs.oracle.com/javase/specs/jls/se24/html/jls-15.html#jls-15.19">https://docs.oracle.com/javase/specs/jls/se24/html/jls-15.html#jls-15.19</a>><br>
> <br>
> -Joe<br>
> <br>
> On 4/30/2025 12:46 PM, Steffen Nießing wrote:<br>
>> Hello,<br>
>><br>
>> I'm new to the OpenJDK community and plan to make my first change.<br>
>><br>
>> I've found a small mistake in the documentation of <br>
>> java.util.Date#hashCode(). The documentation provides a Java <br>
>> expression of the returned value, which uses a non-existent operator <br>
>> '>>>'.<br>
>><br>
>> Now I'm searching for a sponsor for a JBS issue and the code review. <br>
>> Chen Liang directed me to this mailing list to ask for sponsoring on <br>
>> this topic.<br>
>><br>
>> Cheers,<br>
>> Steffen<br>
> <br>
> <br>
<br>
</div>
</span></font></div>
</body>
</html>