Bug 105350 - [quick assist] Exception in pick out string
Summary: [quick assist] Exception in pick out string
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-07-27 13:46 EDT by Dirk Baeumer CLA
Modified: 2009-08-30 02:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-07-27 13:46:11 EDT
From bug 104997

java.lang.StringIndexOutOfBoundsException: String index out of range: 86
	at java.lang.String.substring(String.java:1765)
	at
org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getPickOutStringProposals(AdvancedQuickAssistProcessor.java:1563)
	at
org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.hasAssists(AdvancedQuickAssistProcessor.java:117)
	at
org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeHasAssist.safeRun(JavaCorrectionProcessor.java:359)
	at
org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:275)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at
org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:271)
	at
org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.hasAssists(JavaCorrectionProcessor.java:142)
	at
org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.calculateLightBulb(QuickAssistLightBulbUpdater.java:228)
	at
org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.doSelectionChanged(QuickAssistLightBulbUpdater.java:221)
	at
org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.access$0(QuickAssistLightBulbUpdater.java:204)
	at
org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater$1.selectionChanged(QuickAssistLightBulbUpdater.java:128)
	at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
	at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 1 Martin Aeschlimann CLA 2005-07-28 04:21:25 EDT
Hosam, do you have an code example where you got the problem with the 'pick out
string' quick assist?

Please reopen the bug if you do.
Comment 2 Hosam CLA 2005-07-28 04:33:48 EDT
Excuse me, but what do you mean by the 'pick out string' quick assist?
Comment 3 Martin Aeschlimann CLA 2005-07-28 04:43:50 EDT
The stack trace you had in your log points to a problem with the pick out string
quick assist. An example would be

String str= "Hello World";

- select 'World'
- press CTRL + 1
- select 'Pick out selected part of String'.

If you have any idea where you tried to do that, that would be great. It's of
course possible that you never saw the proposal because of the bug...
Comment 4 Hosam CLA 2005-07-28 06:09:58 EDT
The scenario seems familiar, although not quite the same.

I have used a similar feature a lot. For example:

String s = "SELECT * FROM MYTABLE";

I put the cursor before "FROM" and press Enter. The string is splitted.

Sometimes I use it in another way, especially when copying text from outside.
For example, I might copy a query, and the result would be as follows:

String s = "SELECT *
FROM MYTABLE
WHERE CONDITION

In such case I usually go to the end of the "SELECT *", and press Enter to get
the '+' and '"' at the new line, and I keep doing so to put the rest of the
query in concatenated strings.


I hope this was helpful.
Comment 5 Martin Aeschlimann CLA 2005-07-28 10:17:33 EDT
Comment 4 is a feature request. File a new bug against jdt.text for this.
Comment 6 Hosam CLA 2005-07-28 13:50:05 EDT
Sorry, but I didn't mean to request a feature. It's already working for me! :)
Comment 7 Denis Roy CLA 2009-08-30 02:09:39 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.