You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2021/04/16 04:03:00 UTC

[jira] [Resolved] (GROOVY-10035) Eliminate redundant type cast

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

Daniel Sun resolved GROOVY-10035.
---------------------------------
    Fix Version/s: 4.0.0-beta-1
         Assignee: Daniel Sun
       Resolution: Fixed

> Eliminate redundant type cast
> -----------------------------
>
>                 Key: GROOVY-10035
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10035
>             Project: Groovy
>          Issue Type: Improvement
>          Components: bytecode
>            Reporter: Eric Milles
>            Assignee: Daniel Sun
>            Priority: Minor
>             Fix For: 4.0.0-beta-1
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The ticket is to provide some suggestion to tweak the fix of GROOVY-10034 ( [https://github.com/apache/groovy/pull/1556] ):
> It seems that we could make the check simpler, we do not add extra checks but tweak the existing check.
> h3. *Current*
> [https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java#L334]
> {code:java}
>         if (targetType == top) return;
> {code}
> h3. *Proposed*
> [https://github.com/apache/groovy/pull/1561]
> {code:java}
> if (ClassNodeUtils.isCompatibleWith(top, targetType)) return;
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)