<div dir="ltr"><div>Hi!</div><div><br></div><div>After this commit <a href="https://github.com/openjdk/jdk/commit/1846a65e32624f6da691c1072f44fcb762b43233#diff-f7198d7dbc99fe4e161d39db820508c743fe03ecf004085625ab241255c98e76L164">https://github.com/openjdk/jdk/commit/1846a65e32624f6da691c1072f44fcb762b43233#diff-f7198d7dbc99fe4e161d39db820508c743fe03ecf004085625ab241255c98e76L164</a>, I was expecting the docs to get updated with the release of Java 23.</div><div><br></div><div>However, the typo is still there: <a href="https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/Deque.html">https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/Deque.html</a></div><div><br></div><div>Wondering when is the change supposed to take effect or does it mean the fix is not complete?</div><div><br></div><div>Regards,</div><div>Turkhan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 25, 2024 at 3:57 PM Chen Liang <<a href="mailto:chen.l.liang@oracle.com">chen.l.liang@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg1513031397526474077">




<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Turkhan, this mail belongs to core-libs-dev list. I have forwarded your mail to the right list.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Indeed, we should claim that peek() is equivalent to peekFirst(); the information in stack section should be a typo, as peek() being the same as peekFirst() is claimed by the deque section and the peek() specification.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I have created a ticket on the Java Bug System to track this issue: <a href="https://bugs.openjdk.org/browse/JDK-8337205" id="m_1513031397526474077OWA15d67861-18eb-83ea-f68a-44cf3e158be6" target="_blank">
[JDK-8337205] Typo in Stack vs Deque Method table in Deque specification - Java Bug System (openjdk.org)</a></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Feel free to open a pull request to jdk to fix this bug.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best, Chen Liang</div>
<div id="m_1513031397526474077appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_1513031397526474077divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> jdk-dev <<a href="mailto:jdk-dev-retn@openjdk.org" target="_blank">jdk-dev-retn@openjdk.org</a>> on behalf of Turkhan Badalov <<a href="mailto:badalov.turxan@gmail.com" target="_blank">badalov.turxan@gmail.com</a>><br>
<b>Sent:</b> Thursday, July 25, 2024 4:58 AM<br>
<b>To:</b> <a href="mailto:jdk-dev@openjdk.org" target="_blank">jdk-dev@openjdk.org</a> <<a href="mailto:jdk-dev@openjdk.org" target="_blank">jdk-dev@openjdk.org</a>><br>
<b>Subject:</b> Should the documentation state peekFirst() as equivalent to Stack's peek()?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Here is the table "Comparison of Stack and Deque methods" that lists equivalent Deque methods compared to Stack methods:
<a href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html" target="_blank">
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html</a></div>
<div><br>
</div>
<div>At the moment, getFirst() is said to be equivalent to peek(). Since peek() doesn't throw an exception when the queue/stack is empty, peekFirst() could be a better equivalent because getFirst() throws.</div>
<div><br>
</div>
<div>In fact, the documentation of the peek() method itself says that this method is equivalent to peekFirst():
<a href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html#peek()" target="_blank">
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/util/Deque.html#peek()</a>.</div>
<div><br>
</div>
<div>If this should be posted somewhere else, please let me know. I am still new to using mailing lists. Cheers.<br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>

</div></blockquote></div>