Bug 239941 - [formatter] Unclosed html tags make the formatter to produce incorrect outputs
Summary: [formatter] Unclosed html tags make the formatter to produce incorrect outputs
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:
: 241493 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-08 05:36 EDT by Frederic Fusier CLA
Modified: 2008-08-28 12:45 EDT (History)
4 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Proposed patch (3.09 KB, patch)
2008-07-08 06:52 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for R3_4_maintenance stream (3.12 KB, patch)
2008-07-08 12:42 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 Frederic Fusier CLA 2008-07-08 05:36:17 EDT
Using 3.4.0

Consider the following simple test case:
public interface X01 {

    /**
     * <pre>
     * Unclosed pre tag
     */
    int foo();

    /**
     * Sample showing that the formatter does not handle
     * unclosed html tags properly
     *
     * @return  here's a simple return tag which description lines
     * should be indented when using default Eclipse built-in profile.
     * however due to the unclosed html 'pre' tag in the field javadoc
     * comment, this return tag won't be formatted!
     */
    int bar();
}

Using Eclipse built-in profile + max line length=40, it's currently formatted like:
public interface X01 {

	/**
	 * <pre>
	 * Unclosed pre tag
	 */
	int foo();

	/**
	 * Sample showing that the formatter
	 * does not handle unclosed html
	 * tags properly
	 * 
	 * @return here's a simple return
	 * tag which description lines
	 * should be indented when using
	 * default Eclipse built-in profile.
	 * however due to the unclosed html
	 * 'pre' tag in the field javadoc
	 * comment, this return tag isn't be
	 * formatted!
	 */
	int bar();
}

Note that the return tag description lines are not indented although they should!
Comment 1 Frederic Fusier CLA 2008-07-08 05:40:55 EDT
This is a huge regression comparing to 3.3.

The correct output on the initial test case should be:
public interface X01 {

	/**
	 * <pre>
	 * Unclosed pre tag
	 * 
	 */
	int foo();

	/**
	 * Sample showing that the formatter
	 * does not handle unclosed html
	 * tags properly
	 * 
	 * @return here's a simple return
	 *         tag which description
	 *         lines should be indented
	 *         when using default
	 *         Eclipse built-in profile.
	 *         however due to the
	 *         unclosed html 'pre' tag
	 *         in the field javadoc
	 *         comment, this return tag
	 *         isn't be formatted!
	 */
	int bar();
}

Philippe, do you agree to address this bug for 3.4.1?
Comment 2 Frederic Fusier CLA 2008-07-08 06:52:29 EDT
Created attachment 106804 [details]
Proposed patch

Reset the html tags counter when starting the parse of a new javadoc comment...
Comment 3 Frederic Fusier CLA 2008-07-08 06:55:33 EDT
Released for 3.5M1
Comment 4 Philipe Mulet CLA 2008-07-08 12:09:25 EDT
+1 for 3.4.1
Comment 5 Frederic Fusier CLA 2008-07-08 12:42:19 EDT
Created attachment 106846 [details]
Proposed patch for R3_4_maintenance stream
Comment 6 Frederic Fusier CLA 2008-07-09 04:25:44 EDT
Released for 3.4.1
Comment 7 Olivier Thomann CLA 2008-08-06 12:28:42 EDT
Verified for 3.5M1 using I20080805-1307
Comment 8 Olivier Thomann CLA 2008-08-06 13:29:53 EDT
Reopen to close as RESOLVED/FIXED. Will be closed as VERIFIED during 3.4.1
verification pass.
Comment 9 Olivier Thomann CLA 2008-08-06 13:30:24 EDT
Fixed.
Comment 10 Frederic Fusier CLA 2008-08-19 12:28:42 EDT
*** Bug 241493 has been marked as a duplicate of this bug. ***
Comment 11 Olivier Thomann CLA 2008-08-28 12:45:13 EDT
Verified for 3.4.1 using M20080827-2000