You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Steinar Haugen (JIRA)" <ji...@apache.org> on 2015/09/08 15:41:47 UTC

[jira] [Created] (GROOVY-7584) transient fields in trait are not transient in implementing class

Steinar Haugen created GROOVY-7584:
--------------------------------------

             Summary: transient fields in trait are not transient in implementing class
                 Key: GROOVY-7584
                 URL: https://issues.apache.org/jira/browse/GROOVY-7584
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.4.3
            Reporter: Steinar Haugen


Fields with the transient modifier in a trait will not have the transient modifier in the implementing class. 

Example:

{code:java}
trait User {
    String name
    transient boolean loggedIn
}

class Person implements User {
}

def loggedInField = Person.getDeclaredFields().find { 
    it.name.contains('loggedIn') 
}
assert java.lang.reflect.Modifier.isTransient(loggedInField.modifiers)
{code}

Output:
{noformat}
Assertion failed: 
assert java.lang.reflect.Modifier.isTransient(loggedInField.modifiers)
                                  |           |             |
                                  false       |             2
                                              private boolean Person.User__loggedIn
{noformat}

Looks like it might be related to GROOVY-7514, which looks to me like the same bug, but with the final modifier.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)