Java 20 / JDK 20: General Availability
This is exciting, can't wait for the LTS release next year... that said, I don't much care for the "case SomeType t when ..." pattern matching syntax, I don't see the benefit of introducing a new keyword over using "if"... or even just "&&". To pinch the example used in[1]:<p><pre><code>    case Tuner t && guitar.isInTune() -> ...;</code></pre>
and<p><pre><code>    case Tuner t if guitar.isInTune() -> ...;
</code></pre>
both seem as clear as<p><pre><code>    case Tuner t when guitar.isInTune() -> ...;

</code></pre>
...am I misunderstanding the reasoning here? Is it being introduced to keep the grammar definition simpler?<p>1: <a href="https://foojay.io/today/its-java-20-release-day-heres-whats-new/" rel="nofollow">https://foojay.io/today/its-java-20-release-day-heres-whats-...</a>