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/02/01 23:17:53 UTC

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

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

Paul King closed GROOVY-3880.
-----------------------------

> 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
>             Fix For: 3.0
>
>
> 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)