| Summary: | [formatter] Problems to write \u inside <pre> in JavaDOC, when using the formatter | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mauro Molinari <mauromol> |
| Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> |
| Status: | VERIFIED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, jerome_lanneluc, markus.kell.r, Olivier_Thomann, srikanth_sankaran |
| Version: | 3.3 | ||
| Target Milestone: | 3.5.1 | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
You should disable the option to format code snippet inside javadoc comment. \u is indeed an invalid unicode character. I think the point is that we should not replace "\" with "\". \ is replaced by '\' in order to be able to process the source. I think one way to fix it would be to replace \ with "\\" to prevent unicode substitution. I'm not sure, but if you substitute \u with \\u I think JavaDOC will display "\\u", not "\u"... IMHO, I also think that if I explicitly write \, it should be because I don't want to write a line of code but something else. Mauro. What I meant is that on code snippet formatting inside javadoc, we do: - conversion from htm to java - formatting of the code snippet - conversion from java to html On the first conversion, replacing \ with "\\" should prevent to unicode substitution for the second step and the last conversion would convert again "\\" to \. This is an idea. I haven't actually tried if this would fix this issue. transfer to frederic as it's a formatter bug *** This bug has been marked as a duplicate of bug 196308 *** Verified for 3.6M1 using build I20090802-2000 Should not have been set as VERIFIED because target is not 3.6M1 but 3.5. Restoring duplicate status. *** This bug has been marked as a duplicate of bug 196308 *** Verified for 3.5.1 using build M20090826-1100 |
Build ID: I20070625-1500 Steps To Reproduce: 1. Create the following: public class A { /** * <pre> * \u * </pre> */ public void a() { } } 2. Eclipse gives an "Invalid unicode" error on the line with \u 3. Replace "\" with \ to remove the error: public class A { /** * <pre> * \u * </pre> */ public void a() { } } 4. Invoke the code formatter OBSERVED BEHAVIOUR: \ is replaced with \, and the error is given again. EXPECTED BEHAVIOUR: I don't really understand why the formatter should replace \ with \, while other characters (like &) are conversely replaced by the corresponding HTML entity. I would like to be able to write \u inside a <pre> and safely use the code formatter.