Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
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
Attachments
Issue Links
- duplicates
-
GROOVY-5291 Add "a ?:= 2" support: should be expanded to "a = a ?: 2"
- Closed
- is duplicated by
-
GROOVY-4874 Elvis assignment operator
- Closed
- relates to
-
GROOVY-5306 [PARROT] Add "a ?= 2" support (Elvis assignment): should be expanded to "a = a == null ? 2 : a"
- Closed
-
GROOVY-5291 Add "a ?:= 2" support: should be expanded to "a = a ?: 2"
- Closed
-
GROOVY-4874 Elvis assignment operator
- Closed