groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ocs@ocs.cz" <...@ocs.cz>
Subject improve null-handling
Date Sun, 19 Feb 2017 13:37:37 GMT
Hi there,

is there a way to make sure in Groovy

(a) that instead of "Cannot cast object 'null' with class 'null' to class 'XXX'" for numeric
primitive types XXX (like int) one gets simply a XXX containing 0
(b) that instead of "Cannot resolve which method to invoke for [null] due to overlapping prototypes"
(which happens e.g., with foo+bar if foo is null) one gets simply null as a result of the
expression?

Thanks,
OC


Mime
View raw message