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

Remove unnecessary preview checks

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      generic
    • OS:
      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

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

                Dates

                Created:
                Updated:
                Resolved: