-
CSR
-
Resolution: Approved
-
P4
-
None
-
source
-
minimal
-
-
Java API
-
SE
Summary
JEP 456: Unnamed Variables & Patterns finalizes unnamed variables in Java. javax.lang.model is updated accordingly.
Problem
JEP 456 finalizes JEP 443 which was a preview feature to repurpose the underscore token (_
) to denote unnamed variables in Java in various locations.
JEP 443 modified the method javax.lang.model.element.VariableElement::getSimpleName() to return empty name in the case of unnamed variables, making it consistent with unnamed packages, unnamed modules and anonymous classes.
Also added a new predicate method javax.lang.model.element.VariableElement::isUnnamed(). The default implementation of this method examines whether getSimpleName() returns an empty name.
Solution
We propose to finalize the changes in javax.lang.model that JEP 443 introduced, namely to update the version of javax.lang.model.element.VariableElement::isUnnamed().
Specification
The proposed API enhancements will be attached as 8317222.specdiff.zip
. These include the changes in javax/lang/model.
- csr of
-
JDK-8317221 Implementation for javax.lang.model for Unnamed Variables & Patterns
- Resolved