You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/02 02:34:04 UTC

[jira] [Updated] (GROOVY-3880) Optional Assignment Operator

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

Paul King updated GROOVY-3880:
------------------------------
    Fix Version/s:     (was: 3.0.0-alpha-1)

> Optional Assignment Operator
> ----------------------------
>
>                 Key: GROOVY-3880
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3880
>             Project: Groovy
>          Issue Type: Improvement
>          Components: syntax
>            Reporter: Michael Martz
>            Assignee: Daniel Sun
>
> I find myself writing a lot of code in the following form:
> if(data.field) obj.field = data.field
> // Or
> obj.field = data.field?: obj.field
> It would be nice to have a groovy operator to handle this for me.
> obj.field ?= data.field



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)