Bug 233259 - [formatter] html tag should not be split by formatter
Summary: [formatter] html tag should not be split by formatter
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 235464 237942 (view as bug list)
Depends on: 238090
Blocks:
  Show dependency tree
 
Reported: 2008-05-21 11:33 EDT by David Audel CLA
Modified: 2008-08-28 12:12 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (11.03 KB, patch)
2008-06-24 09:06 EDT, 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 David Audel CLA 2008-05-21 11:33:51 EDT
build I20080520-2000

1) create the java project P
2) change the maximum line width to 40 instead of 80 for comment in formatter preferences
3) create Test.java
public class Test {
	/**
	 * @see <a href="http://0">Test</a>
	 * @see <a href="http://0123">Test</a>
	 * @see <a href="http://012346789">Test</a>
	 * @see <a href="http://012346789012346789012346789">Test</a>
	 */
	void foo() {
		
	}
}
4) format Test.java
The result is:
public class Test {
	/**
	 * @see <a href="http://0">Test< /a>
	 * @see <a href="http://0123">Test<
	 *      /a>
	 * @see <a
	 *      href="http://012346789">Test
	 *      < /a>
	 * @see <a href=
	 *      "http://012346789012346789012346789"
	 *      >Test< /a>
	 */
	void foo() {

	}
}

In the first 'see' tag a space must not be added </a> html tag.
In the second see' tag the </a> must not be split.
In the third and in the last 'see' tag perhaps the full tag <a> should not be split.

In 3.3.2 the formatted source is:
public class Test {
	/**
	 * @see <a href="http://0">Test</a>
	 * @see <a href="http://0123">Test</a>
	 * @see <a
	 *      href="http://012346789">Test</a>
	 * @see <a
	 *      href="http://012346789012346789012346789">Test</a>
	 */
	void foo() {

	}
}
Comment 1 Frederic Fusier CLA 2008-06-04 02:41:17 EDT
*** Bug 235464 has been marked as a duplicate of this bug. ***
Comment 2 Frederic Fusier CLA 2008-06-20 09:52:38 EDT
The problem is that an invalid FormatJavadoc structure is built while parsing the html reference...
Comment 3 Frederic Fusier CLA 2008-06-24 09:06:14 EDT
Created attachment 105695 [details]
Proposed patch

The simplest solution to fix this issue is to create a fake reference for strings or href references as the Scribe does not allow to split them elsewhere than at a space position...

Note that this patch fixes bug 237942 as well...
Comment 4 Frederic Fusier CLA 2008-06-24 09:17:15 EDT
Released for 3.5M1 in HEAD stream.
Comment 5 Frederic Fusier CLA 2008-06-25 07:07:59 EDT
While trying to split the patch between this bug and bug 237942, I realized that it depends on fix for bug 238090. Otherwise, some added tests and even some existing tests fail...
Comment 6 Frederic Fusier CLA 2008-06-25 07:24:54 EDT
*** Bug 237942 has been marked as a duplicate of this bug. ***
Comment 7 Frederic Fusier CLA 2008-06-25 07:27:12 EDT
Released for 3.4.1
Comment 8 Olivier Thomann CLA 2008-08-06 12:22:58 EDT
Verified for 3.5M1 using I20080805-1307
Comment 9 Olivier Thomann CLA 2008-08-06 13:15:18 EDT
Reopen to close as RESOLVED/FIXED. Will be closed as VERIFIED during 3.4.1
verification pass.
Comment 10 Olivier Thomann CLA 2008-08-06 13:15:31 EDT
Fixed.
Comment 11 Olivier Thomann CLA 2008-08-28 12:12:32 EDT
Verified for 3.4.1 using M20080827-2000.