Java to Kotlin converter: more correct logic for specifying field type