RFR: 8302344: Compiler Implementation for Unnamed patterns and variables [v2]
Aggelos Biboudis
abimpoudis at openjdk.org
Thu Apr 27 14:35:53 UTC 2023
On Wed, 26 Apr 2023 17:36:18 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Introduce new flag to track unnamed variables
>>
>> - Return underscore for Tree API and empty name for javax.lang.model.element.VariableElement.getSimpleName()
>
> src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 716:
>
>> 714: * @since 21
>> 715: */
>> 716: default boolean hasEmptyName(Element element) {
>
> Updating some suggestions from an off-list discussion, ModuleElement and PackageElement both have an isUnnamed predicate. VariableElement could get an isUnnamed predicate (as a default method returning false and an implSpec tag requiring that) or Elements.isUnnamed(VariableElement) could be added similarly.
>
> Presumably, at least any newly-defined methods should get marked as some category of preview method.
>
> Also, please file a issue against core-libs/javax.lang.model for javax.lang.model support for this JEP; having a separate issue makes doing the JSR 269 maintenance release work easier.
PR updated. Thanks for the review!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1179253720
More information about the kulla-dev
mailing list