[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to