Bug 20216 - StringIndexOutOfBoundsException pressing F1
Summary: StringIndexOutOfBoundsException pressing F1
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 2.0 F4   Edit
Assignee: Dorian Birsan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-13 12:18 EDT by Randy Giffen CLA
Modified: 2002-06-17 15:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Giffen CLA 2002-06-13 12:18:15 EDT
F3

1) Open the class swt Button (as a class file)
2) Select the name Button in the editor
3) Press F1
The following is written to the log:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.<init>(String.java(Compiled Code))
	at org.eclipse.help.ui.internal.StyledLineWrapper.processLineBreaks
(StyledLineWrapper.java:162)
	at org.eclipse.help.ui.internal.StyledLineWrapper.setText
(StyledLineWrapper.java:130)
	at org.eclipse.help.ui.internal.StyledLineWrapper.<init>
(StyledLineWrapper.java:29)
	at org.eclipse.help.ui.internal.ContextHelpDialog.createInfoArea
(ContextHelpDialog.java:142)
	at org.eclipse.help.ui.internal.ContextHelpDialog.createContents
(ContextHelpDialog.java:127)
	at org.eclipse.help.ui.internal.ContextHelpDialog.<init>
(ContextHelpDialog.java:92)
	at org.eclipse.help.ui.internal.DefaultHelp.displayContext
(DefaultHelp.java:66)
	at org.eclipse.help.ui.internal.DefaultHelp.displayHelp
(DefaultHelp.java:167)
	at org.eclipse.ui.help.WorkbenchHelp.displayHelp(WorkbenchHelp.java:97)
	at org.eclipse.ui.help.WorkbenchHelp.displayHelp
(WorkbenchHelp.java:125)
	at 
org.eclipse.jdt.internal.ui.util.JavaUIHelp$JavaUIHelpListener.helpRequested
(JavaUIHelp.java:100)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1160)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:739)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:248)
	at org.eclipse.core.launcher.Main.run(Main.java:697)
	at org.eclipse.core.launcher.Main.main(Main.java:530)
Comment 1 Dorian Birsan CLA 2002-06-13 13:29:56 EDT
This should be an F3 candidate.

The fix is to break the for loop when starting point goes past the lenght of 
the string.

After each change to "start" do
 if (start >= textChars.length) break;

The test can be put in the for condition, but this way it will be faster, we 
only check it when starting a new line.
Comment 2 Vlad Klicnik CLA 2002-06-14 11:06:22 EDT
F4 candidate.

Value: medium/high
Risk: low (problem understood, fix available)
Comment 3 Dorian Birsan CLA 2002-06-17 15:38:25 EDT
Fixed in F4.