Bug 294500 - [formatter] MalformedTreeException when formatting an invalid sequence of <code> tags in a javadoc comment
Summary: [formatter] MalformedTreeException when formatting an invalid sequence of <co...
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-06 13:30 EST by Frederic Fusier CLA
Modified: 2009-12-08 04:55 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (7.25 KB, patch)
2009-11-09 17:08 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-06 13:30:15 EST
Using 3.6M3 but it occurs since 3.4...

Consider the following test case:

package wkps3;
/**
 * This sample produce an MalformedTreeException
 * when formatted.
 *
 * <p> First paragraph
 * {@link java.lang.String </code>a simple
 * string<code>}.
 *
 * <p> Second paragraph.
 *
 * <p> Third paragraph. </p>
 *
 */
public class X01 {

}

Try to format it using the Eclipse built-in profile and you get a MalformedTreeException!
Comment 1 Frederic Fusier CLA 2009-11-06 13:33:09 EST
Note that modifying the comment 0 sample as follow:

package wkps3;
/**
 * This sample produce an AIIOBE when formatting.
 *
 * <p> First paragraph
 * {@link java.lang.String </code>a simple
 * string<code>}.
 */
public class X02 {

}

produces an AIOOBE when formatting it instead of a MTE... Not sure this is the same problem. I'll open a separate bug if after having investigated I see that's a different issue...
Comment 2 Frederic Fusier CLA 2009-11-09 17:08:37 EST
Created attachment 151747 [details]
Proposed patch

Store the html tag level when entering into an inline tag, hence it's possible to restore it if necessary when leaving...
Comment 3 Frederic Fusier CLA 2009-11-09 17:09:19 EST
Released for 3.6M4 in HEAD stream.
Comment 4 Satyam Kandula CLA 2009-12-08 04:46:49 EST
Verified for 3.6M4 using I20091207-1800
Comment 5 Srikanth Sankaran CLA 2009-12-08 04:55:06 EST
Verified for 3.6M4 using Build id: I20091207-1800