Don't use static functions because of performance issues on java
([haxe#3025](https://github.com/HaxeFoundation/haxe/issues/3025))