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

John Wagenleitner resolved GROOVY-7940.
---------------------------------------
       Resolution: Fixed
         Assignee: John Wagenleitner
    Fix Version/s: 2.4.8

Thanks for reporting the issue!

> Inconsistent handling of undocumented primitive data types at the @Lazy 
> annotation under use of extends
> -------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7940
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7940
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.4.5
>         Environment: Any
>            Reporter: Maik Igloffstein
>            Assignee: John Wagenleitner
>              Labels: data, extends, lazy, primitives, super, types
>             Fix For: 2.4.8
>
>
> *Documentation:* 
> http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/Lazy.html
> The documentations describes the usage of _@Lazy_ like:
> {{@Lazy T x}}
> I'm aware of that _T_ means no primitive data types, but groovy allows it and 
> generates the code - so why not.
> {code}
> class Super {
>     boolean aBoolean = true
>     int aInt = 5
> }
> class Testing extends Super {
>     @Lazy
>     boolean aBoolean = { false }()
>     
>     @Lazy
>     int aInt = { 5 * 5 }()
> }
> println new Testing().isaBoolean()
> println new Testing().getaBoolean()
> println new Testing().getaInt()
> println new Testing().aBoolean
> println new Testing().aInt
> {code}
> Result:
> {code}
> true
> false
> 25
> true
> 25
> {code}
> The behavior is inconsistent.
> boolean: results are from the super class
> int: results are from the child class
> -Please fix it or throw a _'RuntimeException'_ when primitive data types are 
> used.-
> *Update:*
> Please let _@Lazy_ implement \_is\_Boolean() instead of \_get\_Boolean() when 
> using primitive data type boolean and document it or just throw a 
> _'RuntimeException'_.



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

Reply via email to