I moved my CSV export loop from Java to Groovy and now the job dies on the row with missing nickname. Java FieldEncoder has three encode overloads (String, Number, Collection), and null should become token NULL. In old Java code encoder.encode(user.getNickname()) works fine with null.
Groovy side:
def cells = COLUMNS.collect { col -> encoder.encode(row[col]) }
Row 3 has no nickname key. First line of the error say ambiguous method overloading, and the argument list is [null]. I print row[col] and it show null, so map looks normal. I also changed nullToken, no difference.
Is Groovy 4.0.22 returning something strange for missing key, or not supporting the null token option? Why Java handle null here but Groovy cannot?
Thanks for any help.