Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346168 - [assist][rewrite] completing a method binding throws BadLocationException
Summary: [assist][rewrite] completing a method binding throws BadLocationException
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.0 RC2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 17:54 EDT by Stephan Herrmann CLA
Modified: 2011-06-02 11:09 EDT (History)
0 users

See Also:


Attachments
project for reproducing (2.02 KB, application/zip)
2011-05-17 18:01 EDT, Stephan Herrmann CLA
no flags Details
Fix (966 bytes, patch)
2011-05-22 08:16 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-05-17 17:54:32 EDT
Given a SuperTeam with a role file.
Given a SubTeam with an inline role.

Trying to create a method binding inside the SubTeam's role throws:

org.eclipse.core.runtime.CoreException: org.eclipse.jface.text.BadLocationException
	at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.performChange(CUCorrectionProposal.java:354)
	at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.apply(CUCorrectionProposal.java:311)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:935)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:881)

...
...
Caused by: org.eclipse.jface.text.BadLocationException
	at org.eclipse.jface.text.link.LinkedPositionGroup.enforceDisjoint(LinkedPositionGroup.java:148)
	at org.eclipse.jface.text.link.LinkedPositionGroup.enforceDisjoint(LinkedPositionGroup.java:162)
	at org.eclipse.jface.text.link.LinkedModeModel.enforceDisjoint(LinkedModeModel.java:306)
	at org.eclipse.jface.text.link.LinkedModeModel.addGroup(LinkedModeModel.java:418)
	at org.eclipse.jdt.internal.ui.viewsupport.LinkedProposalModelPresenter.enterLinkedMode(LinkedProposalModelPresenter.java:98)
	at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.performChange(CUCorrectionProposal.java:343)
Comment 1 Stephan Herrmann CLA 2011-05-17 18:01:14 EDT
Created attachment 195913 [details]
project for reproducing

This example project should help to reproduce.
Go inside Role4.
Do Ctrl-Space
Select test() (method binding)
Comment 2 Stephan Herrmann CLA 2011-05-22 08:16:50 EDT
Created attachment 196292 [details]
Fix

All that matters to reproduce was a liftable method return type,
for which we created two linked proposal groups:
- one for changing return type to "void"
- one for changing base return to a corresponding role

Fixed by merging both groups into one (by using the same groupID)
Comment 3 Stephan Herrmann CLA 2011-05-22 08:17:43 EDT
Committed as r1620.
Comment 4 Stephan Herrmann CLA 2011-06-02 11:09:58 EDT
Verified using build 201105311237