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:08 UTC
[jira] [Closed] (GROOVY-7933) Incorrect boxing of boolean primitive
types
[ https://issues.apache.org/jira/browse/GROOVY-7933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-7933.
-----------------------------
> Incorrect boxing of boolean primitive types
> -------------------------------------------
>
> Key: GROOVY-7933
> URL: https://issues.apache.org/jira/browse/GROOVY-7933
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.4.7
> Reporter: Henri Tremblay
> Assignee: John Wagenleitner
> Fix For: 2.4.8
>
>
> A boolean primitive type seems to be boxed for no apparent reason. See the example below. The problem disappear when using @CompileStatic or if explicitly casting to (boolean).
> {code:java}
> public class Demo {
> public void a(boolean a){
> System.out.println("boolean was called");
> }
> public void a(Object a){
> System.out.println("Object was called");
> }
> }
> class Groovy {
> static void main(String[] args) {
> def demo = new Demo()
> demo.a(true)
> }
> }
> {code}
> *Output:*
> Object was called
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)