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

[jira] [Resolved] (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 ]

Yang Jie resolved SPARK-45501.
------------------------------
    Fix Version/s: 4.0.0
       Resolution: Fixed

Issue resolved by pull request 43327
[https://github.com/apache/spark/pull/43327]

> 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: Yang Jie
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>
> 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