Remove unnecessary preview checks

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: tools
    • b24
    • generic
    • generic

      The following preview checks are unnecessary because they are standard features now.

      Attr.java
      ```
              allowReifiableTypesInInstanceof =
                      Feature.REIFIABLE_TYPES_INSTANCEOF.allowedInSource(source) &&
                      (!preview.isPreview(Feature.REIFIABLE_TYPES_INSTANCEOF) || preview.isEnabled());
      ```

      JavacParser.java
      ```
              this.allowYieldStatement = (!preview.isPreview(Feature.SWITCH_EXPRESSION) || preview.isEnabled()) &&
                      Feature.SWITCH_EXPRESSION.allowedInSource(source);
      ```

      Resolve.java
      ```
              allowYieldStatement = (!preview.isPreview(Feature.SWITCH_EXPRESSION) || preview.isEnabled()) &&
                      Feature.SWITCH_EXPRESSION.allowedInSource(source);
      ```

      It is good to remove them.

            Assignee:
            Guoxiong Li
            Reporter:
            Guoxiong Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: