Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8317222

Implementation for javax.lang.model for Unnamed Variables & Patterns

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 22
    • core-libs
    • None
    • source
    • minimal
    • Hide
      Update the version string in javax.lang.model in newly introduced method
      Show
      Update the version string in javax.lang.model in newly introduced method
    • 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.

            abimpoudis Angelos Bimpoudis
            abimpoudis Angelos Bimpoudis
            Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: