You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/10/12 09:16:00 UTC

[jira] [Assigned] (SPARK-45501) Use pattern matching for type checking and conversion

     [ https://issues.apache.org/jira/browse/SPARK-45501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot reassigned SPARK-45501:
--------------------------------------

    Assignee: Apache Spark

> 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
>            Assignee: Apache Spark
>            Priority: Minor
>              Labels: pull-request-available
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org