Bug 233228 - [formatter] line comments which contains \\u are not correctly formatted
Summary: [formatter] line comments which contains \\u are not correctly formatted
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 RC2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-21 10:09 EDT by David Audel CLA
Modified: 2008-05-23 06:20 EDT (History)
2 users (show)

See Also:
david_audel: review+
jerome_lanneluc: review+


Attachments
Proposed patch (12.75 KB, patch)
2008-05-22 05:39 EDT, Frederic Fusier CLA
no flags Details | Diff
New proposed patch (13.29 KB, patch)
2008-05-22 07:13 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 10:09:20 EDT
build I20080520-2000
1) create X.java
public class X {
	//handle the \\u case manually into comment
}
2) format the X.java
The result is:
public class X {
	// handle the \case manually into comment
}
3) save the editor
A Save Problem window appear because 'Some characters cannot be mapped using "Cp1252" character encoding.'
Comment 1 Frederic Fusier CLA 2008-05-22 05:39:16 EDT
Created attachment 101455 [details]
Proposed patch

Jerome, do you agree to put this fix should in RC2?
Comment 2 Frederic Fusier CLA 2008-05-22 07:13:20 EDT
Created attachment 101466 [details]
New proposed patch

Previous patch had a glitch with following test case:

package test.bugs.b233228;
public class X03 {
	void foo() {
		if (true) {
			/* Destroy the new icon src and mask and hdc's*/
			destroy();
		}
	}

	void destroy() {
	}

}

The problem was when invalid token exception occurred just before the end of the javadoc without any whitespaces to stop the invalid token consuming... This is fixed now and tests on all workspaces do not show any regression.
Comment 3 Frederic Fusier CLA 2008-05-22 07:30:34 EDT
This is a regression comparing to version 3.3.2.
Comment 4 Jerome Lanneluc CLA 2008-05-22 08:37:20 EDT
(In reply to comment #1)
> Jerome, do you agree to put this fix should in RC2?
Agreed. Setting target to 3.4RC2 

Comment 5 Frederic Fusier CLA 2008-05-22 10:11:19 EDT
David, Jerome, can you please review?
Comment 6 Jerome Lanneluc CLA 2008-05-22 11:22:27 EDT
Looks good: +1
Comment 7 David Audel CLA 2008-05-22 11:23:17 EDT
Patch looks good: +1.
Comment 8 Frederic Fusier CLA 2008-05-22 11:43:00 EDT
Released for 3.4RC2 in HEAD stream.
Comment 9 Eric Jodet CLA 2008-05-23 06:20:03 EDT
verified for 3.4RC2 using build I20080523-0100