Note with the issue
vault/10_mechanisms/switch-expression-arrow-syntax.md
The issue
The technical content is accurate throughout. The three structural properties of switch
expressions (expression, exhaustiveness, yield), the fall-through absence, the enum
exhaustiveness example, and the yield vs return distinction are all correctly described.
JEP 361 (Java 14, final) is the correct primary reference.
Point 1 -- Incorrect JLS section in secondary_sources.
The frontmatter lists:
secondary_sources: ["JLS §14.11.1 (switch expression)"]
JLS §14.11.1 is the switch block of a switch statement, not a switch expression.
Switch expressions are specified in JLS §15.28, with the switch block of a switch
expression at §15.28.1 and run-time evaluation at §15.28.2. §14.11 and its subsections
cover switch statements exclusively. The label "(switch expression)" applied to §14.11.1
is factually incorrect and points the reader to the wrong section of the specification.
Point 2 -- Broken links.
All three outgoing links in the Connections section point to notes that do not exist in
the vault:
- [[switch-classic-fall-through]] -- no file found
- [[switch-with-pattern-matching]] -- no file found
- [[switch-vs-if-else-chain]] -- no file found
There are no working outgoing links in this note's Connections section. The graph rules
require between 2 and 6 outgoing links with explicit relationship labels; the current
state has 3 links, all broken.
Suggested correction
For point 1, replace the secondary_sources entry:
From: "JLS §14.11.1 (switch expression)"
To: "JLS §15.28 (switch expressions); JLS §15.28.1 (switch block of a switch expression)"
For point 2: editorial discretion. If [[switch-with-pattern-matching]] is planned as a
future note (it is also referenced in instanceof-pattern-matching.md), the link can stay.
If not planned, the connection should be replaced or removed.
Affected Java version
Point 1 is a citation error independent of Java version. The JLS sections referenced
(§15.28, §15.28.1, §15.28.2) apply to Java 14 through Java 25 without change.
Switch expression syntax and semantics are unchanged in Java 21 and Java 25.
Note with the issue
vault/10_mechanisms/switch-expression-arrow-syntax.mdThe issue
The technical content is accurate throughout. The three structural properties of switch
expressions (expression, exhaustiveness, yield), the fall-through absence, the enum
exhaustiveness example, and the yield vs return distinction are all correctly described.
JEP 361 (Java 14, final) is the correct primary reference.
Point 1 -- Incorrect JLS section in secondary_sources.
The frontmatter lists:
JLS §14.11.1 is the switch block of a switch statement, not a switch expression.
Switch expressions are specified in JLS §15.28, with the switch block of a switch
expression at §15.28.1 and run-time evaluation at §15.28.2. §14.11 and its subsections
cover switch statements exclusively. The label "(switch expression)" applied to §14.11.1
is factually incorrect and points the reader to the wrong section of the specification.
Point 2 -- Broken links.
All three outgoing links in the Connections section point to notes that do not exist in
the vault:
There are no working outgoing links in this note's Connections section. The graph rules
require between 2 and 6 outgoing links with explicit relationship labels; the current
state has 3 links, all broken.
Suggested correction
For point 1, replace the secondary_sources entry:
From: "JLS §14.11.1 (switch expression)"
To: "JLS §15.28 (switch expressions); JLS §15.28.1 (switch block of a switch expression)"
For point 2: editorial discretion. If [[switch-with-pattern-matching]] is planned as a
future note (it is also referenced in instanceof-pattern-matching.md), the link can stay.
If not planned, the connection should be replaced or removed.
Affected Java version
Point 1 is a citation error independent of Java version. The JLS sections referenced
(§15.28, §15.28.1, §15.28.2) apply to Java 14 through Java 25 without change.
Switch expression syntax and semantics are unchanged in Java 21 and Java 25.