robin
01/26/2017, 11:10 AMZERO
and MAX_PRECISION
values are instance members (as there is no such thing as static in Kotlin) and get initialized everytime a new instance of the class is initialized, hence an infinite loop emerges through the ZERO
property. As Adam said, you need to move them to a companion object.
Next time, try using the Java2Kotlin converter in IntelliJ - for the Java class you pasted it generates the correct kotlin equivalent without an infinite recursive call happening 😉