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:19:06 UTC

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

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

Paul King closed GROOVY-7584.
-----------------------------

> 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
>            Assignee: Paul King
>             Fix For: 2.4.8
>
>
> 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.15#6346)