Bug 49899

Summary: [formatting] Code formatter shouldnt format pre tags in javadoc
Product: [Eclipse Project] JDT Reporter: Robert (Kraythe) Simmons <robert.simmons>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 Keywords: needinfo
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Robert (Kraythe) Simmons CLA 2004-01-13 06:03:03 EST
If I use a pre tag in my javadoc, the code formatter should leave the contents 
of the pre tag untouched. For example, the following shouldnt be changed. 

	/**
	 * Setter for endDateTime; The date and time that this event ends 
(§2.3.11).
	 *
	 * @param endDateTime The new value for endDateTime.
	 * @preconditions
	 * <pre>
	 * endDateTime != null
	 * and if startDateTime != null 
	 *     then endDateTime > startDateTime
	 *          and endDateTime - startDateTime == duration
	 * </pre>
	 */

However, the code formatter currently reformats my pre to look like the 
following: 

	/**
	 * Setter for endDateTime; The date and time that this event ends
	 * (§2.3.11).
	 * 
	 * @param endDateTime The new value for endDateTime. @preconditions
	 * 
	 * <pre>
	 *  endDateTime != null and if startDateTime != null then endDateTime 
> startDateTime and endDateTime - startDateTime == duration
	 * </pre>
	 */

This is clearly not the right thing to do.
Comment 1 Olivier Thomann CLA 2004-01-13 10:05:20 EST
Move to JDT/Text for comment.
Comment 2 Dani Megert CLA 2004-01-13 12:28:58 EST
This is an option: per default we assume code fragments inside pre tags and
format them as it would be Javadoc.

You can disable this in the Code Formatter preferences:
[] Format Java code snippets
Comment 3 Dani Megert CLA 2007-06-22 09:59:05 EDT
Get rid of deprecated state.
Comment 4 Dani Megert CLA 2007-06-22 10:04:25 EDT
.