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

Paul King reassigned GROOVY-5769:
---------------------------------

    Assignee: Paul King

> NullObject leak
> ---------------
>
>                 Key: GROOVY-5769
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5769
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>            Reporter: Jochen Theodorou
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 4.0.13
>
>
> {code:Java}
> def b = null  
> assert b == null  
> def a = null.getClass().newInstance()  
> println a.getClass() 
> assert a == null
> {code}
> The program shows a leak of NullObject. newInstance will give an instance. 
> This is problematic in multiple ways. NullObject is supposed to be almost an 
> invisible object, as well as a singleton.
> To make the program above pass we could either fix the compareEquals or we 
> fix newInstance() to return null for NullObject. I prefer the later one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to