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

Use pattern matching for instanceof at module jdk.compiler

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      generic
    • OS:
      generic

      Description

      The JEP-394 implemented pattern matching for instanceof at JDK-16. Please see https://openjdk.java.net/jeps/394 for more information.

      It is nice for javac to update the code to make use of pattern matching for instanceof.

      I used the command `grep -r "instanceof" src/jdk.compiler > instanceof.txt` to search the code which may need to be revised. Then I identified all the entries manually and marked the entries which actually need to be revised. Please see the attachment `instanceof.txt`. The entries with "!" need to be revised.

      According to the `instanceof.txt`, I created three sub-tasks to avoid the complication of a simgle patch. And the packages that are not mentioned at the sub-tasks don't need to be revised.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: