Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345561 - Refactoring with preview fails
Summary: Refactoring with preview fails
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: RC1   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 05:45 EDT by Carl Wannheden CLA
Modified: 2017-09-19 18:09 EDT (History)
2 users (show)

See Also:
jan: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Wannheden CLA 2011-05-12 05:45:36 EDT
Refactoring fails with an "Overlapping text edits" error if preview, back was invoked.

Steps to reproduce:
- Start rename refactoring on an element
- Open RenameRefactoringPopup by deselecting element selection (e.g. by placing cursor with mouse or with arrow keys)
- Open Rename Dialog with menu
- Enter New name
- Click Preview
- Click Back
- Click OK or Preview again - boing!
Comment 1 Carl Wannheden CLA 2011-05-12 06:29:47 EDT
Stack trace:
org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
	at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:121)
	at java.util.Collections.indexedBinarySearch(Unknown Source)
	at java.util.Collections.binarySearch(Unknown Source)
	at org.eclipse.text.edits.TextEdit.computeInsertionIndex(TextEdit.java:796)
	at org.eclipse.text.edits.TextEdit.internalAdd(TextEdit.java:781)
	at org.eclipse.text.edits.TextEdit.addChild(TextEdit.java:335)
	at org.eclipse.xtext.ui.refactoring.impl.RefactoringUpdateAcceptor.createCompositeChange(RefactoringUpdateAcceptor.java:81)
	at org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor.createChange(RenameElementProcessor.java:210)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:292)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2310)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 2 Jan Koehnlein CLA 2011-05-12 07:29:44 EDT
The IRefactoringDocumentAcceptor had to be reset on final condition check.

Pushed to master.
Comment 3 Karsten Thoms CLA 2017-09-19 17:58:37 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 18:09:23 EDT
Closing all bugs that were set to RESOLVED before Neon.0