Summary: | [formatter] New line inserted while formatting a region of a compilation unit. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Frederic Fusier <frederic_fusier> | ||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||
Status: | VERIFIED WORKSFORME | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | benno.baumgartner, daniel_megert, Olivier_Thomann | ||||
Version: | 3.4 | ||||||
Target Milestone: | 3.5 M3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Frederic Fusier
2008-04-24 07:35:27 EDT
The problem is in Scribe.isValidEdit(int) method. When the position is not in the covered region, then the edit is wrongly modified at line 943: if (i - editOffset != editReplacementLength && i != editOffset + editLength - 1) { edit.offset = starting.getOffset(); edit.length = 0; edit.replacement = edit.replacement.substring(i - editOffset); return true; } This if block definitely looks suspiciousn, especially start position and length... Comment it fixes the problem but I'll see if I can write a smarter fix. The is a side effect of bug 49817. The fix of that bug does not seem related to the original issue, so we need to investigate whether that fix can be removed or not... Olivier, what is your mind about this? Close as worksforme because I cannot reproduce using 3.5M2. My assumption is that the problem vanished when bug 234583 has been fixed. Edits are now split hence the condition of the offending if should not be true anymore... The test case from comment 0 still fails for me but for another reason (see bug 252556). However a new line is not inserted, so marking as verified for 3.5M3 using I20081027-1800. |