Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.6
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
It seems that the getComment() method "swallow" all the end-of-line
separators.
For example, java.lang.String defines the following blockquote:
- <p><blockquote><pre>
- System.out.println("abc");
- String cde = "cde";
- System.out.println("abc" + cde);
- String c = "abc".substring(2,3);
- String d = cde.substring(1, 2);
- </pre></blockquote>
But getComment() returns the following text:
<p><blockquote><pre> System.out.println("abc"); String cde = "cde";
System.out.println("abc" + cde); String c = "abc".substring(2,3);
String d = cde.substring(1, 2); </pre></blockquote>
Here's a testcase to show the problem:
public void testCommentsCanHaveNewlines() {
String source = "" +
"/** Hello\n"
+ "* world!"
+ "*/" +
"class x{}";
JavaDocBuilder builder = new JavaDocBuilder();
builder.addSource(new StringReader(source));
JavaClass x = builder.getClassByName("x");
assertEquals("Hello\nworld!", x.getComment());
}
Activity
Field | Original Value | New Value |
---|---|---|
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Done!