Red Hat Bugzilla – Bug 605417
StringIndexOutOfBoundsException thrown if script contains the word 'function'
Last modified: 2010-07-22 07:28:06 EDT
Description of problem:
Assume you have a shell script 'test.bash' that has the word 'function' in it, or any variation of the word function (e.g., functionality). If the shelled plugin is installed and you try to open 'test.bash' with Eclipse, the open fails; instead, Eclipse displays the error message "Could not open the editor: Editor could not be initialized." Clicking on the "Details" button shows that Java is throwing a out-of-bounds string index exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: <-#>
If I uninstall the shelled plugin, Eclipse successfully opens the file 'test.bash' for editing in a text editor.
Version-Release number of selected component (if applicable):
100% of the time.
Steps to Reproduce:
1. Create a text file named 'test.bash' and place the word 'function' into that file (or any derivation of the word 'function', e.g., 'functionality'):
$ echo function > test.bash
2. Install the eclipse-shelled plugin:
# yum install eclipse-shelled
3. Start Eclipse and attempt to open the file 'try.bash'.
File open fails as described above in section "Description of problem".
File open succeeds; the file is opened for editing in a text editor.
Typo: Steps to Reproduce: Step #3: Change 'try.bash' to 'test.bash'.
This problem is fixed in rawhide with the new ShellEd milestone. But it requires new dltk 2.0 which also requires Eclipse 3.6 and all these are available in rawhide only.