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

Remove unnecessary preview checks

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • tools
    • b24
    • generic
    • generic

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: