Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359449

Summary: "zero width space" (aka UTF8:"E2 80 8B") character in code editor makes eclipse throw an AIOOBE
Product: [Eclipse Project] Platform Reporter: Tanguy <tanguy.moal>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse.felipe
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Stack trace of AIOOBE none

Description Tanguy CLA 2011-09-29 12:04:33 EDT
Build Identifier: 20110301-1815

If you have a "zero width space" inside a source file, eclipse starts behaving weirdly as soon as the region containing that character is selected :
* the lines around it are greyed
* the cursor start behaving as if in insert mode but doesn't replace anything, in fact edition works well, the visual feedback doesn't.
* the editor complains with the following message : ""Paste" did not complete normally.  Please see the log for more information. java.lang.ArrayIndexOutOfBoundsException"

Reproducible: Always

Steps to Reproduce:
1. Open eclipse, open a file with a code editor (anything but the Text Editor)
2. go to http://en.wikipedia.org/wiki/Zero-width_space and paste one of the lines containing a zero width space character. Alternatively there should be some of them here after : Antidisestablishmentarianism​Antidisestablishmentarianism​Antidisestablishmentarianism​
3. eclipse should be complaining
Comment 1 Dani Megert CLA 2011-09-29 12:21:06 EDT
Could you quickly attach a test file? That would make it easier to reproduce.
Comment 2 Dani Megert CLA 2011-09-30 07:12:28 EDT
I cannot reproduce this in the Java editor using Juno M2. Please provide more detailed steps and an example file if you can reproduce in the Java editor.
Comment 3 Dani Megert CLA 2011-09-30 07:21:24 EDT
OK, quickly also tried this on my Linux box and there the widget starts to behave ugly, but I could not trigger the AIOOB. If you have steps to reproduce those then please tell us and attach the stack trace here.

I can also reproduce the strange behavior in the text editor: there e.g. pressing End does not reveal the caret.
Comment 4 Tanguy CLA 2011-09-30 08:12:48 EDT
Created attachment 204373 [details]
Stack trace of AIOOBE

Adding stack trace as requested.
Comment 5 Felipe Heidrich CLA 2011-10-03 11:00:08 EDT

*** This bug has been marked as a duplicate of bug 358970 ***