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

Use pattern matching for instanceof at module jdk.compiler

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • tools
    • Fix Understood
    • generic
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: