| Summary: | Plug-in Manifest Editor adds garbage after '&' mnemonics when saving. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Masaihko Maedera <maedera> | ||||
| Component: | UI | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | curtis.windatt.public, daniel_megert, maedera, pwebster | ||||
| Version: | 3.7 | Flags: | daniel_megert:
review+
|
||||
| Target Milestone: | 3.7 RC1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 331485 | ||||||
| Bug Blocks: | 345165 | ||||||
| Attachments: |
|
||||||
|
Description
Masaihko Maedera
Created attachment 193003 [details] bug342512.zip I attached a plug-in project to reproduce this bug. Reproduced, very odd behaviour. The problem is that the ReplaceEdit operation is getting the incorrect old value length. Somewhere (getWritableAttributeNodeValue?) we replace the & with amp;, but when we calculate the length we haven't replaced it yet giving a shorter length. This manifests in the same way as bug 331485 with each edit replacing the wrong text. cc'ing Dani so he is aware. Should be able to fix it by running the replace method on the event's old value. Proposed fix, replace line 233 of XMLInputContext with: oldLength = getWritableAttributeNodeValue(((String) event.getOldValue())).length(); Inside addAttributeOperation() we just get event.getOldValue() to get the length. However the event is generated from the model not the xml and the & is translated afterwards. By translating the old value before checking its length we get the proper result. I didn't create a patch as it conflicts with the fix on bug 331485 that is waiting to be committed. Dani, please review this fix for RC1 inclusion. +1 for the fix for RC1. However, this exhibits a general problem with the transformation code for special characters: the extension point doc tells the user to use "&" instead of '&' but it doesn't say that '&' inside the PDE editor is good enough (or actually: the only valid form). Now, if the user types "&" as indicated on the help page he will end up with "&amp;". This is with or without the patch and should be handled by a new bug. Fixed in HEAD. Opened Bug 345165 to improve the character replacement. Verified in I20110514-0800 |