{"action":"created","issue":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2329","labels_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2329/labels{/name}","comments_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2329/comments","events_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2329/events","html_url":"https://github.com/checkstyle/checkstyle/issues/2329","id":110967638,"number":2329,"title":"Javadoc isn't parsed correctly in files with only CR newlines","user":{"login":"robertwhitebit","id":11049034,"avatar_url":"https://avatars.githubusercontent.com/u/11049034?v=3","gravatar_id":"","url":"https://api.github.com/users/robertwhitebit","html_url":"https://github.com/robertwhitebit","followers_url":"https://api.github.com/users/robertwhitebit/followers","following_url":"https://api.github.com/users/robertwhitebit/following{/other_user}","gists_url":"https://api.github.com/users/robertwhitebit/gists{/gist_id}","starred_url":"https://api.github.com/users/robertwhitebit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertwhitebit/subscriptions","organizations_url":"https://api.github.com/users/robertwhitebit/orgs","repos_url":"https://api.github.com/users/robertwhitebit/repos","events_url":"https://api.github.com/users/robertwhitebit/events{/privacy}","received_events_url":"https://api.github.com/users/robertwhitebit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/checkstyle/checkstyle/labels/antlr","name":"antlr","color":"000000"},{"url":"https://api.github.com/repos/checkstyle/checkstyle/labels/approved","name":"approved","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-12T12:45:41Z","updated_at":"2015-10-13T08:38:49Z","closed_at":null,"body":"Printing the javadoc tree by using the [JavadocTreePrinter](https://github.com/checkstyle/contribution/blob/d3b74a1ae272ba15bd6a913c7686f1fcb2ec7622/javadoc-tree-serializer/JavadocTreePrinter.java) from the contribution repository for the checkstyle test file [InputNewlineCrAtEndOfFile.java](https://github.com/checkstyle/checkstyle/blob/aaf606ee0268f140c3694baba4c13b03f7839522/src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineCrAtEndOfFile.java) will print following tree:\r\n```\r\n|--TEXT[7x0] : [\\r * Test case for detection of an existing CR newline at EOF, using the \\r * NewlineAtEndOfFileCheck.\\r * @author Martin Steiger\\r *]\r\n|--EOF[7x129] : [<EOF>]\r\n```\r\nIf a file is using just CR line endings, newlines or tokens in the javadoc won't be detected.\r\nReplacing all CR by LF in the file will print the correct javacdoc tree:\r\n```\r\n|--NEWLINE[7x0] : [\\n]\r\n|--LEADING_ASTERISK[8x0] : [ *]\r\n|--TEXT[8x2] : [ Test case for detection of an existing CR newline at EOF, using the ]\r\n|--NEWLINE[8x71] : [\\n]\r\n|--LEADING_ASTERISK[9x0] : [ *]\r\n|--TEXT[9x2] : [ NewlineAtEndOfFileCheck.]\r\n|--NEWLINE[9x27] : [\\n]\r\n|--LEADING_ASTERISK[10x0] : [ *]\r\n|--WS[10x2] : [ ]\r\n|--JAVADOC_TAG[10x3] : [@author Martin Steiger\\n *]\r\n    |--AUTHOR_LITERAL[10x3] : [@author]\r\n    |--WS[10x10] : [ ]\r\n    |--DESCRIPTION[10x11] : [Martin Steiger\\n *]\r\n        |--TEXT[10x11] : [Martin Steiger]\r\n        |--NEWLINE[10x25] : [\\n]\r\n        |--LEADING_ASTERISK[11x0] : [ *]\r\n|--EOF[11x2] : [<EOF>]\r\n```\r\n\r\nReplacing all CR by Windows line endings CR+LF also does work correctly:\r\n```\r\n|--NEWLINE[7x0] : [\\r\\n]\r\n|--LEADING_ASTERISK[8x0] : [ *]\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/checkstyle/checkstyle/issues/comments/147648385","html_url":"https://github.com/checkstyle/checkstyle/issues/2329#issuecomment-147648385","issue_url":"https://api.github.com/repos/checkstyle/checkstyle/issues/2329","id":147648385,"user":{"login":"baratali","id":3431491,"avatar_url":"https://avatars.githubusercontent.com/u/3431491?v=3","gravatar_id":"","url":"https://api.github.com/users/baratali","html_url":"https://github.com/baratali","followers_url":"https://api.github.com/users/baratali/followers","following_url":"https://api.github.com/users/baratali/following{/other_user}","gists_url":"https://api.github.com/users/baratali/gists{/gist_id}","starred_url":"https://api.github.com/users/baratali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baratali/subscriptions","organizations_url":"https://api.github.com/users/baratali/orgs","repos_url":"https://api.github.com/users/baratali/repos","events_url":"https://api.github.com/users/baratali/events{/privacy}","received_events_url":"https://api.github.com/users/baratali/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T08:38:49Z","updated_at":"2015-10-13T08:38:49Z","body":"@romani , according to the Javadoc Antlr grammar a newline symbol is '\\n' or '\\r\\n'\r\nhttps://github.com/checkstyle/checkstyle/blob/master/src/main/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocLexer.g4#L62"}}