Fix enums support in Java