java: not inserting newline before closing brace