RFR: 8302344: Compiler Implementation for Unnamed patterns and variables (Preview) [v13]
Joe Darcy
darcy at openjdk.org
Thu May 4 21:00:25 UTC 2023
On Thu, 4 May 2023 17:48:28 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:
>> This PR implements [JEP 443](https://openjdk.org/jeps/443), the preview feature for Unnamed Patterns and Variables in Java.
>>
>> Draft Spec: https://cr.openjdk.org/~abimpoudis/unnamed/latest/
>
> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
>
> Add test
src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java line 114:
> 112: */
> 113: @PreviewFeature(feature=PreviewFeature.Feature.UNNAMED, reflective = true)
> 114: default boolean isUnnamed() { return false; }
Looking at the various sources more closely, I'll revise my previous guidance and recommend the default method be defined as:
return getSimpleName().isEmpty()
which would also avoid the strict need to override the method in Symbol.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1185505824
More information about the kulla-dev
mailing list