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 2019/01/23 11:43:00 UTC

[jira] [Updated] (GROOVY-8967) @Immutable not handling property default values from map constructor

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

Paul King updated GROOVY-8967:
------------------------------
    Description: 
{code:java}

import groovy.transform.Immutable

@Immutable
class Thing {
    String value = "default"
}

def thing = new Thing()
assert thing.value == "default"
{code}
Gives:
{noformat}
Assertion failed: 

assert thing.value == "default"
       |     |     |
       |     null  false
       Thing(null)
{noformat}


  was:
{code:java}

import groovy.transform.Immutable

@Immutable
class Thing {
String value = "default"
}

def thing = new Thing()
assert thing.value == "default"
{code}
Gives:
{noformat}
Assertion failed: 

assert thing.value == "default"
       |     |     |
       |     null  false
       Thing(null)
{noformat}



> @Immutable not handling property default values from map constructor
> --------------------------------------------------------------------
>
>                 Key: GROOVY-8967
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8967
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Priority: Major
>
> {code:java}
> import groovy.transform.Immutable
> @Immutable
> class Thing {
>     String value = "default"
> }
> def thing = new Thing()
> assert thing.value == "default"
> {code}
> Gives:
> {noformat}
> Assertion failed: 
> assert thing.value == "default"
>        |     |     |
>        |     null  false
>        Thing(null)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)