Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-45315 Drop JDK 8/11 and make JDK 17 by default
  3. SPARK-45501

Use pattern matching for type checking and conversion

    XMLWordPrintableJSON

Details

    Description

      Refer to JEP 394

      Example:

      if (obj instanceof String) {
          String str = (String) obj;
          System.out.println(str);
      } 

      Can be replaced with

       

      if (obj instanceof String str) {
          System.out.println(str);
      } 

      The new code look more compact

      Attachments

        Issue Links

          Activity

            People

              LuciferYang Yang Jie
              LuciferYang Yang Jie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: