compiler. Refactored the java generator, fixed #243.