Bug 295175 - [formatter] Missing space before a string at the beginning of a line in a javadoc comment
Summary: [formatter] Missing space before a string at the beginning of a line in a jav...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 04:36 EST by Frederic Fusier CLA
Modified: 2009-12-08 05:50 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (10.32 KB, patch)
2009-11-15 12:39 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2009-11-15 04:36:30 EST
Build N20091112-2000, since bug 294529 has been released.

The following test case:
public class X {
/**
 * <p>
 * "String", this string may be not well formatted in certain circumstances,
 * typically after bug 294529 has been fixed...
 */
void foo() {}
}

is formatted as follow:
public class X {
    /**
     * <p>
     *"String", this string may be not well formatted in certain circumstances,
     * typically after bug 294529 has been fixed...
     */
    void foo() {
    }
}

Note that a space is missing before the "String"...
Comment 1 Frederic Fusier CLA 2009-11-15 04:38:48 EST
This is a side effect of the fix for bug 294529. It exhibits a problem in the comment formatter... The fix is trivial.
Comment 2 Frederic Fusier CLA 2009-11-15 12:39:24 EST
Created attachment 152245 [details]
Proposed patch

Hmmm, finally not so easy... The fact that the exception is now correctly raised, made the formatter typically wrong while computing length of immutable tags. This patch improves the ouptput of more than 1,200 files while running the massive tests on all full source workspaces!
Comment 3 Frederic Fusier CLA 2009-11-15 12:47:46 EST
Here are some other test cases fixed by the patch:

1) InvalidInputException inside a <code> tag

public class X01 {

	/**
	 * Finds the deepest <code>IJavaElement</code> in the hierarchy of
	 * <code>elt</elt>'s children (including <code>elt</code> itself)
	 * which has a source range that encloses <code>position</code>
	 * according to <code>mapper</code>.
	 */
	void foo() {}
}

2) Text starting without space on a javadoc comment line:

public interface X02 {

    /**
     *Formatter misses to insert the space at the beginning of the line
     *<p>In this case also...
     * 
     * <p>
     * <BR>
     *<B>In this case also</B>
     **/
    void foo();
}
Comment 4 Frederic Fusier CLA 2009-11-15 14:32:51 EST
Released for 3.6M4 in HEAD stream.
Comment 5 Satyam Kandula CLA 2009-12-08 05:35:22 EST
Verified for 3.6M4 using Build id: I20091207-1800