-
Sub-task
-
Resolution: Delivered
-
P4
-
21.0.3-oracle, 22
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8324128 | 21.0.3-oracle | Marc Palmerjohnson | P4 | Resolved | Delivered |
JDK 21 introduced pattern matching in the Java language. However, `javac` allowed `final` in front of a record pattern, such as (`case final R(...) ->`), something which is not allowed by the Java Language Specification.
Programs that could be compiled erroneously in JDK21 with `final` will now fail to compile. This change fixes the issue in the compiler. Impacted users will need to remove the `final` keyword.
Programs that could be compiled erroneously in JDK21 with `final` will now fail to compile. This change fixes the issue in the compiler. Impacted users will need to remove the `final` keyword.
- backported by
-
JDK-8324128 Release Note: Align `javac` with the Java Language Specification by Rejecting `final` in Record Patterns
-
- Resolved
-