Skip to content

First comment is removed (partially) #47

@sherter

Description

@sherter
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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions