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

Remove unnecessary preview checks

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • 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.

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

              Created:
              Updated:
              Resolved: