Summary
JEP 443 previewed the Java
language with unnamed variables, which can be initialized but not used, and
unnamed patterns, which match a record component without stating the component's
name or type. Both are denoted by an underscore character, _
. We propose to
make this feature final and permanent.
Problem
Since no changes were requested we propose to make the feature final and permanent.
Solution
No essential implementation changes are proposed apart from removing the
--enable-preview
protection and making the Tree API for underscore
(AnyPatternTree
) permanent. The removal of the @PreviewFeature
will be the
only part of the API changes.
The javax.lang.model
will be also finalized accordingly. The previous changeset was tracked in a separate
CSR: 8307577: Implementation for javax.lang.model for unnamed variables (Preview).
Specification
The specification draft was reviewed under CSR JDK-8304246. There are no new updates to the specification.
The previously proposed API enhancements are not enhanced or altered. The preliminary specdiff will be attached as 8315851.specdiff.zip.
The changes to the specification and API are a subject of change until the CSR is finalized.
- csr of
-
JDK-8315532 Compiler Implementation for Unnamed Variables & Patterns
- Resolved
- relates to
-
JDK-8304246 Compiler Implementation for Unnamed patterns and variables (Preview)
- Closed
-
JDK-8307577 Implementation for javax.lang.model for unnamed variables (Preview)
- Closed