Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First comment is removed (partially) #47

Closed
sherter opened this issue May 6, 2016 · 1 comment
Closed

First comment is removed (partially) #47

sherter opened this issue May 6, 2016 · 1 comment
Assignees

Comments

@sherter
Copy link
Contributor

sherter commented May 6, 2016

Formatter formatter = new Formatter();
String result = formatter.formatSource(
  "/*\n" +
  " * my comment */");
System.out.println(result); // prints only "/*" (is the same for javadoc comments)

Seems like there is a problem if there is no \n after the first comment. If there is one (or any other valid source code) it works fine. It also seems to only effect the very first comment (or set of comments, if there is nothing else in between) in the file. Any further comment is printed as expected, even if there is no newline after it.

@cushon
Copy link
Collaborator

cushon commented May 6, 2016

Thanks for reporting this. I think it only affects files that end in a multi-line comment, and have no terminal newline. I'm working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants