change condition mistake
Fixes for JSON serialization issues of GROOVY-6937 and GROOVY-6852