<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Dear Jim,
<div><br>
</div>
<div>Thanks for your email.<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 3 Nov 2023, at 07:23, jim <jimdragongod@126.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div style="line-height: 1.7; font-size: 14px; font-family: Arial;">
<div style="margin:0;">Dear Authors of JLS 21:</div>
<div style="margin:0;"> I've found two uncertain technical errors and omissions of 《The Java® Language Specification Java SE 21 Edition》,as follows:</div>
<div style="margin:0;">(1)uncertain omission</div>
<div style="margin:0;"> The "<b>Chapter 19</b>.<b> Syntax</b>" says: "This chapter repeats the syntactic grammar given in Chapters 4, 6-10, 14, and 15, as well as key parts of the lexical grammar from Chapter 3, using the notation from §2.4." I checked
over all the repeated productions after Chapter 3, and found that the "<span style="font-size: 11pt; font-family: Times-Bold; font-weight: bold; --darkreader-inline-color: #e8e6e3;" data-darkreader-inline-color="">Productions from §14 (</span><span style="font-size: 11pt; font-family: Times-BoldItalic; font-weight: bold; font-style: italic; --darkreader-inline-color: #e8e6e3;" data-darkreader-inline-color="">Blocks,
Statements, and Patterns</span><span style="font-size: 11pt; font-family: Times-Bold; font-weight: bold; --darkreader-inline-color: #e8e6e3;" data-darkreader-inline-color="">)</span>"<b> lacked the definition of production "VariableAccess"</b>, which is:</div>
<div style="margin:0;"> VariableAccess:</div>
<div style="margin:0;"> ExpressionName</div>
<div style="margin:0;"> FieldAccess</div>
<div style="margin:0;">I think this may be an omission, because all other productions after Chapter 3 are present.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Indeed it is an omission! Thanks. This will be corrected in the next edition of the JLS.</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div style="line-height: 1.7; font-size: 14px; font-family: Arial;">
<div>(2)uncertain error comment</div>
<div>
<div>Sited from the two possible <span style="font-family: Times-Roman; font-size: 9pt;">execution </span>order "Example 17.4.5-1" in Chapter 17:</div>
</div>
<div>
<div><span style="font-size: 8pt; font-family: Courier;">1: B = 1; </span></div>
<div><span style="font-size: 8pt; font-family: Courier;">3: A = 2; </span></div>
<div><span style="font-size: 8pt; font-family: Courier;">2: r2 = A; // sees initial write of 0
</span></div>
<div><span style="font-size: 8pt; font-family: Courier;">4: r1 = B; // sees initial write of 0</span></div>
<div>and</div>
<div><span style="font-size: 8pt; font-family: Courier;">1: r2 = A; // sees write of A = 2
</span></div>
<div><span style="font-size: 8pt; font-family: Courier;">3: r1 = B; // sees write of B = 1
</span></div>
<div><span style="font-size: 8pt; font-family: Courier;">2: B = 1; </span></div>
<div><span style="font-size: 8pt; font-family: Courier;">4: A = 2;</span></div>
<div>I think there should be a swap between the above comments,is it right?</div>
<br>
</div>
</div>
</blockquote>
<br>
</div>
<div>No, I don’t think so. If you read to the end of the example (I highlight the import part in bold):</div>
<div><br>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>
<div>
<div>In this execution, <b>the reads see writes that occur later in the execution order.</b> This may seem</div>
</div>
</div>
<div>
<div>
<div>counterintuitive, but is allowed by happens-before consistency. Allowing reads to see later</div>
</div>
</div>
<div>
<div>
<div>writes can sometimes produce unacceptable behaviors.</div>
</div>
</div>
</blockquote>
<div>
<div><br>
</div>
<div><br>
</div>
<div>You are being confused by the “counterintuitive” semantics I think!</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Gavin</div>
<div><br>
</div>
<br>
</div>
</body>
</html>