[
https://issues.apache.org/jira/browse/MNG-8482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tamas Cservenak updated MNG-8482:
---------------------------------
Fix Version/s: 4.0.0-rc-3
> Use instanceof assignments to get rid of casting expressions
> ------------------------------------------------------------
>
> Key: MNG-8482
> URL: https://issues.apache.org/jira/browse/MNG-8482
> Project: Maven
> Issue Type: Improvement
> Affects Versions: 4.0.0-rc-2
> Reporter: Nils Breunese
> Priority: Minor
> Fix For: 4.0.0-rc-3
>
>
> Java's {{instanceof}} can be used to get rid of casting expressions. The
> Maven code base contains a lot of snippets like this:
> {code}
> if (val instanceof Boolean) {
> return (Boolean) val;
> }
> {code}
> By declaring an automatically cast variable this can be simplified:
> {code}
> if (val instance Boolean bool) {
> return bool;
> }
> {code}
> I can create a merge request to apply this pattern wherever applicable to get
> rid of the casting expressions after {{instanceof}} checks.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)