Bug 128276 - Breakpoint Propertie Error.
Summary: Breakpoint Propertie Error.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 14:42 EST by Raul Fernandez CLA
Modified: 2006-03-28 11:17 EST (History)
1 user (show)

See Also:


Attachments
Screen shot of call stack (152.10 KB, image/png)
2006-03-06 14:54 EST, Darin Wright CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raul Fernandez CLA 2006-02-16 14:42:36 EST
The problem starts when the user creates a conditional breakpoint in any line of code. 
If the user wants to edit the breakpoint using the functionality breakpoint properties, once the editor is open to create the condition, if the user press CTRL + SPACE over the sentence “this.equals([ctrl+space])”; the result is the following exception.

This is the stack trace with the exception that we got from eclipse error log….

java.lang.IllegalArgumentException: Index out of bounds 
at org.eclipse.swt.SWT.error(SWT.java:2926) 
at org.eclipse.swt.SWT.error(SWT.java:2865) 
at org.eclipse.swt.SWT.error(SWT.java:2836) 
at org.eclipse.swt.custom.StyledText.getLocationAtOffset 
(StyledText.java:3874)

Attached is provided the complete stack….

Thanks, and let me know if you need more information to reproduce the error.
Regards.
Raul.
Comment 1 Darin Wright CLA 2006-02-17 11:52:08 EST
Please provide more complete steps to reproduce. I.e. example source file, condition, and point at which code assist was attempted.

You could also try 3.2 M5 (soon to be released), to see if the problem still exists there.

Thanks.
Comment 2 Darin Wright CLA 2006-03-06 14:52:55 EST
Moving to JFace Text. Looks like we set up the offset correctly, but it gets changed along the way. Will attach screenshot.
Comment 3 Darin Wright CLA 2006-03-06 14:54:37 EST
Created attachment 35783 [details]
Screen shot of call stack

We set up the offset as 12 in this case, but it gets changed to a "visible offet" of 844 in this case. I don't know where the visible offset is coming from.
Comment 4 Darin Wright CLA 2006-03-06 15:02:17 EST
To reproduce, create a line breakpoint on the first line of junit.samples.VectorTest#testCapacity(). Then open the breakpoint properties edtior and code assist in a condition like "this.equals(|)".
Comment 5 Dani Megert CLA 2006-03-13 11:38:53 EST
The code assist source and viewer source (document) don't match. The offset comes from CompletionProposal.getCompletionLocation() which is based on the code assist source. This is used when context information of a used proposal is requested.

You have two choices:
1) make the document match the code assist source and use
   ITextViewer.setVisibleRegion(int, int) to only show the inserted text (the one
   currently visible in the dialog)
2) try to adjust the offset in the ProposalContextInformation using
   setContextInformationPosition()
Comment 6 Dani Megert CLA 2006-03-13 11:59:02 EST
Actually Debug is using the snippet based code complete method from J Core which should adjust that offset.

Moving to J Core as discussed with David.
Comment 7 David Audel CLA 2006-03-20 12:42:05 EST
Fixed and tests added
  SnippetCompletionContextTests#test0001() -> test0004()

Now the completion location is relative to the snippet.

Note: the completion location was -1 if the completion occurs at the start of the snippet and CompletionProposal doesn't support negative location. I added a workaround to avoid that: -1 is replaced by 0. I enter a bug about this problems in completion positions (bug 128276). As a fix for bug 128276 require API modifications perhaps bug 128276 won't be fixed for 3.2.

Comment 8 Dani Megert CLA 2006-03-20 12:50:15 EST
>I enter a bug about this problems in completion positions...
see bug 132558.
Comment 9 David Audel CLA 2006-03-20 12:53:22 EST
Oups...'bug 128276' should be 'bug132558' in comment 7.
Comment 10 Olivier Thomann CLA 2006-03-28 11:17:26 EST
Verified using I20060328-0010 for 3.2M6