groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-7584) transient fields in trait are not transient in implementing class
Date Wed, 01 Feb 2017 23:19:06 GMT

     [ 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)

Mime
View raw message