Uploaded image for project: 'Teiid Designer'
  1. Teiid Designer
  2. TEIIDDES-2534

Model Refactoring: renaming folder fails when it contains a source model that has a dependent view model

    Details

    • Steps to Reproduce:
      Hide
      1. create a project with one folder 'sources'
      2. create a source model 's1' in that folder
      3. create a view model 'v1' in the root of the project, transform from s1
      4. do Refactor > Rename on the folder
      5. the Rename Resource dialog shows an error message "A fatal error occurred while performing the refactoring", "Overlapping text edits" (see screenshot)
      Show
      create a project with one folder 'sources' create a source model 's1' in that folder create a view model 'v1' in the root of the project, transform from s1 do Refactor > Rename on the folder the Rename Resource dialog shows an error message "A fatal error occurred while performing the refactoring", "Overlapping text edits" (see screenshot)

      Description

      When renaming a folder, the refactoring fails with the following exception:

      org.eclipse.text.edits.MalformedTreeException: Overlapping text edits
      	at org.eclipse.text.edits.TextEdit$InsertionComparator.compare(TextEdit.java:121)
      	at java.util.Collections.indexedBinarySearch(Collections.java:377)
      	at java.util.Collections.binarySearch(Collections.java:365)
      	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.teiid.designer.ui.refactor.RefactorResourcesUtils.calculateModelImportsElementLChanges(RefactorResourcesUtils.java:645)
      	at org.teiid.designer.ui.refactor.rename.RenameResourceRefactoring$RelatedResourceCallback.indexFile(RenameResourceRefactoring.java:70)
      	at org.teiid.designer.ui.refactor.RefactorResourcesUtils.calculateRelatedResources(RefactorResourcesUtils.java:1068)
      	at org.teiid.designer.ui.refactor.rename.RenameResourceRefactoring.checkFinalConditions(RenameResourceRefactoring.java:248)
      	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
      	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
      	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
      	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)
      	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
      	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                blafond Barry LaFond
                Reporter:
                asmigala Andrej Smigala
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: