Fix newline handling in Java parser.