Description
def b = null assert b == null def a = null.getClass().newInstance() println a.getClass() assert a == null
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.
Attachments
Issue Links
- relates to
-
GROOVY-6958 null != NullObject when using Categories
- Closed
- links to