Yang Jie created SPARK-45501: -------------------------------- Summary: Use pattern matching for type checking and conversion Key: SPARK-45501 URL: https://issues.apache.org/jira/browse/SPARK-45501 Project: Spark Issue Type: Sub-task Components: Spark Core, SQL Affects Versions: 4.0.0 Reporter: Yang Jie
Refer to [JEP 394|https://openjdk.org/jeps/394] Example: {code:java} if (obj instanceof String) { String str = (String) obj; System.out.println(str); } {code} Can be replaced with {code:java} if (obj instanceof String str) { System.out.println(str); } {code} The new code look more compact -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org