Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.emf.compare-parent/bundle-parent/pom.xml2
-rw-r--r--org.eclipse.emf.compare-parent/feature-parent/pom.xml2
-rw-r--r--org.eclipse.emf.compare-parent/pom.xml102
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.target (renamed from org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.target)17
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.tpd (renamed from org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.tpd)4
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.target (renamed from org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.target)81
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.tpd (renamed from org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.tpd)11
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.target (renamed from org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.target)29
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.tpd (renamed from org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.tpd)6
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.target (renamed from org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.target)21
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.tpd (renamed from org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.tpd)8
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.target (renamed from org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.target)95
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.tpd15
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.target45
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.tpd15
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.tpd13
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-logical-nightly.tpd7
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-nightly.tpd7
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/fuzzy-tests.tpd12
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/licence.tpd2
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/orbit.tpd6
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/swtbot.tpd9
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/fragments/uml2-interim.tpd7
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.target30
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.tpd14
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.target30
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.tpd13
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target36
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.tpd16
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.target36
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.tpd16
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.target37
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.tpd17
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.target69
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.tpd28
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.target60
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.tpd27
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.target40
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.tpd17
-rw-r--r--org.eclipse.emf.compare-parent/test-parent/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.gmf-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.sirius-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.sirius-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.egit-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.egit-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.gendoc/lib/jar-in-jar-loader.zipbin7269 -> 7729 bytes
-rw-r--r--packaging/org.eclipse.emf.compare.gendoc/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/.project17
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/build.properties5
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/copyright.txt8
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/epl-v10.html106
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.properties27
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.xml31
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/pom.xml29
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/copyright.txt8
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/epl-v10.html106
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/feature.properties11
-rw-r--r--packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.rcp.ui-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.tests-feature/feature.xml7
-rw-r--r--packaging/org.eclipse.emf.compare.uml2-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.uml2-feature/pom.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.update.extras/pom.xml4
-rw-r--r--packaging/org.eclipse.emf.compare.update/category.xml6
-rw-r--r--packaging/org.eclipse.emf.compare.update/pom.xml4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.checkstyle (renamed from plugins/org.eclipse.emf.compare.log4j.fragment/.checkstyle)0
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.classpath (renamed from plugins/org.eclipse.emf.compare.log4j.fragment/.classpath)8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.project34
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.core.prefs368
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.ui.prefs (renamed from plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.ui.prefs)19
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/META-INF/MANIFEST.MF22
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/build.properties7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/plugin.properties12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/pom.xml30
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/IDEUISiriusInputData.java72
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.aird78
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.nodes7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.aird44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/TestBug564680.java216
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/AllTests.java44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/BugsTestSuite.java28
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/build.properties7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/icons/screenshot.gifbin0 -> 573 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/CompareDiagramIDEUISiriusPlugin.java26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/SiriusContentMergeViewer.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/ExportComparisonAction.java113
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/SiriusComparisonAsImageFileAction.java129
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/dialog/ExportComparisonDialog.java599
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareCopyToImageUtil.java300
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareDiagramImageGenerator.java99
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.checkstyle10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.classpath11
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.project (renamed from plugins/org.eclipse.emf.compare.log4j.fragment/.project)4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/META-INF/MANIFEST.MF19
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/build.properties7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/plugin.properties12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/pom.xml30
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/TestBug560861.java130
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/left.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/right.nodes2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/AllTests.java36
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/BugsTestSuite.java21
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramDiffAccessorImpl.java5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/AbstractDecoratorManager.java796
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DecoratorsManager.java115
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java1793
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/IDecoratorManager.java65
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/MarkerManager.java295
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/PhantomManager.java837
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.checkstyle13
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.classpath7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.project28
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.core.prefs (renamed from plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.core.prefs)94
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.ui.prefs67
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/META-INF/MANIFEST.MF17
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/build.properties20
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign65
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.properties14
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.xml10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/pom.xml26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Activator.java77
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Services.java18
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/.checkstyle10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/.classpath11
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/.project28
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.core.prefs475
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.ui.prefs67
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/META-INF/MANIFEST.MF22
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/build.properties17
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/plugin.properties12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/pom.xml41
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/TestBug561458.java319
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.aird78
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.nodes8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.aird44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.aird44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.aird27
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.nodes2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug561825.java273
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug562321.java295
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.aird44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.aird27
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.nodes2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.aird44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.aird27
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.nodes2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/AbstractSiriusTest.java74
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/AllTests.java44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/BugsTestSuite.java29
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius/plugin.xml9
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/SiriusDiffPostProcessor.java61
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/SiriusReferenceChangeMerger.java99
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/plugin.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.doc/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.compare.doc/pom.xml8
-rw-r--r--plugins/org.eclipse.emf.compare.doc/src/user/user-guide.mediawiki2
-rw-r--r--plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/domain/impl/EMFCompareChangeRecorder.java69
-rwxr-xr-xplugins/org.eclipse.emf.compare.egit.ui/.classpath4
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/.settings/org.eclipse.jdt.core.prefs35
-rwxr-xr-xplugins/org.eclipse.emf.compare.egit.ui/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/actions/ModelMergeToolActionHandler.java19
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/AbstractGitCompareEditorInput.java1027
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/GitMergeEditorInput.java616
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java473
-rw-r--r--plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInputLegacy.java786
-rw-r--r--plugins/org.eclipse.emf.compare.egit/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/EGitCompatibilityUtil.java94
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/DirCacheResourceVariantTreeProvider.java11
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitResourceVariantTreeProvider.java8
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitSyncInfoToDiffConverter.java8
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java12
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/TreeWalkResourceVariantTreeProvider.java9
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/storage/IndexBlobStorage.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.tests/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.framework/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.classpath8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.settings/org.eclipse.jdt.core.prefs34
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/AbstractGitOperationStatement.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/InternalGitTestSupport.java150
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/.classpath6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/.settings/org.eclipse.jdt.core.prefs28
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/CompareGitTestCase.java14
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/GitTestRepository.java52
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/MockSystemReader.java25
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/merge/RemoteNewProjectTests.java16
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/suite/GitTests.java12
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/AbstractReverseActionTest.java194
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/RedoActionTest.java102
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/UndoActionTest.java108
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/UtilInputData.java60
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/left.nodes7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/origin.nodes5
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/right.nodes4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/suite/AllTests.java6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF20
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/plugin.xml8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/schema/subscriberProvider.exsd122
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java32
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java17
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java5
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java114
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/EMFModelProvider.java25
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DependencyGraphUpdater.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DiagnosticSupport.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyLocalResolver.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyRemoteResolver.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/SynchronizedResourceSet.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ThreadedModelResolver.java2
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferences.java7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferencesInitializer.java1
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java93
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeConflictingRunnable.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeNonConflictingRunnable.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/SelectDiffAction.java30
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderDescriptor.java95
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderRegistryListener.java109
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/ISubscriberProvider.java44
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/SubscriberProviderRegistry.java106
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/TeamSubscriberProvider.java79
-rw-r--r--plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java9
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java4
-rw-r--r--plugins/org.eclipse.emf.compare.log4j.fragment/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.compare.log4j.fragment/build.properties3
-rw-r--r--plugins/org.eclipse.emf.compare.log4j.fragment/src/log4j.properties29
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/preferences/LoggingPreferencePage.java103
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareLogger.java75
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java122
-rw-r--r--plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/preferences/EMFComparePreferences.java34
-rw-r--r--plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF9
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/utils/EMFCompareTestsUtils.java58
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.rcp.ui.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.rcp.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.rcp/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/internal/merge/OpaqueElementBodyChangeMerger.java16
-rw-r--r--plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF9
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java134
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java13
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/MatchBasedConflictDetector.java13
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java76
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java8
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java12
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java12
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AbstractMerger.java61
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/BatchMerger.java30
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/ResourceAttachmentChangeMerger.java42
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java12
-rw-r--r--releng/org.eclipse.emf.compare.releng/.project11
-rw-r--r--releng/org.eclipse.emf.compare.releng/publish-milestone.sh93
-rw-r--r--releng/org.eclipse.emf.compare.releng/publish-nightly.sh88
-rw-r--r--releng/org.eclipse.emf.compare.releng/publish-release.sh81
293 files changed, 13262 insertions, 4100 deletions
diff --git a/org.eclipse.emf.compare-parent/bundle-parent/pom.xml b/org.eclipse.emf.compare-parent/bundle-parent/pom.xml
index f5aab05a0..5d40b634f 100644
--- a/org.eclipse.emf.compare-parent/bundle-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/bundle-parent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.eclipse.emf.compare</groupId>
diff --git a/org.eclipse.emf.compare-parent/feature-parent/pom.xml b/org.eclipse.emf.compare-parent/feature-parent/pom.xml
index c30114212..53a0db0ca 100644
--- a/org.eclipse.emf.compare-parent/feature-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/feature-parent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
diff --git a/org.eclipse.emf.compare-parent/pom.xml b/org.eclipse.emf.compare-parent/pom.xml
index b344279ba..318be13dd 100644
--- a/org.eclipse.emf.compare-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) 2011, 2015 Obeo
+ Copyright (C) 2011, 2020 Obeo
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
@@ -14,7 +14,7 @@
</prerequisites>
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>pom</packaging>
<licenses>
<license>
@@ -31,8 +31,8 @@
</licenses>
<properties>
<!-- Properties -->
- <parent-version>3.3.9-SNAPSHOT</parent-version>
- <source-java-version>1.7</source-java-version>
+ <parent-version>3.3.19-SNAPSHOT</parent-version>
+ <source-java-version>1.8</source-java-version>
<target-java-version>${source-java-version}</target-java-version>
<java-source-encoding>UTF-8</java-source-encoding>
<resource-encoding>UTF-8</resource-encoding>
@@ -40,8 +40,8 @@
<!-- plugins versions -->
<!-- use 'mvn versions:display-plugin-updates' to check for the latest -->
- <tycho-version>1.4.0</tycho-version>
- <tycho-extras-version>1.4.0</tycho-extras-version>
+ <tycho-version>2.1.0</tycho-version>
+ <tycho-extras-version>2.1.0</tycho-extras-version>
<maven-resources-version>2.6</maven-resources-version>
<maven-antrun-version>1.7</maven-antrun-version>
<findbugs-maven-version>3.0.0</findbugs-maven-version>
@@ -57,7 +57,7 @@
<maven-site-version>3.4</maven-site-version>
<maven-surefire-version>2.17</maven-surefire-version>
<jacoco-maven-version>0.7.1.201405082137</jacoco-maven-version>
- <eclipse-jarsigner-version>1.1.2</eclipse-jarsigner-version>
+ <eclipse-jarsigner-version>1.3.1</eclipse-jarsigner-version>
<maven-jxr-version>2.3</maven-jxr-version>
<!-- Sonar properties -->
@@ -88,12 +88,14 @@
<module>../plugins/org.eclipse.emf.compare.edit</module>
<module>../plugins/org.eclipse.emf.compare.ide</module>
<module>../plugins/org.eclipse.emf.compare.ide.ui</module>
- <module>../plugins/org.eclipse.emf.compare.ide.ui.e4</module>
<module>../plugins/org.eclipse.emf.compare.ide.ui.tests</module>
<module>../plugins/org.eclipse.emf.compare.ide.ui.tests.framework</module>
<module>../plugins/org.eclipse.emf.compare.ide.ui.tests.git</module>
<module>../plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework</module>
<module>../plugins/org.eclipse.emf.compare.ide.tests</module>
+
+ <module>../packaging/org.eclipse.emf.compare.ide.ui.e4-feature</module>
+ <module>../plugins/org.eclipse.emf.compare.ide.ui.e4</module>
<module>../packaging/org.eclipse.emf.compare.rcp.ui-feature</module>
<module>../plugins/org.eclipse.emf.compare.rcp</module>
@@ -120,6 +122,7 @@
<module>../plugins/org.eclipse.emf.compare.diagram</module>
<module>../plugins/org.eclipse.emf.compare.diagram.edit</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ide.ui</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.tests</module>
<module>../packaging/org.eclipse.emf.compare.tests-feature</module>
</modules>
@@ -137,6 +140,7 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
<configuration>
<includePackedArtifacts>true</includePackedArtifacts>
<resolver>p2</resolver>
@@ -364,7 +368,7 @@
<profiles>
<!-- Target platforms are located in org.eclipse.emf.compare-parent/targetPlatforms. -->
<profile>
- <id>2019-06</id>
+ <id>2022-03</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
@@ -379,7 +383,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/2019-06-sdk</classifier>
+ <classifier>targetPlatforms/2022-03-sdk</classifier>
</artifact>
</target>
</configuration>
@@ -388,7 +392,7 @@
</build>
</profile>
<profile>
- <id>oxygen</id>
+ <id>2021-09</id>
<build>
<plugins>
<plugin>
@@ -400,7 +404,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/oxygen-sdk</classifier>
+ <classifier>targetPlatforms/2021-09-sdk</classifier>
</artifact>
</target>
</configuration>
@@ -409,10 +413,7 @@
</build>
</profile>
<profile>
- <id>neon</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
+ <id>2021-06</id>
<build>
<plugins>
<plugin>
@@ -424,7 +425,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/neon-sdk</classifier>
+ <classifier>targetPlatforms/2021-06-sdk</classifier>
</artifact>
</target>
</configuration>
@@ -432,35 +433,24 @@
</plugins>
</build>
</profile>
+ <!--
+ The "extras" profiles can be used to build the supports for external tools such as Sirius.
+ You will need to activate both the "extra-modules" profile and one of the "<platform_name>-extras" profiles.
+ -->
<profile>
- <id>mars</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <configuration>
- <target>
- <artifact>
- <groupId>org.eclipse.emf.compare</groupId>
- <artifactId>emf.compare-parent</artifactId>
- <version>${parent-version}</version>
- <classifier>targetPlatforms/mars-sdk</classifier>
- </artifact>
- </target>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <id>extra-modules</id>
+ <modules>
+ <module>../packaging/org.eclipse.emf.compare.update.extras</module>
+ <module>../packaging/org.eclipse.emf.compare.diagram.sirius-feature</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.sirius</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.sirius.tests</module>
+ <module>../plugins/org.eclipse.emf.compare.diagram.sirius.tests.design</module>
+ </modules>
</profile>
<profile>
- <id>luna</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
+ <id>2022-03-extras</id>
<build>
<plugins>
<plugin>
@@ -472,7 +462,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/luna-sdk</classifier>
+ <classifier>targetPlatforms/extras/2022-03-extras-sdk</classifier>
</artifact>
</target>
</configuration>
@@ -480,22 +470,8 @@
</plugins>
</build>
</profile>
- <!--
- The "extras" profiles can be used to build the supports for external tools such as Sirius.
- You will need to activate both the "extra-modules" profile and one of the "<platform_name>-extras" profiles.
- -->
- <profile>
- <id>extra-modules</id>
- <modules>
- <module>../packaging/org.eclipse.emf.compare.update.extras</module>
-
- <module>../packaging/org.eclipse.emf.compare.diagram.sirius-feature</module>
- <module>../plugins/org.eclipse.emf.compare.diagram.sirius</module>
- <module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius</module>
- </modules>
- </profile>
<profile>
- <id>2019-06-extras</id>
+ <id>2021-09-extras</id>
<build>
<plugins>
<plugin>
@@ -507,7 +483,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/extras/2019-06-extras-sdk</classifier>
+ <classifier>targetPlatforms/extras/2021-09-extras-sdk</classifier>
</artifact>
</target>
</configuration>
@@ -515,8 +491,8 @@
</plugins>
</build>
</profile>
- <profile>
- <id>oxygen-extras</id>
+ <profile>
+ <id>2021-06-extras</id>
<build>
<plugins>
<plugin>
@@ -528,7 +504,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>${parent-version}</version>
- <classifier>targetPlatforms/extras/oxygen-extras-sdk</classifier>
+ <classifier>targetPlatforms/extras/2021-06-extras-sdk</classifier>
</artifact>
</target>
</configuration>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.target
index 2c245085f..7eaa715ed 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.target
@@ -1,23 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="EMF Compare based on 2019-06 SDK" sequenceNumber="1568900039">
+<target name="EMF Compare based on 2021-06 SDK" sequenceNumber="1626424285">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
<repository location="http://download.eclipse.org/cbi/updates/license"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="27.1.0.v20190517-1946"/>
- <unit id="com.google.gson" version="2.8.2.v20180104-1110"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.6.v20201231-1626"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.18.0.v20181121-2221"/>
+ <unit id="javaewah" version="1.1.7.v20200107-0831"/>
+ <unit id="org.apache.commons.compress" version="1.19.0.v20200106-2343"/>
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
<unit id="org.mockito" version="1.9.5.v201605172210"/>
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository/"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/S20210216215844/repository/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
@@ -34,7 +35,7 @@
<unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/2019-06"/>
+ <repository location="http://download.eclipse.org/releases/2021-06"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.tpd
index 550a14403..ba74d8a1e 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/2019-06-sdk.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2021-06-sdk.tpd
@@ -1,4 +1,4 @@
-target "EMF Compare based on 2019-06 SDK"
+target "EMF Compare based on 2021-06 SDK"
include "fragments/licence.tpd"
include "fragments/orbit.tpd"
@@ -7,7 +7,7 @@ include "fragments/perf.tpd"
with source, requirements
-location "http://download.eclipse.org/releases/2019-06" {
+location "http://download.eclipse.org/releases/2021-06" {
org.eclipse.platform.feature.group lazy
org.eclipse.emf.sdk.feature.group lazy
org.eclipse.emf.transaction.sdk.feature.group lazy
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.target
index 421bf2dea..8aa680ae2 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.target
@@ -1,40 +1,41 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Oxygen SDK" sequenceNumber="1500968636">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
- <unit id="org.mockito" version="1.9.5.v201605172210"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
- <repository location="http://obeo.github.io/fr.obeo.performance/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/oxygen"/>
- </location>
- </locations>
-</target>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde?>
+<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
+<target name="EMF Compare based on 2021-09 SDK" sequenceNumber="1633593319">
+ <locations>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
+ <repository location="http://download.eclipse.org/cbi/updates/license"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.7.v20210624-1215"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
+ <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
+ <unit id="javaewah" version="1.1.12.v20210622-2206"/>
+ <unit id="org.apache.commons.compress" version="1.20.0.v20210713-1928"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.mockito" version="1.9.5.v201605172210"/>
+ <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
+ <repository location="http://obeo.github.io/fr.obeo.performance/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/releases/2021-09"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
+ <repository location="https://download.eclipse.org/egit/staging/v6.0.0.202110060947-m1/"/>
+ </location>
+ </locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.tpd
index eb70b2fdf..88312bdc7 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2021-09-sdk.tpd
@@ -1,17 +1,20 @@
-target "EMF Compare based on Neon SDK"
+target "EMF Compare based on 2021-09 SDK"
include "fragments/licence.tpd"
include "fragments/orbit.tpd"
include "fragments/perf.tpd"
-include "fragments/egit.tpd"
with source, requirements
-location "http://download.eclipse.org/releases/neon" {
- org.eclipse.platform.sdk lazy
+location "http://download.eclipse.org/releases/2021-09" {
+ org.eclipse.platform.feature.group lazy
org.eclipse.emf.sdk.feature.group lazy
org.eclipse.emf.transaction.sdk.feature.group lazy
org.eclipse.uml2.feature.group lazy
org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
org.eclipse.gmf.runtime.diagram.ui lazy
}
+
+location "https://download.eclipse.org/egit/staging/v6.0.0.202110060947-m1/" {
+ org.eclipse.egit.feature.group lazy
+} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.target
index e99758e9c..79539934f 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/neon-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.target
@@ -1,40 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Neon SDK" sequenceNumber="1500968146">
+<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
+<target name="EMF Compare based on 2022-03 SDK" sequenceNumber="1662383602">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
+ <repository location="https://download.eclipse.org/cbi/updates/license"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.7.v20210624-1215"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
+ <unit id="javaewah" version="1.1.12.v20210622-2206"/>
+ <unit id="org.apache.commons.compress" version="1.20.0.v20210713-1928"/>
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
<unit id="org.mockito" version="1.9.5.v201605172210"/>
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
<repository location="http://obeo.github.io/fr.obeo.performance/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="0.0.0"/>
+ <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/neon"/>
+ <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/releases/2022-03"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.tpd
index 94581ab69..a12a89e1b 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/oxygen-sdk.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/2022-03-sdk.tpd
@@ -1,17 +1,17 @@
-target "EMF Compare based on Oxygen SDK"
+target "EMF Compare based on 2022-03 SDK"
include "fragments/licence.tpd"
include "fragments/orbit.tpd"
-include "fragments/egit.tpd"
include "fragments/perf.tpd"
with source, requirements
-location "http://download.eclipse.org/releases/oxygen" {
+location "http://download.eclipse.org/releases/2022-03" {
org.eclipse.platform.feature.group lazy
org.eclipse.emf.sdk.feature.group lazy
org.eclipse.emf.transaction.sdk.feature.group lazy
org.eclipse.uml2.feature.group lazy
org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
org.eclipse.gmf.runtime.diagram.ui lazy
+ org.eclipse.egit.feature.group lazy
}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.target
index 24e74c7a9..d99971287 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.target
@@ -1,23 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
-<target name="EMF Compare with extras based on 2019-06" sequenceNumber="1568895959">
+<target name="EMF Compare with extras based on 2021-06" sequenceNumber="1626356532">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
<repository location="http://download.eclipse.org/cbi/updates/license"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="27.1.0.v20190517-1946"/>
- <unit id="com.google.gson" version="2.8.2.v20180104-1110"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.6.v20201231-1626"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.18.0.v20181121-2221"/>
+ <unit id="javaewah" version="1.1.7.v20200107-0831"/>
+ <unit id="org.apache.commons.compress" version="1.19.0.v20200106-2343"/>
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
<unit id="org.mockito" version="1.9.5.v201605172210"/>
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository/"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/S20210216215844/repository/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
@@ -34,13 +35,15 @@
<unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/2019-06"/>
+ <repository location="http://download.eclipse.org/releases/2021-06"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.sirius" version="0.0.0"/>
<unit id="org.eclipse.sirius.diagram" version="0.0.0"/>
<unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
- <repository location="https://download.eclipse.org/sirius/updates/releases/6.2.3/2019-06/"/>
+ <unit id="org.eclipse.sirius.runtime.ide.ui.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.aql.feature.group" version="0.0.0"/>
+ <repository location="https://download.eclipse.org/sirius/updates/releases/6.5.0/2020-09/"/>
</location>
</locations>
</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.tpd
index 1133a62b2..4d87622b7 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2019-06-extras-sdk.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-06-extras-sdk.tpd
@@ -1,13 +1,15 @@
-target "EMF Compare with extras based on 2019-06"
+target "EMF Compare with extras based on 2021-06"
-include "../2019-06-sdk.tpd"
+include "../2021-06-sdk.tpd"
with source, requirements
// Sirius
-location "https://download.eclipse.org/sirius/updates/releases/6.2.3/2019-06/" {
+location "https://download.eclipse.org/sirius/updates/releases/6.5.0/2020-09/" {
org.eclipse.sirius lazy
org.eclipse.sirius.diagram lazy
org.eclipse.sirius.runtime.feature.group lazy
+ org.eclipse.sirius.runtime.ide.ui.feature.group lazy
+ org.eclipse.sirius.runtime.aql.feature.group lazy
}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.target
index 338f44691..23560c317 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.target
@@ -1,46 +1,49 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare with extras based on Oxygen SDK" sequenceNumber="1506587845">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
- <unit id="org.mockito" version="1.9.5.v201605172210"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
- <repository location="http://obeo.github.io/fr.obeo.performance/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.sirius" version="0.0.0"/>
- <unit id="org.eclipse.sirius.diagram" version="0.0.0"/>
- <unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/sirius/updates/releases/6.1.1/oxygen"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/oxygen"/>
- </location>
- </locations>
-</target>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde?>
+<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
+<target name="EMF Compare with extras based on 2021-09" sequenceNumber="1633594517">
+ <locations>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
+ <repository location="http://download.eclipse.org/cbi/updates/license"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.7.v20210624-1215"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
+ <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
+ <unit id="javaewah" version="1.1.12.v20210622-2206"/>
+ <unit id="org.apache.commons.compress" version="1.20.0.v20210713-1928"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.mockito" version="1.9.5.v201605172210"/>
+ <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
+ <repository location="http://obeo.github.io/fr.obeo.performance/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/releases/2021-09"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
+ <repository location="https://download.eclipse.org/egit/staging/v6.0.0.202110060947-m1/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.sirius" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.diagram" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.ide.ui.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.aql.feature.group" version="0.0.0"/>
+ <repository location="https://download.eclipse.org/sirius/updates/releases/6.5.1/2020-09/"/>
+ </location>
+ </locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.tpd
new file mode 100644
index 000000000..5be789d8e
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2021-09-extras-sdk.tpd
@@ -0,0 +1,15 @@
+target "EMF Compare with extras based on 2021-09"
+
+include "../2021-09-sdk.tpd"
+
+with source, requirements
+
+// Sirius
+
+location "https://download.eclipse.org/sirius/updates/releases/6.5.1/2020-09/" {
+ org.eclipse.sirius lazy
+ org.eclipse.sirius.diagram lazy
+ org.eclipse.sirius.runtime.feature.group lazy
+ org.eclipse.sirius.runtime.ide.ui.feature.group lazy
+ org.eclipse.sirius.runtime.aql.feature.group lazy
+}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.target
new file mode 100644
index 000000000..7311b6a32
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.target
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde?>
+<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
+<target name="EMF Compare with extras based on 2022-03" sequenceNumber="1662383612">
+ <locations>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
+ <repository location="https://download.eclipse.org/cbi/updates/license"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
+ <unit id="com.google.gson" version="2.8.7.v20210624-1215"/>
+ <unit id="org.junit" version="4.13.0.v20200204-1500"/>
+ <unit id="javaewah" version="1.1.12.v20210622-2206"/>
+ <unit id="org.apache.commons.compress" version="1.20.0.v20210713-1928"/>
+ <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
+ <unit id="org.mockito" version="1.9.5.v201605172210"/>
+ <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
+ <unit id="org.assertj" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
+ <repository location="http://obeo.github.io/fr.obeo.performance/"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
+ <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
+ <repository location="http://download.eclipse.org/releases/2022-03"/>
+ </location>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.sirius" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.diagram" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.ide.ui.feature.group" version="0.0.0"/>
+ <unit id="org.eclipse.sirius.runtime.aql.feature.group" version="0.0.0"/>
+ <repository location="https://download.eclipse.org/sirius/updates/releases/7.0.0/2021-06/"/>
+ </location>
+ </locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.tpd
new file mode 100644
index 000000000..d12d29a67
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/extras/2022-03-extras-sdk.tpd
@@ -0,0 +1,15 @@
+target "EMF Compare with extras based on 2022-03"
+
+include "../2022-03-sdk.tpd"
+
+with source, requirements
+
+// Sirius
+
+location "https://download.eclipse.org/sirius/updates/releases/7.0.0/2021-06/" {
+ org.eclipse.sirius lazy
+ org.eclipse.sirius.diagram lazy
+ org.eclipse.sirius.runtime.feature.group lazy
+ org.eclipse.sirius.runtime.ide.ui.feature.group lazy
+ org.eclipse.sirius.runtime.aql.feature.group lazy
+}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.tpd
deleted file mode 100644
index 3eaba05df..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/extras/oxygen-extras-sdk.tpd
+++ /dev/null
@@ -1,13 +0,0 @@
-target "EMF Compare with extras based on Oxygen SDK"
-
-include "../oxygen-sdk.tpd"
-
-with source, requirements
-
-// Sirius
-
-location "http://download.eclipse.org/sirius/updates/releases/6.1.1/oxygen" {
- org.eclipse.sirius lazy
- org.eclipse.sirius.diagram lazy
- org.eclipse.sirius.runtime.feature.group lazy
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-logical-nightly.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-logical-nightly.tpd
deleted file mode 100644
index 9e2974eae..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-logical-nightly.tpd
+++ /dev/null
@@ -1,7 +0,0 @@
-target "EGit"
-
-with source, requirements
-
-location "http://download.eclipse.org/modeling/emf/compare/updates/egit-logical/nightly/" {
- org.eclipse.egit.feature.group lazy
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-nightly.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-nightly.tpd
deleted file mode 100644
index e92aa2f69..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/egit-nightly.tpd
+++ /dev/null
@@ -1,7 +0,0 @@
-target "EGit"
-
-with source, requirements
-
-location "http://download.eclipse.org/egit/updates-nightly" {
- org.eclipse.egit.feature.group lazy
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/fuzzy-tests.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/fuzzy-tests.tpd
deleted file mode 100644
index cf366ec2a..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/fuzzy-tests.tpd
+++ /dev/null
@@ -1,12 +0,0 @@
-target "Fuzzy testing framework from EMF Store"
-
-with source, requirements
-
-location "http://download.eclipse.org/emf-store/releases_15" {
- org.eclipse.emf.emfstore.modelmutator.feature.feature.group
- org.eclipse.emf.emfstore.fuzzy.feature.feature.group
-}
-
-location "http://download.eclipse.org/releases/indigo" {
- org.junit4
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/licence.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/licence.tpd
index 01d1980f6..7533633cd 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/licence.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/licence.tpd
@@ -2,6 +2,6 @@ target "CBI Licenses"
with source, requirements
-location "http://download.eclipse.org/cbi/updates/license" {
+location "https://download.eclipse.org/cbi/updates/license" {
org.eclipse.license.feature.group [1.0.1,1.1.0)
} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/orbit.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/orbit.tpd
index 4e059ab77..15417f555 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/orbit.tpd
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/orbit.tpd
@@ -2,15 +2,15 @@ target "Orbit"
with source, requirements
-location "http://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository/" {
- com.google.guava [27.0.0,28.0.0)
+location "http://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository/" {
+ com.google.guava [27.0.0,30.2.0)
com.google.gson [2.2.4,3.0.0)
org.junit [4,5)
- org.apache.log4j [1.2.0,1.3.0)
/* Egit/Jgit */
javaewah
org.apache.commons.compress
org.kohsuke.args4j
org.mockito [1.9.0,2.0.0)
org.hamcrest [1.1.0,2.0.0)
+ org.assertj lazy
}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/swtbot.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/swtbot.tpd
deleted file mode 100644
index a996a376d..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/swtbot.tpd
+++ /dev/null
@@ -1,9 +0,0 @@
-target "swtbot"
-
-with source, requirements
-
-location "http://download.eclipse.org/technology/swtbot/releases/2.3.0/" {
- org.eclipse.swtbot.eclipse.feature.group lazy
- org.eclipse.swtbot.feature.group lazy
- org.eclipse.swtbot.eclipse.test.junit.feature.group lazy
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/uml2-interim.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/fragments/uml2-interim.tpd
deleted file mode 100644
index 3276e37f4..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/fragments/uml2-interim.tpd
+++ /dev/null
@@ -1,7 +0,0 @@
-target "UML2 Interim"
-
-with source, requirements
-
-location "http://download.eclipse.org/modeling/mdt/uml2/updates/interim/" {
- org.eclipse.uml2.feature.group lazy
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.target
deleted file mode 100644
index dcde290f5..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.target
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Helios SDK" sequenceNumber="1464676195">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="15.0.0.v201403281430"/>
- <unit id="com.google.gson" version="2.2.4.v201311231704"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="0.7.9.v201401101600"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.mockito" version="1.9.5.v201311280930"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="3.6.2.M20110210-1200"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.6.1.v20100914-1218"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.4.0.v20100428-2315-777N-9AZP-D1aQtjUklrYl0eU20D"/>
- <unit id="org.eclipse.uml2.feature.group" version="3.1.2.v201010261927"/>
- <repository location="http://download.eclipse.org/releases/helios"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.tpd
deleted file mode 100644
index 368f310b6..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/helios-sdk.tpd
+++ /dev/null
@@ -1,14 +0,0 @@
-target "EMF Compare based on Helios SDK"
-
-include "fragments/licence.tpd"
-// no fuzzy as it requires EMF 2.7
-include "fragments/orbit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/helios" {
- org.eclipse.platform.sdk
- org.eclipse.emf.sdk.feature.group
- org.eclipse.emf.transaction.sdk.feature.group
- org.eclipse.uml2.feature.group
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.target
deleted file mode 100644
index 897e89cd2..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.target
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Indigo SDK" sequenceNumber="1464676392">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="15.0.0.v201403281430"/>
- <unit id="com.google.gson" version="2.2.4.v201311231704"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="0.7.9.v201401101600"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.mockito" version="1.9.5.v201311280930"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="3.7.2.M20120208-0800"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.7.2.v20120130-0943"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.5.1.v20110823-1800-777T19A_WsXmjNatPxcrPm1rOKlH"/>
- <unit id="org.eclipse.uml2.feature.group" version="3.2.1.v201109082252"/>
- <repository location="http://download.eclipse.org/releases/indigo"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.tpd
deleted file mode 100644
index 126137786..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/indigo-sdk.tpd
+++ /dev/null
@@ -1,13 +0,0 @@
-target "EMF Compare based on Indigo SDK"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/indigo" {
- org.eclipse.platform.sdk
- org.eclipse.emf.sdk.feature.group
- org.eclipse.emf.transaction.sdk.feature.group
- org.eclipse.uml2.feature.group
-} \ No newline at end of file
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target
deleted file mode 100644
index 717246536..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Juno SDK" sequenceNumber="1464676985">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="15.0.0.v201403281430"/>
- <unit id="com.google.gson" version="2.2.4.v201311231704"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="0.7.9.v201401101600"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.mockito" version="1.9.5.v201311280930"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="4.2.2.M20130204-1200"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.8.3.v20130125-0826"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.6.0.v20120328-0001-777Z-9A_WsZmcPluNecyPkvrPKlH"/>
- <unit id="org.eclipse.uml2.feature.group" version="4.0.2.v20130114-0902"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.6.0.v20120327-2213-47F08xGD6FxMBN7CJFV3CIKK9t84"/>
- <unit id="org.eclipse.emf.ecoretools.feature.group" version="1.1.0.201205150811"/>
- <repository location="http://download.eclipse.org/releases/juno"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.tpd
deleted file mode 100644
index 9e62182fd..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.tpd
+++ /dev/null
@@ -1,16 +0,0 @@
-target "EMF Compare based on Juno SDK"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/egit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/juno" {
- org.eclipse.platform.sdk
- org.eclipse.emf.sdk.feature.group
- org.eclipse.emf.transaction.sdk.feature.group
- org.eclipse.uml2.feature.group
- org.eclipse.gmf.runtime.notation.sdk.feature.group
- org.eclipse.emf.ecoretools.feature.group
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.target
deleted file mode 100644
index ff480fdd4..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.target
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Kepler SDK" sequenceNumber="1436775786">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="15.0.0.v201403281430"/>
- <unit id="com.google.gson" version="2.2.4.v201311231704"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="0.7.9.v201401101600"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.mockito" version="1.9.5.v201311280930"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="4.3.2.M20140221-1700"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.9.2.v20140203-1126"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.7.0.201306111400"/>
- <unit id="org.eclipse.uml2.feature.group" version="4.1.2.v20140202-2055"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.7.0.201306101425"/>
- <unit id="org.eclipse.emf.ecoretools.feature.group" version="1.2.0.201306071421"/>
- <repository location="http://download.eclipse.org/releases/kepler"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.tpd
deleted file mode 100644
index e362a685f..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.tpd
+++ /dev/null
@@ -1,16 +0,0 @@
-target "EMF Compare based on Kepler SDK"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/egit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/kepler" {
- org.eclipse.platform.sdk
- org.eclipse.emf.sdk.feature.group
- org.eclipse.emf.transaction.sdk.feature.group
- org.eclipse.uml2.feature.group
- org.eclipse.gmf.runtime.notation.sdk.feature.group
- org.eclipse.emf.ecoretools.feature.group
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.target
deleted file mode 100644
index f8491f147..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.target
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Luna SDK" sequenceNumber="1500968088">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
- <unit id="org.mockito" version="1.9.5.v201605172210"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="4.4.2.M20150204-1700"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="2.10.2.v20150123-0452"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.8.0.201405281451"/>
- <unit id="org.eclipse.uml2.feature.group" version="5.0.2.v20150202-0947"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.8.0.201405281433"/>
- <unit id="org.eclipse.gmf.runtime.diagram.ui" version="1.8.0.201408201453"/>
- <unit id="org.eclipse.team.svn.feature.group" version="2.0.4.I20150123-1700"/>
- <repository location="http://download.eclipse.org/releases/luna"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.tpd
deleted file mode 100644
index 678377d4c..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/luna-sdk.tpd
+++ /dev/null
@@ -1,17 +0,0 @@
-target "EMF Compare based on Luna SDK"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/egit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/luna" {
- org.eclipse.platform.sdk
- org.eclipse.emf.sdk.feature.group
- org.eclipse.emf.transaction.sdk.feature.group
- org.eclipse.uml2.feature.group
- org.eclipse.gmf.runtime.notation.sdk.feature.group
- org.eclipse.gmf.runtime.diagram.ui
- org.eclipse.team.svn.feature.group
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.target
deleted file mode 100644
index 0566907a8..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.target
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Mars SDK with Logical Model and Papyrus" sequenceNumber="1500986499">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
- <unit id="org.mockito" version="1.9.5.v201605172210"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/modeling/emf/compare/updates/egit-logical/nightly/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
- <repository location="http://obeo.github.io/fr.obeo.performance/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.papyrus.migration.rsa" version="0.0.0"/>
- <unit id="org.eclipse.papyrus.extra.umlrt.feature.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.papyrus.extra.epf.richtext.feature.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/luna/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/modeling/mdt/uml2/updates/interim/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.swtbot.eclipse.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.swtbot.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.swtbot.eclipse.test.junit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/technology/swtbot/releases/2.3.0/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.sirius" version="0.0.0"/>
- <unit id="org.eclipse.sirius.runtime.acceleo.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/sirius/updates/releases/3.1.4/mars"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.obeonetwork.dsl.uml2.runtime.feature.feature.group" version="6.0.0.201510191019"/>
- <repository location="http://releases.umldesigner.org/6.0.0/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="0.0.0"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.team.svn.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.jdt.annotation" version="1.1.100.v20140704-0625"/>
- <unit id="org.eclipse.acceleo.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.acceleo.query.feature.group" version="3.6.0.201506080954"/>
- <repository location="http://download.eclipse.org/releases/mars"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.tpd
deleted file mode 100644
index 8f388c932..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-papyrus-sdk.tpd
+++ /dev/null
@@ -1,28 +0,0 @@
-target "EMF Compare based on Mars SDK with Logical Model and Papyrus"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/egit-logical-nightly.tpd"
-include "fragments/perf.tpd"
-include "extras/papyrus.tpd"
-include "fragments/uml2-interim.tpd"
-include "fragments/swtbot.tpd"
-include "extras/sirius.tpd"
-
-with source, requirements
-
-/*
- * Can be used for local dev env to depend on the logical model build of EGit,
- * interim builds of UML2 (cf bug 465216) and Papyrus and extras (richtext,
- * UML-RT and migration.rsa).
- */
-location "http://download.eclipse.org/releases/mars" {
- org.eclipse.platform.sdk lazy
- org.eclipse.emf.sdk.feature.group lazy
- org.eclipse.emf.transaction.sdk.feature.group lazy
- org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
- org.eclipse.papyrus.sdk.feature.feature.group lazy
- org.eclipse.emf.ecoretools.sdk.feature.group lazy
- org.eclipse.team.svn.feature.group lazy
- org.eclipse.jdt.annotation [1.1.100,2.0.0)
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.target
deleted file mode 100644
index d3917afbd..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.target
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Mars SDK with Logical Model" sequenceNumber="1455878118">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="11.0.2.v201303041551"/>
- <unit id="com.google.gson" version="2.2.4.v201311231704"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="0.7.9.v201401101600"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.0.21.v201301150030"/>
- <unit id="org.mockito" version="1.9.5.v201311280930"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/modeling/emf/compare/updates/egit-logical/nightly/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
- <repository location="http://obeo.github.io/fr.obeo.performance/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.swtbot.eclipse.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.swtbot.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.swtbot.eclipse.test.junit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/technology/swtbot/releases/2.3.0/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.sirius" version="0.0.0"/>
- <unit id="org.eclipse.sirius.runtime.acceleo.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/sirius/updates/releases/3.0.0/mars"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.obeonetwork.dsl.uml2.runtime.feature.feature.group" version="6.0.0.201510191019"/>
- <repository location="http://releases.umldesigner.org/6.0.0/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="0.0.0"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.team.svn.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.jdt.annotation" version="1.1.100.v20140704-0625"/>
- <unit id="org.eclipse.acceleo.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.acceleo.query.feature.group" version="3.6.0.201506080954"/>
- <repository location="http://download.eclipse.org/releases/mars"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.tpd
deleted file mode 100644
index 42c3d90ef..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-logical-sdk.tpd
+++ /dev/null
@@ -1,27 +0,0 @@
-target "EMF Compare based on Mars SDK with Logical Model"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/egit-logical-nightly.tpd"
-include "fragments/perf.tpd"
-include "fragments/swtbot.tpd"
-include "extras/sirius.tpd"
-
-
-with source, requirements
-
-/*
- * Can be used for local dev env to depend on the logical model
- * build of EGit.
- */
-location "http://download.eclipse.org/releases/mars" {
- org.eclipse.platform.sdk lazy
- org.eclipse.emf.sdk.feature.group lazy
- org.eclipse.emf.transaction.sdk.feature.group lazy
- org.eclipse.uml2.feature.group lazy
- org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
- org.eclipse.emf.ecoretools.sdk.feature.group lazy
- org.eclipse.papyrus.sdk.feature.feature.group lazy
- org.eclipse.team.svn.feature.group lazy
- org.eclipse.jdt.annotation [1.1.100,2.0.0)
-}
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.target
deleted file mode 100644
index 45c94165b..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.target
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde?>
-<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="EMF Compare based on Mars SDK" sequenceNumber="1500968112">
- <locations>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
- <repository location="http://download.eclipse.org/cbi/updates/license"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="com.google.guava" version="21.0.0.v20170206-1425"/>
- <unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
- <unit id="org.junit" version="4.12.0.v201504281640"/>
- <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
- <unit id="javaewah" version="1.1.6.v20160919-1400"/>
- <unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
- <unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
- <unit id="org.mockito" version="1.9.5.v201605172210"/>
- <unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
- <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="fr.obeo.performance" version="1.0.0.201402071743"/>
- <repository location="http://obeo.github.io/fr.obeo.performance/"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.egit.feature.group" version="0.0.0"/>
- <repository location="http://download.eclipse.org/egit/updates"/>
- </location>
- <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
- <unit id="org.eclipse.platform.sdk" version="0.0.0"/>
- <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.uml2.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="0.0.0"/>
- <unit id="org.eclipse.gmf.runtime.diagram.ui" version="0.0.0"/>
- <repository location="http://download.eclipse.org/releases/mars"/>
- </location>
- </locations>
-</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.tpd b/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.tpd
deleted file mode 100644
index 8a248e19e..000000000
--- a/org.eclipse.emf.compare-parent/targetPlatforms/mars-sdk.tpd
+++ /dev/null
@@ -1,17 +0,0 @@
-target "EMF Compare based on Mars SDK"
-
-include "fragments/licence.tpd"
-include "fragments/orbit.tpd"
-include "fragments/perf.tpd"
-include "fragments/egit.tpd"
-
-with source, requirements
-
-location "http://download.eclipse.org/releases/mars" {
- org.eclipse.platform.sdk lazy
- org.eclipse.emf.sdk.feature.group lazy
- org.eclipse.emf.transaction.sdk.feature.group lazy
- org.eclipse.uml2.feature.group lazy
- org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
- org.eclipse.gmf.runtime.diagram.ui lazy
-}
diff --git a/org.eclipse.emf.compare-parent/test-parent/pom.xml b/org.eclipse.emf.compare-parent/test-parent/pom.xml
index d00fce76d..9ac72bc3e 100644
--- a/org.eclipse.emf.compare-parent/test-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/test-parent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.eclipse.emf.compare</groupId>
diff --git a/packaging/org.eclipse.emf.compare-feature/feature.xml b/packaging/org.eclipse.emf.compare-feature/feature.xml
index 7fc0c9532..00f4df231 100644
--- a/packaging/org.eclipse.emf.compare-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare-feature/pom.xml b/packaging/org.eclipse.emf.compare-feature/pom.xml
index ab89bccb3..c8a43e64c 100644
--- a/packaging/org.eclipse.emf.compare-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
index e34be4af9..0de97aa19 100644
--- a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.diagram.ecoretools"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare.diagram.ide.ui.ecoretools"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/pom.xml b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/pom.xml
index 48ca5dfa9..c78b7af08 100644
--- a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.diagram.ecoretools</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
index b227c1a85..b10e9af88 100644
--- a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.diagram.gmf"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare.diagram"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/pom.xml b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/pom.xml
index f3819797b..997158352 100644
--- a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.diagram.gmf</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.diagram.sirius-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.sirius-feature/feature.xml
index fa0c11751..d1e6cada0 100644
--- a/packaging/org.eclipse.emf.compare.diagram.sirius-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.sirius-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.diagram.sirius"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="1.0.1">
diff --git a/packaging/org.eclipse.emf.compare.diagram.sirius-feature/pom.xml b/packaging/org.eclipse.emf.compare.diagram.sirius-feature/pom.xml
index 140a3cc93..b3005da34 100644
--- a/packaging/org.eclipse.emf.compare.diagram.sirius-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.sirius-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.diagram.sirius</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.egit-feature/feature.xml b/packaging/org.eclipse.emf.compare.egit-feature/feature.xml
index 50c96584a..0f96f1a25 100644
--- a/packaging/org.eclipse.emf.compare.egit-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.egit-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.egit"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="1.0.1">
diff --git a/packaging/org.eclipse.emf.compare.egit-feature/pom.xml b/packaging/org.eclipse.emf.compare.egit-feature/pom.xml
index 03999ed6b..9f0899a0e 100644
--- a/packaging/org.eclipse.emf.compare.egit-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.egit-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.egit</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.gendoc/lib/jar-in-jar-loader.zip b/packaging/org.eclipse.emf.compare.gendoc/lib/jar-in-jar-loader.zip
index 6ee121769..3c6c9bf92 100644
--- a/packaging/org.eclipse.emf.compare.gendoc/lib/jar-in-jar-loader.zip
+++ b/packaging/org.eclipse.emf.compare.gendoc/lib/jar-in-jar-loader.zip
Binary files differ
diff --git a/packaging/org.eclipse.emf.compare.gendoc/pom.xml b/packaging/org.eclipse.emf.compare.gendoc/pom.xml
index ebe8db89b..a272f3252 100644
--- a/packaging/org.eclipse.emf.compare.gendoc/pom.xml
+++ b/packaging/org.eclipse.emf.compare.gendoc/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>../../org.eclipse.emf.compare-parent</relativePath>
</parent>
<groupId>org.eclipse.emf.compare</groupId>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml b/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
index 6da8ae3d6..611f30338 100644
--- a/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.ide.ui"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare.ide.ui"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare.ide.ui-feature/pom.xml b/packaging/org.eclipse.emf.compare.ide.ui-feature/pom.xml
index e1e454c98..e77254bdf 100644
--- a/packaging/org.eclipse.emf.compare.ide.ui-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.ide.ui-feature/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.ide.ui</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/.project b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/.project
new file mode 100644
index 000000000..0f45736ef
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.ide.ui.e4-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/build.properties b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/build.properties
new file mode 100644
index 000000000..24b97565e
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/build.properties
@@ -0,0 +1,5 @@
+bin.includes = feature.xml,\
+ epl-v10.html,\
+ feature.properties,\
+ modeling32.png,\
+ copyright.txt
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/copyright.txt b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/copyright.txt
new file mode 100644
index 000000000..b8a3cb38f
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/copyright.txt
@@ -0,0 +1,8 @@
+Copyright (c) 2015, 2022 Obeo.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Obeo - initial API and implementation \ No newline at end of file
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/epl-v10.html b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/epl-v10.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/epl-v10.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.properties b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.properties
new file mode 100644
index 000000000..9554a160a
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.properties
@@ -0,0 +1,27 @@
+################################################################################
+# Copyright (c) 2015, 2022 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+featureName = Model comparison (EMF Compare) - IDE UI for E4
+providerName = Eclipse Modeling Project
+
+description = Provides support for the Comparison dialog in a pure E4\
+application.
+
+copyrightURL = copyright.txt
+copyright = Copyright (c) 2015, 2022 Obeo, France. \n\
+All rights reserved. This program and the accompanying materials \n\
+are made available under the terms of the Eclipse Public License v1.0 \n\
+which accompanies this distribution, and is available at \n\
+http://www.eclipse.org/legal/epl-v10.html \n\
+ \n\
+Contributors: \n\
+ Obeo - initial API and implementation
+########### end of license property ##########################################
+
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.xml b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.xml
new file mode 100644
index 000000000..60f970c79
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/feature.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.emf.compare.ide.ui.e4"
+ label="%featureName"
+ version="3.3.19.qualifier"
+ provider-name="%providerName"
+ license-feature="org.eclipse.license"
+ license-feature-version="1.0.1">
+
+ <description>
+ %description
+ </description>
+
+ <copyright url="%copyrightURL">
+ %copyright
+ </copyright>
+
+ <requires>
+ <import plugin="org.eclipse.emf.compare.ide.ui" version="4.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.emf.compare.ide.ui.e4"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/modeling32.png b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/modeling32.png
Binary files differ
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/pom.xml b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/pom.xml
new file mode 100644
index 000000000..17920722b
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/pom.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>emf.compare-feature-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent/feature-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare.features</groupId>
+ <artifactId>org.eclipse.emf.compare.ide.ui.e4</artifactId>
+ <version>3.3.19-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <plugin id="org.eclipse.emf.compare.doc"/>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/copyright.txt b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/copyright.txt
new file mode 100644
index 000000000..b8a3cb38f
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/copyright.txt
@@ -0,0 +1,8 @@
+Copyright (c) 2015, 2022 Obeo.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Obeo - initial API and implementation \ No newline at end of file
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/epl-v10.html b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/epl-v10.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/epl-v10.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/feature.properties b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/feature.properties
new file mode 100644
index 000000000..de59f520f
--- /dev/null
+++ b/packaging/org.eclipse.emf.compare.ide.ui.e4-feature/sourceTemplateFeature/feature.properties
@@ -0,0 +1,11 @@
+################################################################################
+# Copyright (c) 2015, 2022 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+featureName = Model comparison (EMF Compare) - IDE UI for E4 - SDK
diff --git a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
index b40fcbe21..caa95eefd 100644
--- a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.rcp.ui"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare.rcp.ui"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare.rcp.ui-feature/pom.xml b/packaging/org.eclipse.emf.compare.rcp.ui-feature/pom.xml
index 0b2e5b52a..c86c084db 100644
--- a/packaging/org.eclipse.emf.compare.rcp.ui-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.rcp.ui-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.rcp.ui</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.tests-feature/feature.xml b/packaging/org.eclipse.emf.compare.tests-feature/feature.xml
index 44f8c1435..b33eeb74b 100644
--- a/packaging/org.eclipse.emf.compare.tests-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.tests-feature/feature.xml
@@ -113,4 +113,11 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.emf.compare.diagram.ide.ui.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
diff --git a/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml b/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
index adcecaa6c..4486f2f04 100644
--- a/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.compare.uml2"
label="%featureName"
- version="3.3.9.qualifier"
+ version="3.3.19.qualifier"
provider-name="%providerName"
plugin="org.eclipse.emf.compare.uml2"
license-feature="org.eclipse.license"
diff --git a/packaging/org.eclipse.emf.compare.uml2-feature/pom.xml b/packaging/org.eclipse.emf.compare.uml2-feature/pom.xml
index ce6661e37..58561ee91 100644
--- a/packaging/org.eclipse.emf.compare.uml2-feature/pom.xml
+++ b/packaging/org.eclipse.emf.compare.uml2-feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.emf.compare.features</groupId>
<artifactId>org.eclipse.emf.compare.uml2</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/packaging/org.eclipse.emf.compare.update.extras/pom.xml b/packaging/org.eclipse.emf.compare.update.extras/pom.xml
index fa7e6e29f..735f496ba 100644
--- a/packaging/org.eclipse.emf.compare.update.extras/pom.xml
+++ b/packaging/org.eclipse.emf.compare.update.extras/pom.xml
@@ -4,12 +4,12 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>../../org.eclipse.emf.compare-parent</relativePath>
</parent>
<artifactId>org.eclipse.emf.compare.update.extras</artifactId>
<packaging>eclipse-repository</packaging>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<build>
<plugins>
<plugin>
diff --git a/packaging/org.eclipse.emf.compare.update/category.xml b/packaging/org.eclipse.emf.compare.update/category.xml
index ce9db6e8a..d10c506af 100644
--- a/packaging/org.eclipse.emf.compare.update/category.xml
+++ b/packaging/org.eclipse.emf.compare.update/category.xml
@@ -42,6 +42,12 @@
<feature id="org.eclipse.emf.compare.egit.source" version="0.0.0">
<category name="compare_integration"/>
</feature>
+ <feature id="org.eclipse.emf.compare.ide.ui.e4">
+ <category name="compare"/>
+ </feature>
+ <feature id="org.eclipse.emf.compare.ide.ui.e4.source">
+ <category name="compare"/>
+ </feature>
<category-def name="compare" label="EMF Compare">
<description>
EMF Compare main features.
diff --git a/packaging/org.eclipse.emf.compare.update/pom.xml b/packaging/org.eclipse.emf.compare.update/pom.xml
index 97f8033be..db35c857e 100644
--- a/packaging/org.eclipse.emf.compare.update/pom.xml
+++ b/packaging/org.eclipse.emf.compare.update/pom.xml
@@ -4,12 +4,12 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>../../org.eclipse.emf.compare-parent</relativePath>
</parent>
<artifactId>org.eclipse.emf.compare.update</artifactId>
<packaging>eclipse-repository</packaging>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<build>
<resources>
<resource>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
index f2b423ee6..d6205df07 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
@@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.5.0",
org.eclipse.gmf.runtime.emf.core;bundle-version="1.2.2",
org.eclipse.gmf.runtime.notation;bundle-version="1.2.0",
org.eclipse.ui;bundle-version="3.5.0"
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
index 047d0674f..abf2cacca 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
@@ -18,8 +18,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gmf.runtime.notation;bundle-version="1.2.0",
org.eclipse.gmf.runtime.notation.edit;bundle-version="1.4.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.diagram.internal,
org.eclipse.emf.compare.diagram.internal.extensions.provider;x-internal:=true,
org.eclipse.emf.compare.diagram.internal.extensions.provider.spec,
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
index e6956bb25..6c22e7c9c 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.6.0",
org.eclipse.emf.compare.ide;bundle-version="3.0.0",
org.eclipse.emf.compare.diagram.ide.ui;bundle-version="3.0.0",
org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/.checkstyle b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.checkstyle
index 2684ff12f..2684ff12f 100644
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/.checkstyle
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.checkstyle
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/.classpath b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.classpath
index 3bc247511..3e5654f17 100644
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/.classpath
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.project b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.project
new file mode 100644
index 000000000..16c3cfbbd
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.diagram.ide.ui.sirius.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..c61595376
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,368 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
+org.eclipse.jdt.core.formatter.align_with_spaces=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=110
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.lineSplit=110
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.text_block_indentation=0
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.ui.prefs
index de1c79644..7e2f24dd1 100644
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_EMF Compare
-formatter_settings_version=12
+formatter_settings_version=18
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
@@ -9,7 +9,7 @@ sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
@@ -30,19 +30,23 @@ sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
+sp_cleanup.push_down_negation=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_redundant_modifiers=false
+sp_cleanup.remove_redundant_semicolons=false
+sp_cleanup.remove_redundant_type_arguments=false
sp_cleanup.remove_trailing_whitespaces=false
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_array_creation=false
+sp_cleanup.remove_unnecessary_casts=false
sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_imports=true
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
@@ -51,7 +55,8 @@ sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
-sp_cleanup.use_blocks=false
+sp_cleanup.use_autoboxing=false
+sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
@@ -59,4 +64,4 @@ sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-sp_cleanup.use_type_arguments=false
+sp_cleanup.use_unboxing=false
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5de3303cf
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ui.sirius.tests
+Bundle-Version: 1.1.1.qualifier
+Bundle-Vendor: %providerName
+Automatic-Module-Name: org.eclipse.emf.compare.diagram.ide.ui.sirius.tests
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Localization: plugin
+Require-Bundle: org.junit,
+ org.mockito,
+ org.hamcrest,
+ org.eclipse.emf.compare.tests,
+ org.eclipse.emf.compare.diagram.ide.ui.sirius,
+ org.eclipse.emf.compare,
+ org.eclipse.emf.compare.diagram.sirius.tests,
+ org.eclipse.emf.compare.ide.ui.tests,
+ org.eclipse.emf.compare.diagram,
+ org.eclipse.emf.compare.rcp.ui,
+ org.eclipse.emf.compare.diagram.ide.ui,
+ org.eclipse.gmf.runtime.notation,
+ org.eclipse.sirius.diagram
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/about.html b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/about.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/build.properties
new file mode 100644
index 000000000..cdd2db7f1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/plugin.properties
new file mode 100644
index 000000000..ef20563b8
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/plugin.properties
@@ -0,0 +1,12 @@
+################################################################################
+# Copyright (c) 2020 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare Sirius Integration Tests
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/pom.xml
new file mode 100644
index 000000000..ef9b31499
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>emf.compare-test-parent</artifactId>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent/test-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>org.eclipse.emf.compare.diagram.ide.ui.sirius.tests</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/AllTests.class</include>
+ </includes>
+ <useUIHarness>true</useUIHarness>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/IDEUISiriusInputData.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/IDEUISiriusInputData.java
new file mode 100644
index 000000000..d373d0b97
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/IDEUISiriusInputData.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.data;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * This will provide the input model, their representation and other useful methods for all our Sirius tests.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class IDEUISiriusInputData extends AbstractInputData {
+
+ /**
+ * The left model of "nodes1".
+ *
+ * @return The loaded left model.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1Left() throws IOException {
+ return loadFromClassLoader("nodes1/left/left.nodes");
+ }
+
+ /**
+ * The representation of the "nodes1" left model.
+ *
+ * @return The loaded left representation.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1LeftRepresentation() throws IOException {
+ return loadFromClassLoader("nodes1/left/left.aird");
+ }
+
+ /**
+ * The right model of "nodes1".
+ *
+ * @return The loaded right model.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1Right() throws IOException {
+ return loadFromClassLoader("nodes1/right/right.nodes");
+ }
+
+ /**
+ * The representation of the "nodes1" right model.
+ *
+ * @return The loaded right representation.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1RightRepresentation() throws IOException {
+ return loadFromClassLoader("nodes1/right/right.aird");
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.aird b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.aird
new file mode 100644
index 000000000..beb013f26
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.aird
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_D3wqUIR_EeqXVMi-NXD3_g" selectedViews="_N7BpsJaAEeq0_dEE9gunOw" version="14.3.0.201909031200">
+ <semanticResources>left.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_N7BpsJaAEeq0_dEE9gunOw">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_RDsDwJaAEeq0_dEE9gunOw" name="Nodes1 Diagram" repPath="#_RB1CkJaAEeq0_dEE9gunOw" changeId="8ecb7706-8110-4fac-bc3d-d2ad86d97053">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="left.nodes#_KUSB0IR_EeqXVMi-NXD3_g"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_RB1CkJaAEeq0_dEE9gunOw">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_RDmkMJaAEeq0_dEE9gunOw" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_RDnLQJaAEeq0_dEE9gunOw"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_REVkAJaAEeq0_dEE9gunOw" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_REVkAZaAEeq0_dEE9gunOw" type="Sirius" element="_RB1CkJaAEeq0_dEE9gunOw" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_REsJUJaAEeq0_dEE9gunOw" type="2002" element="_RDQl8JaAEeq0_dEE9gunOw">
+ <children xmi:type="notation:Node" xmi:id="_RE16UJaAEeq0_dEE9gunOw" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_RE3vgJaAEeq0_dEE9gunOw" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RE3vgZaAEeq0_dEE9gunOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RE3vgpaAEeq0_dEE9gunOw"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_REsJUZaAEeq0_dEE9gunOw" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_REsJUpaAEeq0_dEE9gunOw"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_RFA5cJaAEeq0_dEE9gunOw" type="2002" element="_RDgdkJaAEeq0_dEE9gunOw">
+ <children xmi:type="notation:Node" xmi:id="_RFBggJaAEeq0_dEE9gunOw" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_RFBggZaAEeq0_dEE9gunOw" type="7001">
+ <children xmi:type="notation:Node" xmi:id="_RFDVsJaAEeq0_dEE9gunOw" type="3008" element="_RDhrsJaAEeq0_dEE9gunOw">
+ <children xmi:type="notation:Node" xmi:id="_RFD8wJaAEeq0_dEE9gunOw" type="5005"/>
+ <children xmi:type="notation:Node" xmi:id="_RFEj0JaAEeq0_dEE9gunOw" type="7002">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RFEj0ZaAEeq0_dEE9gunOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RFEj0paAEeq0_dEE9gunOw"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_RFDVsZaAEeq0_dEE9gunOw" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RFDVspaAEeq0_dEE9gunOw" x="30" y="29"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RFBggpaAEeq0_dEE9gunOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RFBgg5aAEeq0_dEE9gunOw"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_RFA5cZaAEeq0_dEE9gunOw" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RFA5cpaAEeq0_dEE9gunOw" x="210"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_REVkApaAEeq0_dEE9gunOw"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_RDQl8JaAEeq0_dEE9gunOw" name="B">
+ <target xmi:type="nodes:Node" href="left.nodes#_SXK6MIR_EeqXVMi-NXD3_g"/>
+ <semanticElements xmi:type="nodes:Node" href="left.nodes#_SXK6MIR_EeqXVMi-NXD3_g"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_RDX6sJaAEeq0_dEE9gunOw" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_RDgdkJaAEeq0_dEE9gunOw" name="C">
+ <target xmi:type="nodes:Node" href="left.nodes#_UiKLEIR_EeqXVMi-NXD3_g"/>
+ <semanticElements xmi:type="nodes:Node" href="left.nodes#_UiKLEIR_EeqXVMi-NXD3_g"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_RDhEoJaAEeq0_dEE9gunOw" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_RDhrsJaAEeq0_dEE9gunOw" name="D">
+ <target xmi:type="nodes:Node" href="left.nodes#_oB79gIR_EeqXVMi-NXD3_g"/>
+ <semanticElements xmi:type="nodes:Node" href="left.nodes#_oB79gIR_EeqXVMi-NXD3_g"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_RDhrsZaAEeq0_dEE9gunOw" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_RCMO8JaAEeq0_dEE9gunOw"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="left.nodes#_KUSB0IR_EeqXVMi-NXD3_g"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.nodes b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.nodes
new file mode 100644
index 000000000..b133be061
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/left/left.nodes
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_KUSB0IR_EeqXVMi-NXD3_g" name="A">
+ <containmentRef1 xmi:id="_SXK6MIR_EeqXVMi-NXD3_g" name="B"/>
+ <containmentRef1 xmi:id="_UiKLEIR_EeqXVMi-NXD3_g" name="C">
+ <containmentRef1 xmi:id="_oB79gIR_EeqXVMi-NXD3_g" name="D"/>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.aird b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.aird
new file mode 100644
index 000000000..e39ec8864
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.aird
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_D3wqUIR_EeqXVMi-NXD3_g" selectedViews="_N7BpsJaAEeq0_dEE9gunOw" version="14.3.0.201909031200">
+ <semanticResources>right.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_N7BpsJaAEeq0_dEE9gunOw">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_RDsDwJaAEeq0_dEE9gunOw" name="Nodes1 Diagram" repPath="#_RB1CkJaAEeq0_dEE9gunOw" changeId="7af842f9-82b9-4160-ab50-841e5b528c2d">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="right.nodes#_KUSB0IR_EeqXVMi-NXD3_g"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_RB1CkJaAEeq0_dEE9gunOw">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_RDmkMJaAEeq0_dEE9gunOw" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_RDnLQJaAEeq0_dEE9gunOw"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_REVkAJaAEeq0_dEE9gunOw" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_REVkAZaAEeq0_dEE9gunOw" type="Sirius" element="_RB1CkJaAEeq0_dEE9gunOw" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_RFA5cJaAEeq0_dEE9gunOw" type="2002" element="_RDgdkJaAEeq0_dEE9gunOw">
+ <children xmi:type="notation:Node" xmi:id="_RFBggJaAEeq0_dEE9gunOw" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_RFBggZaAEeq0_dEE9gunOw" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_RFBggpaAEeq0_dEE9gunOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_RFBgg5aAEeq0_dEE9gunOw"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_RFA5cZaAEeq0_dEE9gunOw" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RFA5cpaAEeq0_dEE9gunOw" x="210"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_REVkApaAEeq0_dEE9gunOw"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_RDgdkJaAEeq0_dEE9gunOw" name="C">
+ <target xmi:type="nodes:Node" href="right.nodes#_UiKLEIR_EeqXVMi-NXD3_g"/>
+ <semanticElements xmi:type="nodes:Node" href="right.nodes#_UiKLEIR_EeqXVMi-NXD3_g"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_RDhEoJaAEeq0_dEE9gunOw" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_RCMO8JaAEeq0_dEE9gunOw"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="right.nodes#_KUSB0IR_EeqXVMi-NXD3_g"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.nodes b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.nodes
new file mode 100644
index 000000000..42479a1a3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/data/nodes1/right/right.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_KUSB0IR_EeqXVMi-NXD3_g" name="A">
+ <containmentRef1 xmi:id="_UiKLEIR_EeqXVMi-NXD3_g" name="C"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/TestBug564680.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/TestBug564680.java
new file mode 100644
index 000000000..c318f4d14
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/TestBug564680.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.data.IDEUISiriusInputData;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.sirius.tests.AbstractSiriusTest;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Test;
+
+/**
+ * This test is related to the bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=564680">564680.</a>
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class TestBug564680 extends AbstractSiriusTest {
+
+ /**
+ * The input data.
+ */
+ private IDEUISiriusInputData inputData = new IDEUISiriusInputData();
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+
+ /**
+ * Tests that diagrams owned by left and right accessors are not null after a merge from right to left of
+ * elements added on the left side, and also after undo and redo actions.
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Test
+ public void testAccessorsNotNullR2LElementsAdded() throws IOException {
+ Resource leftResource = inputData.getNodes1LeftRepresentation();
+ Resource rightResource = inputData.getNodes1RightRepresentation();
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<DiagramDiff> diagralDiffs = getDiagramDiffs(comparison.getDifferences());
+ List<DiagramDiff> dDiffs = new ArrayList<DiagramDiff>();
+ DiagramDiff firstDiff = diagralDiffs.get(0);
+ dDiffs.add(firstDiff);
+ IDiagramNodeAccessor accessorLeft = new SiriusDiffAccessor(firstDiff, MergeViewerSide.LEFT);
+ IDiagramNodeAccessor accessorRight = new SiriusDiffAccessor(firstDiff, MergeViewerSide.RIGHT);
+
+ mergeDiffsRightToLeft(dDiffs);
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ undo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ redo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+ }
+
+ /**
+ * Tests that diagrams owned by left and right accessors are not null after a merge from left to right of
+ * elements added on the left side, and also after undo and redo actions.
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Test
+ public void testAccessorsNotNullL2RElementsAdded() throws IOException {
+ Resource leftResource = inputData.getNodes1LeftRepresentation();
+ Resource rightResource = inputData.getNodes1RightRepresentation();
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<DiagramDiff> diagralDiffs = getDiagramDiffs(comparison.getDifferences());
+ List<DiagramDiff> dDiffs = new ArrayList<DiagramDiff>();
+ DiagramDiff firstDiff = diagralDiffs.get(0);
+ dDiffs.add(firstDiff);
+ IDiagramNodeAccessor accessorLeft = new SiriusDiffAccessor(firstDiff, MergeViewerSide.LEFT);
+ IDiagramNodeAccessor accessorRight = new SiriusDiffAccessor(firstDiff, MergeViewerSide.RIGHT);
+
+ mergeDiffsLeftToRight(dDiffs);
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ undo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ redo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+ }
+
+ /**
+ * Tests that diagrams owned by left and right accessors are not null after a merge from right to left of
+ * elements deleted on the left side, and also after undo and redo actions.
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Test
+ public void testAccessorsNotNullR2LElementsDeleted() throws IOException {
+ Resource leftResource = inputData.getNodes1LeftRepresentation();
+ Resource rightResource = inputData.getNodes1RightRepresentation();
+ scope = new DefaultComparisonScope(rightResource, leftResource, null);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<DiagramDiff> diagralDiffs = getDiagramDiffs(comparison.getDifferences());
+ List<DiagramDiff> dDiffs = new ArrayList<DiagramDiff>();
+ DiagramDiff firstDiff = diagralDiffs.get(0);
+ dDiffs.add(firstDiff);
+ IDiagramNodeAccessor accessorLeft = new SiriusDiffAccessor(firstDiff, MergeViewerSide.LEFT);
+ IDiagramNodeAccessor accessorRight = new SiriusDiffAccessor(firstDiff, MergeViewerSide.RIGHT);
+
+ mergeDiffsRightToLeft(dDiffs);
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ undo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ redo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+ }
+
+ /**
+ * Tests that diagrams owned by left and right accessors are not null after a merge from left to right of
+ * elements deleted on the left side, and also after undo and redo actions.
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Test
+ public void testAccessorsNotNullL2RElementsDeleted() throws IOException {
+ Resource leftResource = inputData.getNodes1LeftRepresentation();
+ Resource rightResource = inputData.getNodes1RightRepresentation();
+ scope = new DefaultComparisonScope(rightResource, leftResource, null);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<DiagramDiff> diagralDiffs = getDiagramDiffs(comparison.getDifferences());
+ List<DiagramDiff> dDiffs = new ArrayList<DiagramDiff>();
+ DiagramDiff firstDiff = diagralDiffs.get(0);
+ dDiffs.add(firstDiff);
+ IDiagramNodeAccessor accessorLeft = new SiriusDiffAccessor(firstDiff, MergeViewerSide.LEFT);
+ IDiagramNodeAccessor accessorRight = new SiriusDiffAccessor(firstDiff, MergeViewerSide.RIGHT);
+
+ mergeDiffsLeftToRight(dDiffs);
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ undo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+
+ redo();
+ assertAccessorsDiagramNotNull(accessorLeft, accessorRight);
+ }
+
+ /**
+ * Ensures that diagrams owned by given accessors are not null.
+ *
+ * @param accessorLeft
+ * the first accessor.
+ * @param accessorRight
+ * the second accessor.
+ */
+ private static void assertAccessorsDiagramNotNull(IDiagramNodeAccessor accessorLeft,
+ IDiagramNodeAccessor accessorRight) {
+ assertNotNull(accessorLeft.getOwnedDiagram());
+ assertNotNull(accessorRight.getOwnedDiagram());
+ }
+
+ /**
+ * Provides access to DiagramDiff that exist in the difference list.
+ *
+ * @param differences
+ * the list of differences
+ * @return the list of DiagramDiff.
+ */
+ private List<DiagramDiff> getDiagramDiffs(List<Diff> differences) {
+ Stream<DiagramDiff> siriusDiffs = differences.stream().filter(diff -> diff instanceof DiagramDiff)
+ .map(DiagramDiff.class::cast);
+ return siriusDiffs.collect(Collectors.toList());
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/AllTests.java
new file mode 100644
index 000000000..cc5a5461b
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/AllTests.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.tests.suite;
+
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.util.NodesResourceFactoryImpl;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This class is used to run all the test classes of the
+ * <code>org.eclipse.emf.compare.diagram.ide.ui.sirius.tests</code> project.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@RunWith(Suite.class)
+@SuiteClasses({BugsTestSuite.class })
+public class AllTests {
+
+ /**
+ * Used to fill EMF registers.
+ */
+ @BeforeClass
+ public static void fillEMFRegistries() {
+ EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
+
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("nodes", //$NON-NLS-1$
+ new NodesResourceFactoryImpl());
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/BugsTestSuite.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/BugsTestSuite.java
new file mode 100644
index 000000000..0d93a722d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius.tests/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/tests/suite/BugsTestSuite.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.tests.suite;
+
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.TestBug564680;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This class is used to run all the bugfix test classes of the
+ * <code>org.eclipse.emf.compare.diagram.ide.ui.sirius.tests</code> project.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@RunWith(Suite.class)
+@SuiteClasses({TestBug564680.class })
+public class BugsTestSuite {
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/META-INF/MANIFEST.MF
index efb19b47c..c13ae8db2 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/META-INF/MANIFEST.MF
@@ -11,20 +11,22 @@ Require-Bundle: org.eclipse.compare,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.ide;bundle-version="3.5.0",
- org.eclipse.emf.edit;bundle-version="2.5.0",
org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.emf.compare;bundle-version="3.2.0",
org.eclipse.emf.compare.rcp.ui;bundle-version="4.1.0",
org.eclipse.emf.compare.ide.ui;bundle-version="4.1.0",
org.eclipse.emf.compare.diagram,
org.eclipse.emf.compare.diagram.ide.ui;bundle-version="3.0.0",
- org.eclipse.sirius.diagram;bundle-version="3.0.0",
- org.eclipse.gmf.runtime.notation;bundle-version="1.8.0",
- org.eclipse.gef
-Import-Package: com.google.common.annotations;version="[27.0.0,28.0.0)",
- com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+ org.eclipse.sirius.diagram.ui,
+ org.eclipse.gmf.runtime.diagram.ui,
+ org.eclipse.sirius.common,
+ org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.7.1",
+ org.eclipse.gmf.runtime.draw2d.ui.render.awt,
+ org.eclipse.sirius.common.ui
+Import-Package: com.google.common.annotations;version="[27.0.0,30.2.0)",
+ com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.diagram.ide.ui.sirius.internal;x-friends:="org.eclipse.emf.compare.diagram.sirius.tests"
Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.sirius.CompareDiagramIDEUISiriusPlugin
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/build.properties
index 6b5eea486..117a97fda 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/build.properties
@@ -4,5 +4,8 @@ bin.includes = META-INF/,\
.,\
about.html,\
plugin.properties,\
- plugin.xml
-src.includes = about.html \ No newline at end of file
+ plugin.xml,\
+ icons/
+src.includes = about.html,\
+ icons/
+
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/icons/screenshot.gif b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/icons/screenshot.gif
new file mode 100644
index 000000000..e3ebf2105
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/icons/screenshot.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/CompareDiagramIDEUISiriusPlugin.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/CompareDiagramIDEUISiriusPlugin.java
index 4728aed83..394e78e9b 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/CompareDiagramIDEUISiriusPlugin.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/CompareDiagramIDEUISiriusPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2020 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.sirius;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -64,4 +67,25 @@ public class CompareDiagramIDEUISiriusPlugin extends AbstractUIPlugin {
return plugin;
}
+ /**
+ * Returns a plugin image descriptor.
+ *
+ * @param imagePath
+ * plugin relative path to the image
+ * @return ImageDescriptor image descriptor.
+ */
+ public static ImageDescriptor getImageDescriptor(String imagePath) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, imagePath);
+ }
+
+ /**
+ * Log an {@link Exception} in the {@link #getLog() current logger}.
+ *
+ * @param e
+ * the exception to be logged.
+ */
+ public void log(Throwable e) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e));
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/SiriusContentMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/SiriusContentMergeViewer.java
index 0d914ea63..0fecee1a1 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/SiriusContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/SiriusContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 Obeo.
+ * Copyright (c) 2018, 2020 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,8 +16,11 @@ import java.util.Set;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.actions.SiriusComparisonAsImageFileAction;
import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsManager;
import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsRegistry;
@@ -26,15 +29,34 @@ import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsM
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.widgets.Composite;
+/**
+ * Specialized {@link org.eclipse.compare.contentmergeviewer.ContentMergeViewer} used to display Sirius
+ * diagram comparison.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
public class SiriusContentMergeViewer extends DiagramContentMergeViewer {
private Set<DiagramMappingsManager> siriusMappingManagers = new LinkedHashSet<>();
private Set<DiagramDescriptionMappingsManager> siriusDescriptionMappingManagers = new LinkedHashSet<>();
+ /**
+ * Default constructor.
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer#DiagramContentMergeViewer(Composite,
+ * EMFCompareConfiguration)
+ * @param parent
+ * the parent composite to build the UI in.
+ * @param config
+ * the {@link EMFCompareConfiguration}.
+ */
public SiriusContentMergeViewer(Composite parent, EMFCompareConfiguration config) {
super(parent, config);
}
+ /**
+ * {@inheritDoc}
+ */
@Override
protected void updateContent(Object ancestor, Object left, Object right) {
super.updateContent(ancestor, left, right);
@@ -43,6 +65,9 @@ public class SiriusContentMergeViewer extends DiagramContentMergeViewer {
getSiriusDiagram(right).ifPresent(this::storeManagers);
}
+ /**
+ * {@inheritDoc}
+ */
@Override
protected void handleDispose(DisposeEvent event) {
super.handleDispose(event);
@@ -72,4 +97,14 @@ public class SiriusContentMergeViewer extends DiagramContentMergeViewer {
siriusDescriptionMappingManagers.add(DiagramDescriptionMappingsRegistry.INSTANCE
.getDiagramDescriptionMappingsManager(null, diagram.getDescription()));
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createToolItems(ToolBarManager toolBarManager) {
+ super.createToolItems(toolBarManager);
+ SiriusComparisonAsImageFileAction saveAsImageFileAction = new SiriusComparisonAsImageFileAction(this);
+ toolBarManager.insert(0, new ActionContributionItem(saveAsImageFileAction));
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/ExportComparisonAction.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/ExportComparisonAction.java
new file mode 100644
index 000000000..3b15f4190
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/ExportComparisonAction.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.actions;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.image.EMFCompareCopyToImageUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+/**
+ * Export action for diagram comparison.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class ExportComparisonAction extends WorkspaceModifyOperation {
+
+ /**
+ * The diagram to be copied from the left side of the comparison in the ContentMergeViewer.
+ */
+ private DiagramEditPart leftDiagramEditPart;
+
+ /**
+ * The diagram to be copied from the right side of the comparison in the ContentMergeViewer.
+ */
+ private DiagramEditPart rightDiagramEditPart;
+
+ /**
+ * Decorators representing Phantoms and Markers in the ContentMergeViewer.
+ */
+ private Collection<AbstractDecorator> decorators;
+
+ /**
+ * The destination folder chosen in the dialog.
+ */
+ private IPath outputPath;
+
+ /**
+ * The image format chosen in the dialog.
+ */
+ private ImageFileFormat imageFormat;
+
+ /**
+ * Constructor used to export leftDiagramEditPart and rightDiagramEditPart as image.
+ *
+ * @param path
+ * the folder in which store the images, result of the export.
+ * @param format
+ * the format of the image, result of the export.
+ * @param leftDEP
+ * The left {@link DiagramEditPart} to be copied.
+ * @param rightDEP
+ * The right {@link DiagramEditPart} to be copied.
+ * @param abstractDecorators
+ * The {@link AbstractDecorator}s of the ContentMergeViewer.
+ */
+ public ExportComparisonAction(IPath path, ImageFileFormat format, DiagramEditPart leftDEP,
+ DiagramEditPart rightDEP, Collection<AbstractDecorator> abstractDecorators) {
+ outputPath = path;
+ imageFormat = format;
+ leftDiagramEditPart = leftDEP;
+ rightDiagramEditPart = rightDEP;
+ decorators = abstractDecorators;
+ }
+
+ /**
+ * Overridden to do the export work. {@inheritDoc}
+ */
+ @Override
+ protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ createImageFiles(monitor);
+ } catch (final OutOfMemoryError | CoreException e) {
+ // Catching OOM as this could be thrown if the image to export requires too large a buffer
+ throw new InvocationTargetException(e, e.getLocalizedMessage());
+ } finally {
+ monitor.done();
+ if (monitor.isCanceled()) {
+ throw new InterruptedException("The operation was cancelled");
+ }
+ }
+ }
+
+ /**
+ * Create the image files.
+ *
+ * @param monitor
+ * the progress monitor
+ * @throws CoreException
+ * if one or several images creation failed. The Exception contains a Status with the causes
+ * of this Exception.
+ */
+ protected void createImageFiles(final IProgressMonitor monitor) throws CoreException {
+ EMFCompareCopyToImageUtil tool = new EMFCompareCopyToImageUtil(leftDiagramEditPart,
+ rightDiagramEditPart, decorators);
+ tool.copyAllToImage(outputPath, imageFormat, monitor);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/SiriusComparisonAsImageFileAction.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/SiriusComparisonAsImageFileAction.java
new file mode 100644
index 000000000..bbf4c6a3d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/actions/SiriusComparisonAsImageFileAction.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.actions;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramMergeViewer;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.CompareDiagramIDEUISiriusPlugin;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.dialog.ExportComparisonDialog;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.sirius.ui.tools.api.actions.export.SizeTooLargeException;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class allows to run the comparison export as image.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class SiriusComparisonAsImageFileAction extends Action {
+
+ /**
+ * The {@link DiagramContentMergeViewer} which contains the left, right and ancestor
+ * {@link DiagramMergeViewer} once initialized.
+ */
+ private DiagramContentMergeViewer contentMergeViewer;
+
+ /**
+ * The left {@link DiagramEditPart} to export as image.
+ */
+ private DiagramEditPart leftDiagramEditPart;
+
+ /**
+ * The right {@link DiagramEditPart} to export as image.
+ */
+ private DiagramEditPart rightDiagramEditPart;
+
+ /**
+ * Constructor.
+ *
+ * @param mergeViewer
+ * the {@link DiagramContentMergeViewer}.
+ */
+ public SiriusComparisonAsImageFileAction(DiagramContentMergeViewer mergeViewer) {
+ super("Export diagram comparison as image",
+ CompareDiagramIDEUISiriusPlugin.getImageDescriptor("icons/screenshot.gif")); //$NON-NLS-1$
+ contentMergeViewer = mergeViewer;
+ }
+
+ @Override
+ public void run() {
+ setEditParts();
+ exportRepresentation();
+ }
+
+ /**
+ * Used to initialize leftDiagramEditPart and rightDiagramEditPart once the
+ * {@link DiagramContentMergeViewer} has been set.
+ */
+ private void setEditParts() {
+ RootEditPart leftRootEP = contentMergeViewer.getLeftMergeViewer().getGraphicalViewer()
+ .getRootEditPart();
+ RootEditPart rightRootEP = contentMergeViewer.getRightMergeViewer().getGraphicalViewer()
+ .getRootEditPart();
+ if (leftRootEP instanceof DiagramRootEditPart && rightRootEP instanceof DiagramRootEditPart) {
+ DiagramRootEditPart leftRootEditPart = (DiagramRootEditPart)leftRootEP;
+ DiagramRootEditPart rightRootEditPart = (DiagramRootEditPart)rightRootEP;
+ if (leftRootEditPart.getContents() instanceof DiagramEditPart
+ && rightRootEditPart.getContents() instanceof DiagramEditPart) {
+ leftDiagramEditPart = (DiagramEditPart)leftRootEditPart.getContents();
+ rightDiagramEditPart = (DiagramEditPart)rightRootEditPart.getContents();
+ }
+ }
+ }
+
+ /**
+ * Display the export path and file format dialog and then export the representations.
+ */
+ protected void exportRepresentation() {
+
+ final Shell shell = Display.getCurrent().getActiveShell();
+ ExportComparisonDialog dialog = new ExportComparisonDialog(shell);
+
+ if (dialog.open() == Window.OK) {
+ final ExportComparisonAction exportAction = new ExportComparisonAction(dialog.getOutputPath(),
+ dialog.getImageFormat(), leftDiagramEditPart, rightDiagramEditPart,
+ contentMergeViewer.getDecoratorsManager().getAllDecorators());
+ final ProgressMonitorDialog pmd = new ProgressMonitorDialog(shell);
+
+ try {
+ pmd.run(false, false, exportAction);
+ } catch (final InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof OutOfMemoryError) {
+ MessageDialog.openError(shell, "Not enough memory available to create image files",
+ cause.getMessage());
+ } else if (cause instanceof SizeTooLargeException) {
+ MessageDialog.openError(shell, "Image export impossible", cause.getMessage());
+ CompareDiagramIDEUISiriusPlugin.getDefault().log(cause);
+ } else {
+ MessageDialog.openError(shell, "Error", cause.getMessage());
+ }
+ } catch (final InterruptedException e) {
+ MessageDialog.openInformation(shell, "Error", e.getMessage());
+ } finally {
+ pmd.close();
+ }
+
+ } else {
+ dialog.close();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/dialog/ExportComparisonDialog.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/dialog/ExportComparisonDialog.java
new file mode 100644
index 000000000..8a0b5d072
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/dialog/ExportComparisonDialog.java
@@ -0,0 +1,599 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.dialog;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.compare.diagram.ide.ui.sirius.CompareDiagramIDEUISiriusPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.sirius.common.ui.tools.api.util.SWTUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Dialog used to export a graphical comparison as image.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class ExportComparisonDialog extends Dialog {
+
+ /**
+ * The id for the persistent settings for this dialog.
+ */
+ public static final String DIALOG_SETTINGS_ID = "ExportComparisonAsImagesDialog"; //$NON-NLS-1$
+
+ /**
+ * Default extension image.
+ */
+ protected static final ImageFileFormat DEFAULT_VALUE = ImageFileFormat.JPG;
+
+ /**
+ * The list of values for this enumerated type.
+ */
+ protected static final ImageFileFormat[] SAFE_VALUES = {DEFAULT_VALUE, ImageFileFormat.PNG,
+ ImageFileFormat.BMP, ImageFileFormat.GIF, };
+
+ /**
+ * The empty string.
+ */
+ protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+ /**
+ * The image format label text.
+ */
+ protected static final String IMAGE_FORMAT_LABEL = "&Image Format";
+
+ /**
+ * The browse button text.
+ */
+ protected static final String BROWSE_LABEL = "&Browse...";
+
+ /**
+ * The id for the persistent image format setting for this dialog.
+ */
+ protected static final String DIALOG_SETTINGS_IMAGE_FORMAT = "ExportComparisonAsImageDialog.imageFormat"; //$NON-NLS-1$
+
+ /**
+ * An error access message.
+ */
+ protected static final String ACCES_ERROR_MESSAGE = "Access to path is impossible";
+
+ /**
+ * An error folder not exist message.
+ */
+ protected static final String FOLDER_NOT_EXIST_MESSAGE = "Folder does not exist";
+
+ /**
+ * The id for the persistent folder setting for this dialog.
+ */
+ private static final String DIALOG_SETTINGS_FOLDER = "ExportComparisonAsImageDialog.folder"; //$NON-NLS-1$
+
+ /**
+ * The directory dialog message.
+ */
+ private static final String DIRECTORY_DIALOG_MESSAGE = "Select the destination folder";
+
+ /**
+ * The directory dialog text.
+ */
+ private static final String DIRECTORY_DIALOG_TEXT = DIRECTORY_DIALOG_MESSAGE;
+
+ /**
+ * Popup file field label.
+ */
+ private static final String TO_DIRECTORY = "To directory";
+
+ /**
+ * The dialog window title.
+ */
+ private static final String DIALOG_TITLE = "Export comparison as image file";
+
+ /**
+ * Combo length history path.
+ */
+ private static final int COMBO_HISTORY_LENGTH = 5;
+
+ /**
+ * Height of the browse button.
+ */
+ private static final int HEIGHT_BROWSE_BUTTON = 14;
+
+ /**
+ * Width of the folder combo field.
+ */
+ private static final int WIDTH_FOLDER_TEXT = 350;
+
+ /**
+ * Width of the message field.
+ */
+ private static final int WIDTH_MESSAGE = 300;
+
+ /**
+ * The folder combo field.
+ */
+ protected Combo folderText;
+
+ /**
+ * The extension image combo field.
+ */
+ protected Combo imageFormatCombo;
+
+ /**
+ * The image format selected in the image format pulldown field.
+ */
+ protected ImageFileFormat imageFormat;
+
+ /**
+ * The text entered into the folder text field.
+ */
+ protected String folder;
+
+ /**
+ * The message image field, displays the error (X) icon when the file name or folder is invalid.
+ */
+ private Label messageImageLabel;
+
+ /**
+ * The message field, displays an error message when the file name or folder is invalid.
+ */
+ private Label messageLabel;
+
+ /**
+ * Creates an instance of the copy to image dialog.
+ *
+ * @param parentShell
+ * the parent shell
+ */
+ public ExportComparisonDialog(Shell parentShell) {
+ super(parentShell);
+ initDialogSettings();
+ }
+
+ /**
+ * Resolve the selected image format to an enumerated type.
+ *
+ * @param ordinal
+ * the selected format in the pulldown
+ * @return the image format enumerated type
+ */
+ public static ImageFileFormat resolveImageFormat(final int ordinal) {
+ return SAFE_VALUES[ordinal];
+ }
+
+ /**
+ * Resolve the selected image format to an enumerated type.
+ *
+ * @param imageFormat
+ * the selected format.
+ * @return the image format enumerated type
+ */
+ public static ImageFileFormat resolveImageFormat(final String imageFormat) {
+ for (ImageFileFormat element : SAFE_VALUES) {
+ if (element.getName().toLowerCase().equals(imageFormat.toLowerCase())) {
+ return element;
+ }
+ }
+ return getDefaultImageFormat();
+ }
+
+ /**
+ * Retrieves the default image format.
+ *
+ * @return the default image format.
+ */
+ public static ImageFileFormat getDefaultImageFormat() {
+ return ImageFileFormat.JPG;
+ }
+
+ /**
+ * Returns height and width data in a GridData for the button that was passed in. You can call
+ * button.setLayoutData with the returned data.
+ *
+ * @param button
+ * which has already been made. We'll be making the GridData for this button, so be sure that
+ * the text has already been set.
+ * @return GridData for this button with the suggested height and width
+ */
+ public static GridData makeButtonData(Button button) {
+ GC gc = new GC(button);
+ gc.setFont(button.getFont());
+
+ GridData data = new GridData();
+ data.heightHint = Dialog.convertVerticalDLUsToPixels(gc.getFontMetrics(), HEIGHT_BROWSE_BUTTON);
+ data.widthHint = Math.max(
+ Dialog.convertHorizontalDLUsToPixels(gc.getFontMetrics(), IDialogConstants.BUTTON_WIDTH),
+ button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+
+ gc.dispose();
+
+ return data;
+ }
+
+ /**
+ * Returns the output path.
+ *
+ * @return folder
+ */
+ public IPath getOutputPath() {
+ return new Path(folder);
+ }
+
+ /**
+ * Returns the destination image file format selected by the user.
+ *
+ * @return the selected image file format.
+ */
+ public ImageFileFormat getImageFormat() {
+ return imageFormat;
+ }
+
+ /**
+ * Retrieves the persistent settings for this dialog.
+ *
+ * @return the persistent settings for this dialog.
+ */
+ protected IDialogSettings getDialogSettings() {
+ IDialogSettings settings = CompareDiagramIDEUISiriusPlugin.getDefault().getDialogSettings();
+ settings = settings.getSection(DIALOG_SETTINGS_ID);
+ if (settings == null) {
+ settings = CompareDiagramIDEUISiriusPlugin.getDefault().getDialogSettings()
+ .addNewSection(DIALOG_SETTINGS_ID);
+ }
+ return settings;
+ }
+
+ /**
+ * Initialize the settings for this dialog.
+ */
+ protected void initDialogSettings() {
+ final IDialogSettings dialogSettings = getDialogSettings();
+ folder = "/"; //$NON-NLS-1$
+ String workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ if (workspace != null && !workspace.equals(EMPTY_STRING)) {
+ folder = workspace;
+ }
+
+ final String persistentFolder = dialogSettings.get(DIALOG_SETTINGS_FOLDER);
+ if (persistentFolder != null) {
+ folder = persistentFolder;
+ }
+
+ final String persistentImageFormat = dialogSettings.get(DIALOG_SETTINGS_IMAGE_FORMAT);
+ if (persistentImageFormat == null) {
+ imageFormat = getDefaultImageFormat();
+ } else {
+ imageFormat = resolveImageFormat(persistentImageFormat);
+ }
+ }
+
+ /**
+ * Retrieves the persistent settings for this dialog.
+ */
+ protected void saveDialogSettings() {
+ final IDialogSettings dialogSettings = getDialogSettings();
+ if (dialogSettings != null) {
+ String[] directoryNames = dialogSettings.getArray(DIALOG_SETTINGS_FOLDER);
+ if (directoryNames == null || directoryNames.length == 0) {
+ directoryNames = new String[1];
+ directoryNames[0] = folder;
+ }
+ directoryNames = addToHistory(directoryNames, folder);
+ dialogSettings.put(DIALOG_SETTINGS_FOLDER, directoryNames);
+ dialogSettings.put(DIALOG_SETTINGS_IMAGE_FORMAT, imageFormat.getName());
+ }
+ }
+
+ @Override
+ protected void okPressed() {
+ imageFormat = resolveImageFormat(imageFormatCombo.getSelectionIndex());
+ super.okPressed();
+ saveDialogSettings();
+ }
+
+ /**
+ * Handle a browse button pressed selection.
+ */
+ protected void handleBrowseButtonPressed() {
+ final DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent().getActiveShell());
+ dialog.setMessage(DIRECTORY_DIALOG_MESSAGE);
+ dialog.setText(DIRECTORY_DIALOG_TEXT);
+
+ final String dirName = folderText.getText();
+ if (!dirName.equals(EMPTY_STRING)) {
+ final File path = new File(dirName);
+ if (path.exists()) {
+ dialog.setFilterPath(new Path(dirName).toOSString());
+ }
+ }
+
+ final String selectedDirectory = dialog.open();
+ if (selectedDirectory != null) {
+ folderText.setText(selectedDirectory);
+ }
+ }
+
+ /**
+ * Validate the folder text field.
+ */
+ protected void validateFolderText() {
+
+ if (folderText.getText().equals(EMPTY_STRING)) {
+
+ setDialogErrorState("Folder cannot be blank");
+
+ } else {
+
+ IPath path = new Path(EMPTY_STRING);
+ if (!path.isValidPath(folderText.getText())) {
+ setDialogErrorState("Folder is not a valid path");
+ return;
+ }
+
+ final File file = new File(folderText.getText());
+ final File directory = file.getParentFile();
+
+ if (file.exists()) {
+ if (!file.canWrite()) {
+ setDialogErrorState(ACCES_ERROR_MESSAGE);
+ return;
+ }
+ } else if (directory != null && !directory.canWrite()) {
+ setDialogErrorState(ACCES_ERROR_MESSAGE);
+ return;
+ }
+ folder = folderText.getText();
+ setDialogOKState();
+ }
+ }
+
+ /**
+ * Set the dialog into error state mode. The error image (x) label and error label are made visible and
+ * the ok button is disabled.
+ *
+ * @param message
+ * the error message
+ */
+ protected void setDialogErrorState(final String message) {
+ messageLabel.setText(message);
+ messageImageLabel.setVisible(true);
+ messageLabel.setVisible(true);
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ getButton(IDialogConstants.CANCEL_ID).getShell()
+ .setDefaultButton(getButton(IDialogConstants.CANCEL_ID));
+ }
+
+ /**
+ * Get the supported image formats from the enumerated type.
+ *
+ * @return array of supported image formats.
+ */
+ protected String[] getImageSafeFormatItems() {
+ final String[] items = new String[SAFE_VALUES.length];
+ for (int i = 0; i < SAFE_VALUES.length; i++) {
+ items[i] = SAFE_VALUES[i].getName();
+ }
+ return items;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Control result = super.createContents(parent);
+ validateFolderText();
+ return result;
+ }
+
+ @Override
+ protected Control createDialogArea(final Composite parent) {
+ final Composite composite = (Composite)super.createDialogArea(parent);
+ createFolderGroup(composite);
+ createImageFormatGroup(composite);
+ createMessageGroup(composite);
+ initListeners();
+ return composite;
+ }
+
+ /**
+ * Create the folder group in the dialog.
+ *
+ * @param parent
+ * the parent widget
+ */
+ protected void createFolderGroup(final Composite parent) {
+ final Composite composite = SWTUtil.createCompositeHorizontalFill(parent, 3, false);
+ SWTUtil.createLabel(composite, TO_DIRECTORY);
+
+ folderText = new Combo(composite, SWT.SINGLE | SWT.BORDER);
+ restoreWidgetValues();
+ folderText.setText(folder);
+ final GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.widthHint = WIDTH_FOLDER_TEXT;
+ folderText.setLayoutData(gridData);
+
+ final Button button = new Button(composite, SWT.PUSH);
+ button.setText(BROWSE_LABEL);
+ button.setLayoutData(makeButtonData(button));
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent event) {
+ handleBrowseButtonPressed();
+ }
+ });
+ }
+
+ /**
+ * Create the image format group in the dialog.
+ *
+ * @param parent
+ * the parent widget
+ */
+ protected void createImageFormatGroup(final Composite parent) {
+ final Composite composite = SWTUtil.createCompositeHorizontalFill(parent, 2, false);
+ SWTUtil.createLabel(composite, IMAGE_FORMAT_LABEL);
+
+ String[] imageSafeFormatItems = getImageSafeFormatItems();
+
+ Control imageFormatControl;
+ if (imageSafeFormatItems != null && imageSafeFormatItems.length > 0) {
+
+ if (imageSafeFormatItems.length == 1) {
+ imageFormatControl = SWTUtil.createLabel(composite, imageSafeFormatItems[0]);
+
+ } else {
+ imageFormatCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ imageFormatCombo.setItems(imageSafeFormatItems);
+ imageFormatCombo.setText(imageFormat.getName());
+ imageFormatControl = imageFormatCombo;
+ }
+ } else {
+ imageFormatControl = SWTUtil.createLabel(composite, DEFAULT_VALUE.getName());
+ }
+ final GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
+ imageFormatControl.setLayoutData(gridData);
+
+ }
+
+ /**
+ * {@inheritDoc} Configures the shell in preparation for opening this window in it.
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell(final Shell shell) {
+ super.configureShell(shell);
+ shell.setText(DIALOG_TITLE);
+ }
+
+ /**
+ * Hook method for restoring widget values to the values that they held last time this wizard was used to
+ * completion.
+ */
+ protected void restoreWidgetValues() {
+ IDialogSettings settings = getDialogSettings();
+ if (settings != null) {
+ String[] directoryNames = settings.getArray(DIALOG_SETTINGS_FOLDER);
+ if (directoryNames == null || directoryNames.length == 0) {
+ return;
+ }
+ folder = directoryNames[0];
+ for (String directoryName : directoryNames) {
+ folderText.add(directoryName);
+ }
+ }
+ }
+
+ /**
+ * Create the message group in the dialog used to display error messages.
+ *
+ * @param parent
+ * the parent widget
+ */
+ private void createMessageGroup(final Composite parent) {
+ final Composite composite = SWTUtil.createCompositeHorizontalFill(parent, 2, false);
+
+ messageImageLabel = new Label(composite, SWT.NONE);
+ messageImageLabel.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR));
+ messageImageLabel.setVisible(false);
+
+ messageLabel = new Label(composite, SWT.NONE);
+ final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
+ gridData.widthHint = WIDTH_MESSAGE;
+ messageLabel.setLayoutData(gridData);
+ messageLabel.setVisible(false);
+ }
+
+ /**
+ * Set the dialog into ok state mode. The error image (x) label and error label and made not visible and
+ * the ok button is enabled.
+ */
+ private void setDialogOKState() {
+ messageImageLabel.setVisible(false);
+ messageLabel.setVisible(false);
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ getButton(IDialogConstants.OK_ID).getShell().setDefaultButton(getButton(IDialogConstants.OK_ID));
+ }
+
+ /**
+ * Adds an entry to a history, while taking care of duplicate history items and excessively long
+ * histories. The assumption is made that all histories should be of length
+ * <code>WizardDataTransferPage.COMBO_HISTORY_LENGTH</code>.
+ *
+ * @param history
+ * the current history
+ * @param newEntry
+ * the entry to add to the history
+ * @return String[] tab of history
+ */
+ protected String[] addToHistory(String[] history, String newEntry) {
+ java.util.ArrayList<String> l = new java.util.ArrayList<String>(Arrays.asList(history));
+ addToHistory(l, newEntry);
+ String[] r = new String[l.size()];
+ l.toArray(r);
+ return r;
+ }
+
+ /**
+ * Adds an entry to a history, while taking care of duplicate history items and excessively long
+ * histories. The assumption is made that all histories should be of length
+ * <code>WizardDataTransferPage.COMBO_HISTORY_LENGTH</code>.
+ *
+ * @param history
+ * the current history
+ * @param newEntry
+ * the entry to add to the history
+ */
+ protected void addToHistory(List<String> history, String newEntry) {
+ history.remove(newEntry);
+ history.add(0, newEntry);
+ if (history.size() > COMBO_HISTORY_LENGTH) {
+ history.remove(COMBO_HISTORY_LENGTH);
+ }
+ }
+
+ /**
+ * Initialize the field listeners when all field are created.
+ */
+ protected void initListeners() {
+ folderText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(final ModifyEvent e) {
+ validateFolderText();
+ }
+ });
+ imageFormatCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ imageFormat = resolveImageFormat(imageFormatCombo.getSelectionIndex());
+ }
+ });
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareCopyToImageUtil.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareCopyToImageUtil.java
new file mode 100644
index 000000000..2883db91c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareCopyToImageUtil.java
@@ -0,0 +1,300 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.image;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.imageio.ImageIO;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator;
+import org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.image.ImageExporter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.sirius.common.tools.api.util.FileUtil;
+import org.eclipse.sirius.diagram.DDiagram;
+import org.eclipse.sirius.diagram.ui.tools.api.part.DiagramEditPartService;
+
+/**
+ * This class is used to manage the creation of images from DiagramEditPart, using the Sirius API.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class EMFCompareCopyToImageUtil extends DiagramEditPartService {
+
+ /**
+ * The diagram to be copied from the left side of the comparison in the ContentMergeViewer.
+ */
+ private DiagramEditPart leftDiagramEditPart;
+
+ /**
+ * The diagram to be copied from the right side of the comparison in the ContentMergeViewer.
+ */
+ private DiagramEditPart rightDiagramEditPart;
+
+ /**
+ * Decorators representing Phantoms and Markers in the ContentMergeViewer.
+ */
+ private Collection<AbstractDecorator> decorators;
+
+ /**
+ * Constructor.
+ *
+ * @param leftDEP
+ * The left {@link DiagramEditPart} to be copied.
+ * @param rightDEP
+ * The right {@link DiagramEditPart} to be copied.
+ * @param abstractDecorators
+ * The {@link AbstractDecorator}s of the ContentMergeViewer.
+ */
+ public EMFCompareCopyToImageUtil(DiagramEditPart leftDEP, DiagramEditPart rightDEP,
+ Collection<AbstractDecorator> abstractDecorators) {
+ leftDiagramEditPart = leftDEP;
+ rightDiagramEditPart = rightDEP;
+ decorators = abstractDecorators;
+ }
+
+ /**
+ * Get the left {@link DiagramEditPart} to be copied.
+ *
+ * @return the left {@link DiagramEditPart} to be copied.
+ */
+ public DiagramEditPart getLeftDiagramEditPart() {
+ return leftDiagramEditPart;
+ }
+
+ /**
+ * Get the right {@link DiagramEditPart} to be copied.
+ *
+ * @return the right {@link DiagramEditPart} to be copied.
+ */
+ public DiagramEditPart getRightDiagramEditPart() {
+ return rightDiagramEditPart;
+ }
+
+ /**
+ * Get the {@link AbstractDecorator}s of the ContentMergeViewer.
+ *
+ * @return the {@link AbstractDecorator}s of the ContentMergeViewer.
+ */
+ public Collection<AbstractDecorator> getDecorators() {
+ return decorators;
+ }
+
+ /**
+ * Only overridden to use {@link EMFCompareDiagramImageGenerator} instead of
+ * org.eclipse.sirius.diagram.ui.tools.internal.render.SiriusDiagramImageGenerator.
+ */
+ @Override
+ protected DiagramGenerator getDiagramGenerator(DiagramEditPart diagramEP, ImageFileFormat format) {
+ return new EMFCompareDiagramImageGenerator(diagramEP, decorators, getSide(diagramEP));
+ }
+
+ /**
+ * Used to find out which side of the MergeViewer the diagram belongs to.
+ *
+ * @param diagramEP
+ * the {@link DiagramEditPart} for which we are looking for the {@link MergeViewerSide}.
+ * @return the corresponding {@link MergeViewerSide}.
+ */
+ protected MergeViewerSide getSide(DiagramEditPart diagramEP) {
+ if (diagramEP.equals(leftDiagramEditPart)) {
+ return MergeViewerSide.LEFT;
+ } else {
+ return MergeViewerSide.RIGHT;
+ }
+ }
+
+ /**
+ * Executes the creation of all images. One image is created for the LeftDiagramEditPart, and another one
+ * for the RightDiagramEditPart, then the two images are joined together to return the image resulting
+ * from the diagram comparison.
+ *
+ * @param destination
+ * the destination folder chosen in the dialog.
+ * @param format
+ * the image format chosen in the dialog.
+ * @param monitor
+ * the progress monitor.
+ * @throws CoreException
+ * if the export of the image to a file has failed.
+ */
+ public void copyAllToImage(IPath destination, ImageFileFormat format, IProgressMonitor monitor)
+ throws CoreException {
+ IPath leftPath = getValidPath(destination, leftDiagramEditPart, format);
+ copyToImage(leftDiagramEditPart, leftPath, format, monitor);
+ IPath rightPath = getValidPath(destination, rightDiagramEditPart, format);
+ copyToImage(rightDiagramEditPart, rightPath, format, monitor);
+ try {
+ appendImages(destination, leftPath, rightPath, format, monitor);
+ } catch (CoreException | IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Used to recover the files of the two generated images, and create a new one with the two joined images.
+ *
+ * @param destination
+ * the destination folder for the resulting image.
+ * @param leftPath
+ * the path to the left image file.
+ * @param rightPath
+ * the path to the right image file
+ * @param format
+ * the image format.
+ * @param monitor
+ * the progress monitor.
+ * @throws CoreException
+ * if the export of the image to a file has failed.
+ * @throws IOException
+ * if the images on the left or right could not be read.
+ */
+ protected void appendImages(IPath destination, IPath leftPath, IPath rightPath, ImageFileFormat format,
+ IProgressMonitor monitor) throws CoreException, IOException {
+ IPath fileName = getValidPath(destination, null, format);
+
+ String exportFormat = ImageExporter.PNG_FILE;
+ java.awt.Image leftImage = ImageIO.read(leftPath.toFile());
+ java.awt.Image rightImage = ImageIO.read(rightPath.toFile());
+ if (leftImage instanceof BufferedImage && rightImage instanceof BufferedImage) {
+ java.awt.Image finalImage = joinImage((BufferedImage)leftImage, (BufferedImage)rightImage);
+ monitor.worked(1);
+ ImageExporter.exportToFile(fileName, (BufferedImage)finalImage, exportFormat, monitor,
+ format.getQuality());
+
+ }
+ List<IPath> filesToDelete = new ArrayList<IPath>();
+ filesToDelete.add(rightPath);
+ filesToDelete.add(leftPath);
+ deleteFiles(filesToDelete);
+ }
+
+ /**
+ * Used to delete files.
+ *
+ * @param filesToDelete
+ * the list of files to delete.
+ */
+ protected void deleteFiles(List<IPath> filesToDelete) {
+ for (IPath path : filesToDelete) {
+ path.toFile().delete();
+ }
+ }
+
+ /**
+ * Joins the two images and adds a separator.
+ *
+ * @param leftImage
+ * the image on the left.
+ * @param rightImage
+ * the image on the right.
+ * @return the new generated image.
+ */
+ protected Image joinImage(BufferedImage leftImage, BufferedImage rightImage) {
+
+ int separator = (leftImage.getWidth() + rightImage.getWidth()) / 100;
+ int wid = leftImage.getWidth() + rightImage.getWidth() + separator;
+ int height = Math.max(leftImage.getHeight(), rightImage.getHeight());
+
+ BufferedImage newImage = new BufferedImage(wid, height, leftImage.getType());
+
+ Graphics2D g2 = newImage.createGraphics();
+
+ Color oldColor = g2.getColor();
+ g2.setPaint(Color.WHITE);
+ g2.fillRect(0, 0, wid + separator, height);
+ g2.setPaint(Color.BLACK);
+ g2.fillRect(leftImage.getWidth(), 0, separator, height);
+ g2.setColor(oldColor);
+
+ g2.drawImage(leftImage, 0, 0, null);
+ g2.drawImage(rightImage, leftImage.getWidth() + separator, 0, null);
+
+ g2.dispose();
+ return newImage;
+ }
+
+ /**
+ * Get the {@link IPath} of the file to write. If the file already exists, it appends a number to its
+ * name.
+ *
+ * @param destination
+ * the folder where to write the file.
+ * @param diagramEP
+ * the {@link DiagramEditPart} used to retrieve the name of the diagram.
+ * @param format
+ * the file format.
+ * @return the path of the file to write.
+ */
+ protected IPath getValidPath(IPath destination, DiagramEditPart diagramEP, ImageFileFormat format) {
+ String filename = null;
+ String extension = format.getName().toLowerCase();
+ if (diagramEP != null) {
+ Diagram diagram = (Diagram)diagramEP.getModel();
+ DDiagram ddiagram = (DDiagram)diagram.getElement();
+ filename = ddiagram.getDescription().getName();
+ if (diagramEP == getLeftDiagramEditPart()) {
+ filename = "left_" + filename; //$NON-NLS-1$
+ } else if (diagramEP == getRightDiagramEditPart()) {
+ filename = "right_" + filename; //$NON-NLS-1$
+ }
+ } else {
+ filename = "Comparison_Image"; //$NON-NLS-1$
+ }
+ IPath filePath;
+ final StringBuffer file = new StringBuffer(filename).append('.').append(extension);
+
+ final String filenameWithExtension = validFilename(file.toString());
+ if (destination.append(filenameWithExtension).toFile().exists()) {
+ int version = 1;
+
+ do {
+ final String newFileName = validFilename(new StringBuffer(filename).append('_')
+ .append(String.valueOf(version)).append('.').append(extension).toString());
+ filePath = destination.append(newFileName);
+ version++;
+ } while (filePath.toFile().exists());
+ } else {
+ filePath = destination.append(filenameWithExtension);
+ }
+ return filePath;
+ }
+
+ /**
+ * Check if the filename is valid or not.
+ *
+ * @param filename
+ * the filename to check.
+ * @return a valid filename
+ */
+ protected String validFilename(String filename) {
+ final FileUtil util = new FileUtil(filename);
+ if (util.isValid()) {
+ return filename;
+ } else {
+ return util.getValidFilename();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareDiagramImageGenerator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareDiagramImageGenerator.java
new file mode 100644
index 000000000..e2a5b5e67
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.sirius/src/org/eclipse/emf/compare/diagram/ide/ui/sirius/internal/tools/image/EMFCompareDiagramImageGenerator.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.sirius.internal.tools.image;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.LayerManager;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.sirius.diagram.ui.tools.internal.render.SiriusDiagramImageGenerator;
+import org.eclipse.swt.graphics.Rectangle;
+
+/**
+ * This class is used to draw the {@link DiagramEditPart} in an image. Any existing Phantoms and Markers
+ * decorators in the ContentMergeViewer are added to the generated images.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class EMFCompareDiagramImageGenerator extends SiriusDiagramImageGenerator {
+
+ /**
+ * The {@link AbstractDecorator}s to draw.
+ */
+ private List<AbstractDecorator> decorators;
+
+ /**
+ * The layer on which the {@link AbstractDecorator}s are drawn.
+ */
+ private IFigure layer;
+
+ /**
+ * Constructor.
+ *
+ * @param dgrmEP
+ * the {@link DiagramEditPart} to draw.
+ * @param abstractDecorators
+ * the list of all {@link AbstractDecorator}s
+ * @param side
+ * the list of all decorators on each side of the ContentMergeViewer.
+ */
+ public EMFCompareDiagramImageGenerator(DiagramEditPart dgrmEP,
+ Collection<AbstractDecorator> abstractDecorators, MergeViewerSide side) {
+ super(dgrmEP);
+ decorators = new ArrayList<>();
+ for (AbstractDecorator decorator : abstractDecorators) {
+ if (decorator.getSide() == side) {
+ decorators.add(decorator);
+ }
+ }
+ layer = getLayer();
+ }
+
+ /**
+ * Get the layer on which the {@link DiagramEditPart} is represented on the ContentMergeViewer.
+ *
+ * @return the returns the layer corresponding to the {@link DiagramEditPart}.
+ */
+ protected IFigure getLayer() {
+ return LayerManager.Helper.find(getDiagramEditPart()).getLayer(LayerConstants.PRINTABLE_LAYERS);
+ }
+
+ /**
+ * {@inheritDoc} Overridden to draw the {@link AbstractDecorator}s.
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected void renderToGraphics(Graphics graphics, Point translateOffset, List editparts) {
+ super.renderToGraphics(graphics, translateOffset, editparts);
+ for (AbstractDecorator decorator : decorators) {
+ paintFigure(graphics, decorator.getFigure());
+ }
+ }
+
+ /**
+ * {@inheritDoc} Overridden to get the layer size.
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Rectangle calculateImageRectangle(List editparts) {
+ return new Rectangle(layer.getBounds().x, layer.getBounds().y, layer.getBounds().width,
+ layer.getBounds().height);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.checkstyle b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.checkstyle
new file mode 100644
index 000000000..2684ff12f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <local-check-config name="EMF Compare" location="/org.eclipse.emf.compare-parent/codeStyle/EMFCompareCheckstyle6Configuration.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="all" enabled="true" check-config-name="EMF Compare" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.classpath b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.classpath
new file mode 100644
index 000000000..3e5654f17
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/.project b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.project
index 4be23c5e5..4a23ac7d3 100644
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/.project
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.emf.compare.log4j.fragment</name>
+ <name>org.eclipse.emf.compare.diagram.ide.ui.tests</name>
<comment></comment>
<projects>
</projects>
@@ -22,7 +22,7 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..ddf357950
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ui.tests
+Bundle-Version: 3.4.3.qualifier
+Bundle-Vendor: %providerName
+Automatic-Module-Name: org.eclipse.emf.compare.diagram.ide.ui.tests
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Localization: plugin
+Require-Bundle: org.junit,
+ org.eclipse.compare,
+ org.mockito,
+ org.hamcrest,
+ org.eclipse.emf.compare,
+ org.eclipse.emf.compare.diagram.ide.ui,
+ org.eclipse.emf.compare.ide.ui,
+ org.eclipse.emf.compare.tests,
+ org.eclipse.emf.compare.rcp.ui,
+ org.eclipse.gmf.runtime.notation
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/about.html b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/about.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/build.properties
new file mode 100644
index 000000000..0fb7ee670
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = target/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/plugin.properties
new file mode 100644
index 000000000..0d9f2c42d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/plugin.properties
@@ -0,0 +1,12 @@
+################################################################################
+# Copyright (c) 2020 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare IDE UI Diagram integration Tests
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/pom.xml
new file mode 100644
index 000000000..2199fe87d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>emf.compare-test-parent</artifactId>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent/test-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>org.eclipse.emf.compare.diagram.ide.ui.tests</artifactId>
+ <version>3.4.3-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org/eclipse/emf/compare/diagram/ide/ui/tests/suite/AllTests.class</include>
+ </includes>
+ <useUIHarness>true</useUIHarness>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/TestBug560861.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/TestBug560861.java
new file mode 100644
index 000000000..46bf09947
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/TestBug560861.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This test is related to the bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=560861">560861</a>
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class TestBug560861 {
+
+ private Comparison comparison;
+
+ private CompareConfiguration cc;
+
+ private EMFCompareConfiguration emfcc;
+
+ private PhantomManager phantomManager;
+
+ private boolean mirrored;
+
+ /**
+ * Set up the two test models.
+ * <p>
+ * <ul>
+ * <li>left.nodes: In this model we have a tree nodes structured like this:
+ *
+ * <pre>
+ * Root - DeletedNode
+ * </pre>
+ *
+ * </li>
+ * <li>right.nodes: In this model "DeletedNode" has been deleted.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * A 2-way comparison between left.nodes (left input) and right.nodes (right input) gives the resulting
+ * comparison model:
+ * <li>A difference for the deletion of "DeletedNode".</li>
+ * </p>
+ *
+ * @throws IOException
+ */
+ @Before
+ public void setUp() throws IOException {
+ Bug560861InputData inputData = new Bug560861InputData();
+ Resource left = inputData.getResource("left.nodes"); //$NON-NLS-1$
+ Resource right = inputData.getResource("right.nodes"); //$NON-NLS-1$
+ Resource origin = null;
+
+ DefaultComparisonScope scope = new DefaultComparisonScope(left, right, origin);
+ comparison = EMFCompare.builder().build().compare(scope);
+ cc = new CompareConfiguration();
+ emfcc = new EMFCompareConfiguration(cc);
+ }
+
+ /**
+ * Tests that the side returned by the getTargetSide() method is correct before swapping.
+ */
+ @Test
+ public void testSideBeforeSwappingLeftAndRight() {
+ mirrored = false;
+ cc.setProperty(EMFCompareConfiguration.MIRRORED, mirrored);
+ Match match = comparison.getMatches().get(0).getSubmatches().get(0);
+ phantomManager = new PhantomManager(emfcc, null, null, null, null);
+ MergeViewerSide phantomSide = phantomManager.getTargetSide(match, null);
+
+ assertFalse(emfcc.isMirrored());
+ assertEquals(phantomSide, MergeViewerSide.RIGHT);
+ }
+
+ /**
+ * Tests that the side returned by the getTargetSide() method is correct after swapping.
+ */
+ @Test
+ public void testSideAfterSwappingLeftAndRight() {
+ mirrored = true;
+ cc.setProperty(EMFCompareConfiguration.MIRRORED, mirrored);
+ Match match = comparison.getMatches().get(0).getSubmatches().get(0);
+ phantomManager = new PhantomManager(emfcc, null, null, null, null);
+ MergeViewerSide phantomSide = phantomManager.getTargetSide(match, null);
+
+ assertTrue(emfcc.isMirrored());
+ assertEquals(phantomSide, MergeViewerSide.LEFT);
+ }
+
+ /**
+ * Input data for this bug.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+ public class Bug560861InputData extends AbstractInputData {
+
+ private static final String PATH_PREFIX = "data/_560861/"; //$NON-NLS-1$
+
+ public Resource getResource(String resourceName) throws IOException {
+ StringBuilder resourceURL = new StringBuilder(PATH_PREFIX);
+ resourceURL.append(resourceName);
+ return loadFromClassLoader(resourceURL.toString());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/left.nodes b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/left.nodes
new file mode 100644
index 000000000..b26ea1349
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/left.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_yWc_0JUeEeGiestbncRZoQ" name="Root">
+ <containmentRef1 xmi:id="_MPLmoN82EeO5ttKSQEjHCQ" name="DeletedNode"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/right.nodes b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/right.nodes
new file mode 100644
index 000000000..f249db886
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/data/_560861/right.nodes
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_yWc_0JUeEeGiestbncRZoQ" name="Root"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/AllTests.java
new file mode 100644
index 000000000..9401ad416
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/AllTests.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.tests.suite;
+
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.diagram.ide.ui.tests.suite.BugsTestSuite;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.util.NodesResourceFactoryImpl;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({BugsTestSuite.class })
+public class AllTests {
+
+ @BeforeClass
+ public static void fillEMFRegistries() {
+ EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
+
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("nodes", //$NON-NLS-1$
+ new NodesResourceFactoryImpl());
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/BugsTestSuite.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/BugsTestSuite.java
new file mode 100644
index 000000000..69ac11564
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.tests/src/org/eclipse/emf/compare/diagram/ide/ui/tests/suite/BugsTestSuite.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.tests.suite;
+
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.TestBug560861;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({TestBug560861.class })
+public class BugsTestSuite {
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
index 4727e9015..7cf67d1fa 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
@@ -25,5 +25,5 @@ Export-Package: org.eclipse.emf.compare.diagram.ide.ui.internal;x-internal:=true
org.eclipse.emf.compare.diagram.ide.ui.internal.preferences;x-internal:=true,
org.eclipse.emf.compare.diagram.ide.ui.internal.structuremergeviewer.filters
Bundle-Vendor: %providerName
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramDiffAccessorImpl.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramDiffAccessorImpl.java
index 1d4104ccf..4c57874a5 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramDiffAccessorImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramDiffAccessorImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 Obeo.
+ * Copyright (c) 2013, 2020 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,8 +70,9 @@ public class DiagramDiffAccessorImpl extends DiagramMatchAccessorImpl implements
Match eObjectMatch = fComparison.getMatch(obj);
if (eObjectMatch != null) {
return getEObject(eObjectMatch, side);
+ } else {
+ return super.getEObject(side);
}
- return null;
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/AbstractDecoratorManager.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/AbstractDecoratorManager.java
new file mode 100644
index 000000000..b6775046a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/AbstractDecoratorManager.java
@@ -0,0 +1,796 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import com.google.common.base.Predicate;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.DecoratorFigure;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.LayerManager;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListItemEditPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Decorator manager to create, hide or reveal decorator figures related to deleted or added graphical
+ * objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public abstract class AbstractDecoratorManager implements IDecoratorManager {
+
+ /**
+ * Decorator represented by a <code>figure</code> on a <code>layer</code>, from the given
+ * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in some
+ * cases.<br>
+ * The decorator is related to a <code>difference</code> and it is binded with the reference view and
+ * figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ public abstract class AbstractDecorator {
+
+ /** The reference <code>View</code> for this decorator. */
+ protected View fOriginView;
+
+ /** The reference <code>IFigure</code> for this decorator. */
+ protected IFigure fOriginFigure;
+
+ /** The <code>IFigure</code> representing this decorator. */
+ protected IFigure fFigure;
+
+ /**
+ * The <code>DecoratorFigure</code> representing this decorator. It references
+ * {@link AbstractDecorator#fFigure} through the accessor {@link DecoratorFigure#getMainFigure()}.
+ */
+ protected DecoratorFigure fDecoratorFigure;
+
+ /** The layer on which the <code>figure</code> has to be drawn. */
+ protected IFigure fLayer;
+
+ /** The side of the merge viewer on which the <code>figure</code> has to be drawn. */
+ protected MergeViewerSide fSide;
+
+ /** The difference related to this phantom. */
+ protected Diff fDifference;
+
+ /** The edit part of the figure representing this phantom. May be null. */
+ protected EditPart fEditPart;
+
+ /**
+ * Getter.
+ *
+ * @return the originView {@link AbstractDecorator#fOriginView}.
+ */
+ public View getOriginView() {
+ return fOriginView;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param originView
+ * {@link AbstractDecorator#fOriginView}.
+ */
+ public void setOriginView(View originView) {
+ this.fOriginView = originView;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the originFigure {@link AbstractDecorator#fOriginFigure}.
+ */
+ public IFigure getOriginFigure() {
+ return fOriginFigure;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param originFigure
+ * {@link AbstractDecorator#fOriginFigure}.
+ */
+ public void setOriginFigure(IFigure originFigure) {
+ this.fOriginFigure = originFigure;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the figure {@link AbstractDecorator#fFigure}.
+ */
+ public IFigure getFigure() {
+ return fFigure;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the decorator figure {@link AbstractDecorator#fDecoratorFigure}.
+ */
+ public DecoratorFigure getDecoratorFigure() {
+ return fDecoratorFigure;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param figure
+ * {@link AbstractDecorator#fFigure}.
+ */
+ public void setFigure(IFigure figure) {
+ this.fFigure = figure;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param figure
+ * {@link AbstractDecorator#fFigure}.
+ */
+ public void setDecoratorFigure(DecoratorFigure figure) {
+ this.fDecoratorFigure = figure;
+ setFigure(figure.getMainFigure());
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the layer {@link AbstractDecorator#fLayer}.
+ */
+ public IFigure getLayer() {
+ return fLayer;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param layer
+ * {@link AbstractDecorator#fLayer}.
+ */
+ public void setLayer(IFigure layer) {
+ this.fLayer = layer;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the side {@link AbstractDecorator#fSide}.
+ */
+ public MergeViewerSide getSide() {
+ return fSide;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param side
+ * {@link AbstractDecorator#fSide}.
+ */
+ public void setSide(MergeViewerSide side) {
+ this.fSide = side;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the difference {@link AbstractDecorator#fDifference}.
+ */
+ public Diff getDifference() {
+ return fDifference;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param difference
+ * {@link AbstractDecorator#fDifference}.
+ */
+ public void setDifference(Diff difference) {
+ this.fDifference = difference;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the editPart {@link AbstractDecorator#fEditPart}.
+ */
+ public EditPart getEditPart() {
+ return fEditPart;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param editPart
+ * {@link AbstractDecorator#fEditPart}.
+ */
+ public void setEditPart(EditPart editPart) {
+ this.fEditPart = editPart;
+ }
+
+ }
+
+ /**
+ * The compare configuration of the viewer.
+ */
+ private EMFCompareConfiguration fCompareConfiguration;
+
+ /**
+ * The left area of the viewer.
+ */
+ private DiagramMergeViewer fLeft;
+
+ /**
+ * The right area of the viewer.
+ */
+ private DiagramMergeViewer fRight;
+
+ /**
+ * The ancestor area of the viewer.
+ */
+ private DiagramMergeViewer fAncestor;
+
+ /**
+ * The color of the difference.
+ */
+ private ICompareColor fColor;
+
+ /**
+ * Constructor.
+ *
+ * @param compareConfiguration
+ * The compare configuration of the viewer.
+ * @param left
+ * The left area of the viewer.
+ * @param right
+ * The right area of the viewer.
+ * @param ancestor
+ * The ancestor area of the viewer.
+ * @param color
+ * The color of the difference.
+ */
+ protected AbstractDecoratorManager(EMFCompareConfiguration compareConfiguration, DiagramMergeViewer left,
+ DiagramMergeViewer right, DiagramMergeViewer ancestor, ICompareColor color) {
+ fCompareConfiguration = compareConfiguration;
+ fLeft = left;
+ fRight = right;
+ fAncestor = ancestor;
+ fColor = color;
+ }
+
+ /**
+ * Returns the compare configuration of this viewer.
+ *
+ * @return the compare configuration, never <code>null</code>
+ */
+ protected EMFCompareConfiguration getCompareConfiguration() {
+ return fCompareConfiguration;
+ }
+
+ /**
+ * Returns the left area of the viewer.
+ *
+ * @return the fLeft
+ */
+ protected DiagramMergeViewer getLeftMergeViewer() {
+ return fLeft;
+ }
+
+ /**
+ * Returns the right area of the viewer.
+ *
+ * @return the fRight
+ */
+ protected DiagramMergeViewer getRightMergeViewer() {
+ return fRight;
+ }
+
+ /**
+ * Returns the ancestor area of the viewer.
+ *
+ * @return the fAncestor
+ */
+ protected DiagramMergeViewer getAncestorMergeViewer() {
+ return fAncestor;
+ }
+
+ /**
+ * Return whether the input is a three-way comparison.
+ *
+ * @return whether the input is a three-way comparison
+ */
+ protected boolean isThreeWay() {
+ return getCompareConfiguration().getComparison().isThreeWay();
+ }
+
+ /**
+ * Returns the ICompareColor.
+ *
+ * @return the ICompareColor.
+ */
+ public ICompareColor getCompareColor() {
+ return fColor;
+ }
+
+ /**
+ * From a given difference, it hides the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ public void hideDecorators(Diff difference) {
+ Collection<? extends AbstractDecorator> oldDecorators = getDecorators(difference);
+ if (oldDecorators != null && !oldDecorators.isEmpty()
+ && getCompareConfiguration().getComparison() != null) {
+ handleDecorators(oldDecorators, false, true);
+ }
+ }
+
+ /**
+ * From a given difference, it reveals the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ public void revealDecorators(Diff difference) {
+
+ Collection<? super AbstractDecorator> decorators = (Collection<? super AbstractDecorator>)getDecorators(
+ difference);
+
+ // Create decorators only if they do not already exist and if the selected difference is a good
+ // candidate for that.
+ if ((decorators == null || decorators.isEmpty()) && isGoodCandidate(difference)) {
+
+ DiagramDiff diagramDiff = (DiagramDiff)difference;
+
+ List<View> referenveViews = getReferenceViews(diagramDiff);
+
+ for (View referenceView : referenveViews) {
+ IFigure referenceFigure = getFigure(referenceView);
+
+ if (referenceFigure != null) {
+ MergeViewerSide targetSide = getTargetSide(
+ getCompareConfiguration().getComparison().getMatch(referenceView), referenceView);
+
+ if (decorators == null) {
+ decorators = new ArrayList<AbstractDecorator>();
+ }
+
+ AbstractDecorator decorator = createAndRegisterDecorator(difference, referenceView,
+ referenceFigure, targetSide);
+ if (decorator != null) {
+ decorators.add(decorator);
+ }
+ }
+
+ }
+
+ }
+
+ // The selected difference is a good candidate and decorators exist for it
+ if (decorators != null && !decorators.isEmpty()) {
+ revealDecorators((Collection<? extends AbstractDecorator>)decorators);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public abstract void removeDecorators(Diff difference);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#removeAll()
+ */
+ public abstract void removeAll();
+
+ /**
+ * It reveals the given decorators.
+ *
+ * @param decorators
+ * The main decorators.
+ */
+ protected void revealDecorators(Collection<? extends AbstractDecorator> decorators) {
+ handleDecorators(decorators, true, true);
+ }
+
+ /**
+ * Get the figure related to the given view.
+ *
+ * @param view
+ * The view.
+ * @return the figure.
+ */
+ protected IFigure getFigure(View view) {
+ MergeViewerSide side = getSide(view);
+ GraphicalEditPart originEditPart = (GraphicalEditPart)getViewer(side).getEditPart(view);
+ if (originEditPart != null) {
+ return originEditPart.getFigure();
+ }
+ return null;
+ }
+
+ /**
+ * It manages the display of the given decorators.<br>
+ *
+ * @param decorators
+ * The decorators to handle.
+ * @param isAdd
+ * True if it has to be revealed, False otherwise.
+ * @param areMain
+ * It indicates if the given decorators to handle are considered as the main ones (the ones
+ * directly linked to the selected difference).
+ */
+ protected void handleDecorators(Collection<? extends AbstractDecorator> decorators, boolean isAdd,
+ boolean areMain) {
+ for (AbstractDecorator decorator : decorators) {
+ handleDecorator(decorator, isAdd, areMain);
+ }
+ }
+
+ /**
+ * It manages the display of the given decorator.
+ *
+ * @param decorator
+ * The decorator to handle.
+ * @param isAdd
+ * True if it has to be revealed, False otherwise.
+ * @param isMain
+ * It indicates if the given decorator to handle is considered as the main one (the one
+ * directly linked to the selected difference).
+ */
+ protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
+ IFigure layer = decorator.getLayer();
+ IFigure figure = decorator.getFigure();
+ if (isAdd) {
+ handleAddDecorator(decorator, layer, figure, isMain);
+ } else if (layer.getChildren().contains(figure)) {
+ handleDeleteDecorator(decorator, layer, figure);
+ }
+ }
+
+ /**
+ * It manages the reveal of the given decorator.
+ *
+ * @param decorator
+ * The decorator.
+ * @param parent
+ * The parent figure which has to get the figure to reveal (<code>toAdd</code>)
+ * @param toAdd
+ * The figure to reveal.
+ * @param isMain
+ * It indicates if the given decorator to reveal is considered as the main one (the one
+ * directly linked to the selected difference).
+ */
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ if (decorator.getEditPart() != null) {
+ decorator.getEditPart().activate();
+ }
+ if (!parent.getChildren().contains(toAdd)) {
+ parent.add(toAdd);
+ }
+ }
+
+ /**
+ * It manages the hiding of the given decorator.
+ *
+ * @param decorator
+ * The decorator.
+ * @param parent
+ * The parent figure which has to get the figure to hide (<code>toDelete</code>)
+ * @param toDelete
+ * The figure to hide.
+ */
+ protected void handleDeleteDecorator(AbstractDecorator decorator, IFigure parent, IFigure toDelete) {
+ if (decorator.getEditPart() != null) {
+ decorator.getEditPart().deactivate();
+ }
+ if (parent.getChildren().contains(toDelete)) {
+ parent.remove(toDelete);
+ }
+ }
+
+ /**
+ * It checks if the given difference is a good candidate to manage decorators.<br>
+ *
+ * @see {@link PhantomManager#goodCandidate()}.
+ * @param difference
+ * The difference.
+ * @return True if it is a good candidate, False otherwise.
+ */
+ private boolean isGoodCandidate(Diff difference) {
+ return goodCandidate().apply(difference);
+ }
+
+ /**
+ * Get the layer on the given side, from the reference view.<br>
+ *
+ * @see @ link {@link PhantomManager#getIDLayer(View)}.
+ * @param referenceView
+ * The reference view.
+ * @param side
+ * The side where the layer has to be found.
+ * @return The layer figure or null if the edit part of the diagram is not found.
+ */
+ protected IFigure getLayer(View referenceView, MergeViewerSide side) {
+ Diagram referenceDiagram = referenceView.getDiagram();
+ Diagram targetDiagram = (Diagram)getMatchView(referenceDiagram, getEffectiveSide(side));
+ DiagramMergeViewer targetViewer = getViewer(side);
+ EditPart editPart = targetViewer.getEditPart(targetDiagram);
+ if (editPart != null) {
+ return LayerManager.Helper.find(editPart).getLayer(getIDLayer(referenceView));
+ }
+ return null;
+ }
+
+ /**
+ * Get the layer ID to use from the reference view.<br>
+ * If the reference view is an edge, it is the {@link LayerConstants.CONNECTION_LAYER} which is used,
+ * {@link LayerConstants.SCALABLE_LAYERS} otherwise.
+ *
+ * @param referenceView
+ * The reference view.
+ * @return The ID of the layer.
+ */
+ protected Object getIDLayer(View referenceView) {
+ if (referenceView instanceof Edge) {
+ return LayerConstants.CONNECTION_LAYER;
+ } else {
+ return LayerConstants.SCALABLE_LAYERS;
+ }
+ }
+
+ /**
+ * It translates the coordinates of the given bounds, from the reference figure and the root of this one,
+ * to absolute coordinates.
+ *
+ * @param referenceFigure
+ * The reference figure.
+ * @param rootReferenceFigure
+ * The root of the reference figure.
+ * @param boundsToTranslate
+ * The bounds to translate.
+ */
+ protected void translateCoordinates(IFigure referenceFigure, IFigure rootReferenceFigure,
+ Rectangle boundsToTranslate) {
+ IFigure referenceParentFigure = referenceFigure.getParent();
+ if (referenceParentFigure != null && referenceFigure != rootReferenceFigure) {
+ // rootReferenceFigure may be located to (-x,0)... We consider that the root reference is
+ // always (0,0)
+ if (referenceParentFigure.isCoordinateSystem() && referenceParentFigure != rootReferenceFigure) {
+ boundsToTranslate.x += referenceParentFigure.getBounds().x;
+ boundsToTranslate.y += referenceParentFigure.getBounds().y;
+ }
+ translateCoordinates(referenceParentFigure, rootReferenceFigure, boundsToTranslate);
+ }
+ }
+
+ /**
+ * It checks that the given view represents an element of a list.
+ *
+ * @param view
+ * The view.
+ * @return True it it is an element of a list.
+ */
+ protected boolean isNodeList(View view) {
+ DiagramMergeViewer viewer = getViewer(getSide(view));
+ EditPart part = viewer.getEditPart(view);
+ return isNodeList(part);
+ }
+
+ /**
+ * It checks that the given part represents an element of a list.
+ *
+ * @param part
+ * The part.
+ * @return True it it represents an element of a list.
+ */
+ private boolean isNodeList(EditPart part) {
+ return part instanceof ListItemEditPart || isInListContainer(part);
+
+ }
+
+ /**
+ * It checks that the given part is in one representing a list container.
+ *
+ * @param part
+ * The part.
+ * @return True it it is in a part representing a list container.
+ */
+ private boolean isInListContainer(EditPart part) {
+ EditPart parent = part.getParent();
+ while (parent != null) {
+ if (parent instanceof ListCompartmentEditPart) {
+ return true;
+ }
+ parent = parent.getParent();
+ }
+ return false;
+ }
+
+ /**
+ * Utility method to retrieve the {@link DiagramMergeViewer} from the given side.
+ *
+ * @param side
+ * The side to focus.
+ * @return The viewer.
+ */
+ public DiagramMergeViewer getViewer(MergeViewerSide side) {
+ DiagramMergeViewer result = null;
+ switch (side) {
+ case LEFT:
+ result = getLeftMergeViewer();
+ break;
+ case RIGHT:
+ result = getRightMergeViewer();
+ break;
+ case ANCESTOR:
+ result = getAncestorMergeViewer();
+ break;
+ default:
+ }
+ return result;
+ }
+
+ /**
+ * Utility method to know the side where is located the given view.
+ *
+ * @param view
+ * The view.
+ * @return The side of the view.
+ */
+ public MergeViewerSide getSide(View view) {
+ MergeViewerSide result = null;
+ Match match = getCompareConfiguration().getComparison().getMatch(view);
+ if (match.getLeft() == view) {
+ result = MergeViewerSide.LEFT;
+ } else if (match.getRight() == view) {
+ result = MergeViewerSide.RIGHT;
+ } else if (match.getOrigin() == view) {
+ result = MergeViewerSide.ANCESTOR;
+ }
+ return getEffectiveSide(result);
+ }
+
+ /**
+ * Returns the effective side taking into account {@link CompareConfiguration#isMirrored()} to switch left
+ * and right.
+ *
+ * @param side
+ * The side where the potential matching object has to be retrieved.
+ * @return the effective side with respect to mirroring.
+ */
+ protected MergeViewerSide getEffectiveSide(MergeViewerSide side) {
+ if (side != null && getCompareConfiguration().isMirrored()) {
+ return side.opposite();
+ }
+ return side;
+ }
+
+ /**
+ * Utility method to get the object matching with the given one, to the given side.
+ *
+ * @param object
+ * The object as base of the lookup.
+ * @param side
+ * The side where the potential matching object has to be retrieved.
+ * @return The matching object.
+ */
+ public EObject getMatchView(EObject object, MergeViewerSide side) {
+ Match match = getCompareConfiguration().getComparison().getMatch(object);
+ return getMatchView(match, side);
+ }
+
+ /**
+ * Utility method to get the object in the given side from the given match.
+ *
+ * @param match
+ * The match.
+ * @param side
+ * The side where the potential matching object has to be retrieved.
+ * @return The matching object.
+ */
+ private EObject getMatchView(Match match, MergeViewerSide side) {
+ EObject result = null;
+ switch (side) {
+ case LEFT:
+ result = match.getLeft();
+ break;
+ case RIGHT:
+ result = match.getRight();
+ break;
+ case ANCESTOR:
+ result = match.getOrigin();
+ break;
+ default:
+ }
+ return result;
+ }
+
+ /**
+ * Get the predicate to know the differences concerned by the display of decorators.
+ *
+ * @return The predicate.
+ */
+ protected abstract Predicate<Diff> goodCandidate();
+
+ /**
+ * Get the views which have to be used as reference to build the related decorators from the given
+ * difference of the value concerned by the difference.<br>
+ *
+ * @param difference
+ * The difference.
+ * @return The list of reference views.
+ */
+ protected abstract List<View> getReferenceViews(DiagramDiff difference);
+
+ /**
+ * Get the side where decorators have to be drawn, according to the given reference view and its
+ * match.<br>
+ *
+ * @param match
+ * The match of the reference view.
+ * @param referenceView
+ * The reference view.
+ * @return The side for phantoms.
+ */
+ protected abstract MergeViewerSide getTargetSide(Match match, View referenceView);
+
+ /**
+ * It creates new decorators and registers them.
+ *
+ * @param diff
+ * The related difference used as index for the main decorator.
+ * @param referenceView
+ * The reference view as base for creation of the decorator.
+ * @param referenceFigure
+ * The reference figure as base for creation of the decorator.
+ * @param targetSide
+ * The side where the decorator has to be created.
+ * @return The list of main decorators.
+ */
+ protected abstract AbstractDecorator createAndRegisterDecorator(Diff diff, View referenceView,
+ IFigure referenceFigure, MergeViewerSide targetSide);
+
+ /**
+ * Get the main decorators related to the given difference.
+ *
+ * @param difference
+ * The difference.
+ * @return The list of main decorators.
+ */
+ protected abstract Collection<? extends AbstractDecorator> getDecorators(Diff difference);
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DecoratorsManager.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DecoratorsManager.java
new file mode 100644
index 000000000..51f4ecca4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DecoratorsManager.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator;
+import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
+
+/**
+ * Decorator manager to create, hide or reveal all decorator figures related to graphical changes.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class DecoratorsManager implements IDecoratorManager {
+ /** Phantoms manager. */
+ private IDecoratorManager fPhantomManager;
+
+ /** Markers manager. */
+ private IDecoratorManager fMarkerManager;
+
+ /**
+ * Constructor.
+ *
+ * @param compareConfiguration
+ * The compare configuration of the viewer.
+ * @param left
+ * The left area of the viewer.
+ * @param right
+ * The right area of the viewer.
+ * @param ancestor
+ * The ancestor area of the viewer.
+ * @param color
+ * The color of the difference.
+ */
+ public DecoratorsManager(EMFCompareConfiguration compareConfiguration, DiagramMergeViewer left,
+ DiagramMergeViewer right, DiagramMergeViewer ancestor, ICompareColor color) {
+ fPhantomManager = new PhantomManager(compareConfiguration, left, right, ancestor, color);
+ fMarkerManager = new MarkerManager(compareConfiguration, left, right, ancestor, color);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#hideDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public void hideDecorators(Diff difference) {
+ fMarkerManager.hideDecorators(difference);
+ fPhantomManager.hideDecorators(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#revealDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public void revealDecorators(Diff difference) {
+ fMarkerManager.revealDecorators(difference);
+ fPhantomManager.revealDecorators(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ fMarkerManager.hideAll();
+ fPhantomManager.hideAll();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public void removeDecorators(Diff difference) {
+ fMarkerManager.removeDecorators(difference);
+ fPhantomManager.removeDecorators(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#removeAll()
+ */
+ public void removeAll() {
+ fMarkerManager.removeAll();
+ fPhantomManager.removeAll();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#getAllDecorators()
+ */
+ public Collection<AbstractDecorator> getAllDecorators() {
+ Collection<AbstractDecorator> decorators = new ArrayList<AbstractDecorator>();
+ decorators.addAll(fMarkerManager.getAllDecorators());
+ decorators.addAll(fPhantomManager.getAllDecorators());
+ return decorators;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
index a8a49e858..6e49ea375 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2018 Obeo and others.
+ * Copyright (c) 2013, 2020 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,80 +13,32 @@
*******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
-import static com.google.common.base.Predicates.and;
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.base.Predicates.or;
import static org.eclipse.emf.compare.merge.AbstractMerger.isInTerminalState;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueIs;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Multimap;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.EventObject;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
import java.util.ResourceBundle;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.DifferenceState;
-import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.command.impl.CopyCommand;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramDiffAccessor;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
-import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.DecoratorFigure;
-import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.EdgeFigure;
-import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeFigure;
-import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeListFigure;
-import org.eclipse.emf.compare.diagram.internal.extensions.CoordinatesChange;
import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
-import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
-import org.eclipse.emf.compare.diagram.internal.extensions.Show;
import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree.TreeContentMergeViewerContentProvider;
-import org.eclipse.emf.compare.internal.utils.DiffUtil;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.LayerManager;
import org.eclipse.gef.editparts.ZoomListener;
import org.eclipse.gef.editparts.ZoomManager;
import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListItemEditPart;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
@@ -104,1642 +56,12 @@ import org.eclipse.ui.PlatformUI;
public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer implements ZoomListener {
/**
- * Interface for the management of decorators.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private interface IDecoratorManager {
-
- /**
- * It hides the revealed decorators.
- */
- void hideAll();
-
- /**
- * From a given difference, it hides the related decorators.
- *
- * @param difference
- * The difference.
- */
- void hideDecorators(Diff difference);
-
- /**
- * From a given difference, it reveals the related decorators.
- *
- * @param difference
- * The difference.
- */
- void revealDecorators(Diff difference);
-
- /**
- * From a given difference, it removes the related decorators from cash.
- *
- * @param difference
- * The difference.
- */
- void removeDecorators(Diff difference);
-
- /**
- * It removes all the displayed decorators from cache.
- */
- void removeAll();
- }
-
- /**
- * Decorator manager to create, hide or reveal decorator figures related to deleted or added graphical
- * objects.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private abstract class AbstractDecoratorManager implements IDecoratorManager {
-
- /**
- * Decorator represented by a <code>figure</code> on a <code>layer</code>, from the given
- * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
- * some cases.<br>
- * The decorator is related to a <code>difference</code> and it is binded with the reference view and
- * figure.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- protected abstract class AbstractDecorator {
-
- /** The reference <code>View</code> for this decorator. */
- protected View fOriginView;
-
- /** The reference <code>IFigure</code> for this decorator. */
- protected IFigure fOriginFigure;
-
- /** The <code>IFigure</code> representing this decorator. */
- protected IFigure fFigure;
-
- /**
- * The <code>DecoratorFigure</code> representing this decorator. It references
- * {@link AbstractDecorator#fFigure} through the accessor {@link DecoratorFigure#getMainFigure()}.
- */
- protected DecoratorFigure fDecoratorFigure;
-
- /** The layer on which the <code>figure</code> has to be drawn. */
- protected IFigure fLayer;
-
- /** The side of the merge viewer on which the <code>figure</code> has to be drawn. */
- protected MergeViewerSide fSide;
-
- /** The difference related to this phantom. */
- protected Diff fDifference;
-
- /** The edit part of the figure representing this phantom. May be null. */
- protected EditPart fEditPart;
-
- /**
- * Getter.
- *
- * @return the originView {@link AbstractDecorator#fOriginView}.
- */
- public View getOriginView() {
- return fOriginView;
- }
-
- /**
- * Setter.
- *
- * @param originView
- * {@link AbstractDecorator#fOriginView}.
- */
- public void setOriginView(View originView) {
- this.fOriginView = originView;
- }
-
- /**
- * Getter.
- *
- * @return the originFigure {@link AbstractDecorator#fOriginFigure}.
- */
- public IFigure getOriginFigure() {
- return fOriginFigure;
- }
-
- /**
- * Setter.
- *
- * @param originFigure
- * {@link AbstractDecorator#fOriginFigure}.
- */
- public void setOriginFigure(IFigure originFigure) {
- this.fOriginFigure = originFigure;
- }
-
- /**
- * Getter.
- *
- * @return the figure {@link AbstractDecorator#fFigure}.
- */
- public IFigure getFigure() {
- return fFigure;
- }
-
- /**
- * Getter.
- *
- * @return the decorator figure {@link AbstractDecorator#fDecoratorFigure}.
- */
- public DecoratorFigure getDecoratorFigure() {
- return fDecoratorFigure;
- }
-
- /**
- * Setter.
- *
- * @param figure
- * {@link AbstractDecorator#fFigure}.
- */
- public void setFigure(IFigure figure) {
- this.fFigure = figure;
- }
-
- /**
- * Setter.
- *
- * @param figure
- * {@link AbstractDecorator#fFigure}.
- */
- public void setDecoratorFigure(DecoratorFigure figure) {
- this.fDecoratorFigure = figure;
- setFigure(figure.getMainFigure());
- }
-
- /**
- * Getter.
- *
- * @return the layer {@link AbstractDecorator#fLayer}.
- */
- public IFigure getLayer() {
- return fLayer;
- }
-
- /**
- * Setter.
- *
- * @param layer
- * {@link AbstractDecorator#fLayer}.
- */
- public void setLayer(IFigure layer) {
- this.fLayer = layer;
- }
-
- /**
- * Getter.
- *
- * @return the side {@link AbstractDecorator#fSide}.
- */
- public MergeViewerSide getSide() {
- return fSide;
- }
-
- /**
- * Setter.
- *
- * @param side
- * {@link AbstractDecorator#fSide}.
- */
- public void setSide(MergeViewerSide side) {
- this.fSide = side;
- }
-
- /**
- * Getter.
- *
- * @return the difference {@link AbstractDecorator#fDifference}.
- */
- public Diff getDifference() {
- return fDifference;
- }
-
- /**
- * Setter.
- *
- * @param difference
- * {@link AbstractDecorator#fDifference}.
- */
- public void setDifference(Diff difference) {
- this.fDifference = difference;
- }
-
- /**
- * Getter.
- *
- * @return the editPart {@link AbstractDecorator#fEditPart}.
- */
- public EditPart getEditPart() {
- return fEditPart;
- }
-
- /**
- * Setter.
- *
- * @param editPart
- * {@link AbstractDecorator#fEditPart}.
- */
- public void setEditPart(EditPart editPart) {
- this.fEditPart = editPart;
- }
-
- }
-
- /**
- * From a given difference, it hides the related decorators.
- *
- * @param difference
- * The difference.
- */
- public void hideDecorators(Diff difference) {
- Collection<? extends AbstractDecorator> oldDecorators = getDecorators(difference);
- if (oldDecorators != null && !oldDecorators.isEmpty()
- && getCompareConfiguration().getComparison() != null) {
- handleDecorators(oldDecorators, false, true);
- }
- }
-
- /**
- * From a given difference, it reveals the related decorators.
- *
- * @param difference
- * The difference.
- */
- public void revealDecorators(Diff difference) {
-
- Collection<? super AbstractDecorator> decorators = (Collection<? super AbstractDecorator>)getDecorators(
- difference);
-
- // Create decorators only if they do not already exist and if the selected difference is a good
- // candidate for that.
- if ((decorators == null || decorators.isEmpty()) && isGoodCandidate(difference)) {
-
- DiagramDiff diagramDiff = (DiagramDiff)difference;
-
- List<View> referenveViews = getReferenceViews(diagramDiff);
-
- for (View referenceView : referenveViews) {
- IFigure referenceFigure = getFigure(referenceView);
-
- if (referenceFigure != null) {
- MergeViewerSide targetSide = getTargetSide(
- getCompareConfiguration().getComparison().getMatch(referenceView),
- referenceView);
-
- if (decorators == null) {
- decorators = new ArrayList<AbstractDecorator>();
- }
-
- AbstractDecorator decorator = createAndRegisterDecorator(difference, referenceView,
- referenceFigure, targetSide);
- if (decorator != null) {
- decorators.add(decorator);
- }
- }
-
- }
-
- }
-
- // The selected difference is a good candidate and decorators exist for it
- if (decorators != null && !decorators.isEmpty()) {
- revealDecorators((Collection<? extends AbstractDecorator>)decorators);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
- */
- public abstract void removeDecorators(Diff difference);
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#removeAll()
- */
- public abstract void removeAll();
-
- /**
- * It reveals the given decorators.
- *
- * @param decorators
- * The main decorators.
- */
- protected void revealDecorators(Collection<? extends AbstractDecorator> decorators) {
- handleDecorators(decorators, true, true);
- }
-
- /**
- * Get the figure related to the given view.
- *
- * @param view
- * The view.
- * @return the figure.
- */
- protected IFigure getFigure(View view) {
- MergeViewerSide side = getSide(view);
- GraphicalEditPart originEditPart = (GraphicalEditPart)getViewer(side).getEditPart(view);
- if (originEditPart != null) {
- return originEditPart.getFigure();
- }
- return null;
- }
-
- /**
- * It manages the display of the given decorators.<br>
- *
- * @param decorators
- * The decorators to handle.
- * @param isAdd
- * True if it has to be revealed, False otherwise.
- * @param areMain
- * It indicates if the given decorators to handle are considered as the main ones (the ones
- * directly linked to the selected difference).
- */
- protected void handleDecorators(Collection<? extends AbstractDecorator> decorators, boolean isAdd,
- boolean areMain) {
- for (AbstractDecorator decorator : decorators) {
- handleDecorator(decorator, isAdd, areMain);
- }
- }
-
- /**
- * It manages the display of the given decorator.
- *
- * @param decorator
- * The decorator to handle.
- * @param isAdd
- * True if it has to be revealed, False otherwise.
- * @param isMain
- * It indicates if the given decorator to handle is considered as the main one (the one
- * directly linked to the selected difference).
- */
- protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
- IFigure layer = decorator.getLayer();
- IFigure figure = decorator.getFigure();
- if (isAdd) {
- handleAddDecorator(decorator, layer, figure, isMain);
- } else if (layer.getChildren().contains(figure)) {
- handleDeleteDecorator(decorator, layer, figure);
- }
- }
-
- /**
- * It manages the reveal of the given decorator.
- *
- * @param decorator
- * The decorator.
- * @param parent
- * The parent figure which has to get the figure to reveal (<code>toAdd</code>)
- * @param toAdd
- * The figure to reveal.
- * @param isMain
- * It indicates if the given decorator to reveal is considered as the main one (the one
- * directly linked to the selected difference).
- */
- protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
- boolean isMain) {
- if (decorator.getEditPart() != null) {
- decorator.getEditPart().activate();
- }
- if (!parent.getChildren().contains(toAdd)) {
- parent.add(toAdd);
- }
- }
-
- /**
- * It manages the hiding of the given decorator.
- *
- * @param decorator
- * The decorator.
- * @param parent
- * The parent figure which has to get the figure to hide (<code>toDelete</code>)
- * @param toDelete
- * The figure to hide.
- */
- protected void handleDeleteDecorator(AbstractDecorator decorator, IFigure parent, IFigure toDelete) {
- if (decorator.getEditPart() != null) {
- decorator.getEditPart().deactivate();
- }
- if (parent.getChildren().contains(toDelete)) {
- parent.remove(toDelete);
- }
- }
-
- /**
- * It checks if the given difference is a good candidate to manage decorators.<br>
- *
- * @see {@link PhantomManager#goodCandidate()}.
- * @param difference
- * The difference.
- * @return True if it is a good candidate, False otherwise.
- */
- private boolean isGoodCandidate(Diff difference) {
- return goodCandidate().apply(difference);
- }
-
- /**
- * Get the layer on the given side, from the reference view.<br>
- *
- * @see @ link PhantomManager#getIDLayer(View)} .
- * @param referenceView
- * The reference view.
- * @param side
- * The side where the layer has to be found.
- * @return The layer figure or null if the edit part of the diagram is not found.
- */
- protected IFigure getLayer(View referenceView, MergeViewerSide side) {
- Diagram referenceDiagram = referenceView.getDiagram();
- Diagram targetDiagram = (Diagram)getMatchView(referenceDiagram, getEffectiveSide(side));
- DiagramMergeViewer targetViewer = getViewer(side);
- EditPart editPart = targetViewer.getEditPart(targetDiagram);
- if (editPart != null) {
- return LayerManager.Helper.find(editPart).getLayer(getIDLayer(referenceView));
- }
- return null;
- }
-
- /**
- * Get the layer ID to use from the reference view.<br>
- * If the reference view is an edge, it is the {@link LayerConstants.CONNECTION_LAYER} which is used,
- * {@link LayerConstants.SCALABLE_LAYERS} otherwise.
- *
- * @param referenceView
- * The reference view.
- * @return The ID of the layer.
- */
- protected Object getIDLayer(View referenceView) {
- if (referenceView instanceof Edge) {
- return LayerConstants.CONNECTION_LAYER;
- } else {
- return LayerConstants.SCALABLE_LAYERS;
- }
- }
-
- /**
- * It translates the coordinates of the given bounds, from the reference figure and the root of this
- * one, to absolute coordinates.
- *
- * @param referenceFigure
- * The reference figure.
- * @param rootReferenceFigure
- * The root of the reference figure.
- * @param boundsToTranslate
- * The bounds to translate.
- */
- protected void translateCoordinates(IFigure referenceFigure, IFigure rootReferenceFigure,
- Rectangle boundsToTranslate) {
- IFigure referenceParentFigure = referenceFigure.getParent();
- if (referenceParentFigure != null && referenceFigure != rootReferenceFigure) {
- // rootReferenceFigure may be located to (-x,0)... We consider that the root reference is
- // always (0,0)
- if (referenceParentFigure.isCoordinateSystem()
- && referenceParentFigure != rootReferenceFigure) {
- boundsToTranslate.x += referenceParentFigure.getBounds().x;
- boundsToTranslate.y += referenceParentFigure.getBounds().y;
- }
- translateCoordinates(referenceParentFigure, rootReferenceFigure, boundsToTranslate);
- }
- }
-
- /**
- * It checks that the given view represents an element of a list.
- *
- * @param view
- * The view.
- * @return True it it is an element of a list.
- */
- protected boolean isNodeList(View view) {
- DiagramMergeViewer viewer = getViewer(getSide(view));
- EditPart part = viewer.getEditPart(view);
- return isNodeList(part);
- }
-
- /**
- * It checks that the given part represents an element of a list.
- *
- * @param part
- * The part.
- * @return True it it represents an element of a list.
- */
- private boolean isNodeList(EditPart part) {
- return part instanceof ListItemEditPart || isInListContainer(part);
-
- }
-
- /**
- * It checks that the given part is in one representing a list container.
- *
- * @param part
- * The part.
- * @return True it it is in a part representing a list container.
- */
- private boolean isInListContainer(EditPart part) {
- EditPart parent = part.getParent();
- while (parent != null) {
- if (parent instanceof ListCompartmentEditPart) {
- return true;
- }
- parent = parent.getParent();
- }
- return false;
- }
-
- /**
- * Get the predicate to know the differences concerned by the display of decorators.
- *
- * @return The predicate.
- */
- protected abstract Predicate<Diff> goodCandidate();
-
- /**
- * Get the views which have to be used as reference to build the related decorators from the given
- * difference of the value concerned by the difference.<br>
- *
- * @param difference
- * The difference.
- * @return The list of reference views.
- */
- protected abstract List<View> getReferenceViews(DiagramDiff difference);
-
- /**
- * Get the side where decorators have to be drawn, according to the given reference view and its
- * match.<br>
- *
- * @param match
- * The match of the reference view.
- * @param referenceView
- * The reference view.
- * @return The side for phantoms.
- */
- protected abstract MergeViewerSide getTargetSide(Match match, View referenceView);
-
- /**
- * It creates new decorators and registers them.
- *
- * @param diff
- * The related difference used as index for the main decorator.
- * @param referenceView
- * The reference view as base for creation of the decorator.
- * @param referenceFigure
- * The reference figure as base for creation of the decorator.
- * @param targetSide
- * The side where the decorator has to be created.
- * @return The list of main decorators.
- */
- protected abstract AbstractDecorator createAndRegisterDecorator(Diff diff, View referenceView,
- IFigure referenceFigure, MergeViewerSide targetSide);
-
- /**
- * Get the main decorators related to the given difference.
- *
- * @param difference
- * The difference.
- * @return The list of main decorators.
- */
- protected abstract Collection<? extends AbstractDecorator> getDecorators(Diff difference);
-
- }
-
- /**
- * Phantom manager to create, hide or reveal phantom figures related to deleted or added graphical
- * objects.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private class PhantomManager extends AbstractDecoratorManager {
-
- /**
- * Phantom represented by a <code>figure</code> on a <code>layer</code>, from the given
- * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
- * some cases.<br>
- * The phantom is related to a <code>difference</code> and it is binded with the reference view and
- * figure.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private class Phantom extends AbstractDecorator {
-
- /**
- * Constructor.
- *
- * @param layer
- * {@link Phantom#fLayer}.
- * @param side
- * {@link Phantom#fSide}.
- * @param originView
- * {@link Phantom#fOriginView}.
- * @param originFigure
- * {@link Phantom#fOriginFigure}.
- * @param diff
- * {@link Phantom#fDifference}.
- */
- Phantom(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure, Diff diff) {
- setLayer(layer);
- setSide(side);
- setOriginView(originView);
- setOriginFigure(originFigure);
- setDifference(diff);
- }
-
- /**
- * Get the decorator dependencies of this one. The dependencies are the decorator ancestors plus
- * the extremities of an edge decorator.<br>
- * DO NOT CALL in an iterate of {@link PhantomManager#fPhantomRegistry}
- *
- * @return The list of found decorators.
- */
- public List<? extends AbstractDecorator> getDependencies() {
- List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
- result.addAll(getAncestors());
- if (fOriginView instanceof Edge) {
- View source = ((Edge)fOriginView).getSource();
- View target = ((Edge)fOriginView).getTarget();
- result.addAll(getOrCreateRelatedPhantoms(source, fSide));
- result.addAll(getOrCreateRelatedPhantoms(target, fSide));
- }
- return result;
- }
-
- /**
- * Get the ancestor decorators of this one.
- *
- * @return The list of the ancestors.
- */
- private List<? extends AbstractDecorator> getAncestors() {
- List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
- EObject parentOriginView = fOriginView.eContainer();
- while (parentOriginView != null) {
- result.addAll(getOrCreateRelatedPhantoms(parentOriginView, fSide));
- parentOriginView = parentOriginView.eContainer();
- }
- return result;
- }
- }
-
- /** Registry of created phantoms, indexed by difference. */
- private final Map<Diff, Phantom> fPhantomRegistry = new HashMap<Diff, Phantom>();
-
- /** Predicate witch checks that the given difference is an ADD or DELETE of a graphical object. */
- private Predicate<Diff> isAddOrDelete = and(instanceOf(DiagramDiff.class),
- or(ofKind(DifferenceKind.ADD), ofKind(DifferenceKind.DELETE)));
-
- /** Predicate witch checks that the given difference is a HIDE or REVEAL of a graphical object. */
- private Predicate<Diff> isHideOrReveal = or(instanceOf(Show.class), instanceOf(Hide.class));
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.
- * DiagramContentMergeViewer.AbstractDecoratorManager#goodCandidate()<br>
- * Only the diagram differences ADD/REVEAL or DELETE/HIDE are concerned by this display.
- */
- @Override
- protected Predicate<Diff> goodCandidate() {
- return new Predicate<Diff>() {
- public boolean apply(Diff difference) {
- return Predicates.or(isAddOrDelete, isHideOrReveal).apply(difference)
- && difference.getState() == DifferenceState.UNRESOLVED;
- }
- };
- }
-
- /**
- * From the given view, get or create the related phantoms in the given side.
- *
- * @param referenceView
- * The given view.
- * @param side
- * The given side.
- * @return The list of phantoms.
- */
- private List<Phantom> getOrCreateRelatedPhantoms(EObject referenceView, MergeViewerSide side) {
- List<Phantom> result = new ArrayList<Phantom>();
- Collection<Diff> changes = Collections2.filter(
- getCompareConfiguration().getComparison().getDifferences(referenceView), goodCandidate());
- for (Diff change : changes) {
- Phantom phantom = fPhantomRegistry.get(change);
- if (phantom == null) {
- IFigure referenceFigure = PhantomManager.this.getFigure((View)referenceView);
- if (referenceFigure != null) {
- phantom = createAndRegisterDecorator(change, (View)referenceView, referenceFigure,
- side);
- }
- }
- if (phantom != null) {
- result.add(phantom);
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getReferenceViews(org.eclipse.emf.compare.diagram.DiagramDiff)
- */
- @Override
- protected List<View> getReferenceViews(DiagramDiff difference) {
- List<View> result = new ArrayList<View>();
-
- Match match = getCompareConfiguration().getComparison().getMatch(difference.getView());
-
- EObject originObj = match.getOrigin();
- EObject leftObj = match.getLeft();
- EObject rightObj = match.getRight();
-
- if (leftObj instanceof View || rightObj instanceof View) {
- View referenceView = getReferenceView((View)originObj, (View)leftObj, (View)rightObj);
- // It may be null if it is hidden
- if (referenceView != null) {
- result.add(referenceView);
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.
- * DiagramContentMergeViewer.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.
- * Match, org.eclipse.gmf.runtime.notation.View)<br>
- * If the left object is null, a phantom should be drawn instead. Else, it means that the right
- * object is null and a phantom should be displayed on the right side.
- */
- @Override
- protected MergeViewerSide getTargetSide(Match match, View referenceView) {
- MergeViewerSide targetSide = null;
- if (!isFigureExist((View)match.getLeft())) {
- targetSide = MergeViewerSide.LEFT;
- } else {
- targetSide = MergeViewerSide.RIGHT;
- }
- return targetSide;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
- * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
- * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
- */
- @Override
- protected Phantom createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
- MergeViewerSide targetSide) {
- Phantom phantom = createPhantom(diff, referenceView, referenceFigure, targetSide);
- if (phantom != null) {
- fPhantomRegistry.put(diff, phantom);
- }
- return phantom;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
- */
- @Override
- public void removeDecorators(Diff difference) {
- fPhantomRegistry.remove(difference);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#removeAll()
- */
- @Override
- public void removeAll() {
- fPhantomRegistry.clear();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
- */
- @Override
- protected List<Phantom> getDecorators(Diff difference) {
- List<Phantom> result = new ArrayList<DiagramContentMergeViewer.PhantomManager.Phantom>();
- Phantom phantom = fPhantomRegistry.get(difference);
- if (phantom != null) {
- result.add(phantom);
- }
- return result;
- }
-
- /**
- * {@inheritDoc}.<br>
- * DO NOT CALL on a phantom within an iteration on the phantom registry.
- * {@link PhantomManager#fPhantomRegistry}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#handleDecorator(org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager.AbstractDecorator,
- * boolean)
- */
- @Override
- protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
- super.handleDecorator(decorator, isAdd, isMain);
- // Display the dependencies (context) of this decorator
- for (AbstractDecorator ancestor : ((Phantom)decorator).getDependencies()) {
- super.handleDecorator(ancestor, isAdd, false);
- }
- }
-
- @Override
- protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
- boolean isMain) {
- super.handleAddDecorator(decorator, parent, toAdd, isMain);
- // Set the highlight of the figure
- if (isMain) {
- decorator.getDecoratorFigure().highlight();
- getViewer(decorator.getSide()).getGraphicalViewer().reveal(toAdd);
- } else {
- decorator.getDecoratorFigure().unhighlight();
- }
- }
-
- /**
- * It checks that the given view graphically exists.
- *
- * @param view
- * The view.
- * @return True if it exists.
- */
- private boolean isFigureExist(View view) {
- return view != null && view.isVisible();
- }
-
- /**
- * Get the view which has to be used as reference to build a phantom.<br>
- * The reference is the non null object among the given objects. In case of delete object, in the
- * context of three-way comparison, the reference will be the ancestor one (<code>originObj</code>).
- *
- * @param originObj
- * The ancestor object.
- * @param leftView
- * The left object.
- * @param rightView
- * The right object.
- * @return The reference object.
- */
- private View getReferenceView(View originObj, View leftView, View rightView) {
- View referenceView;
- if (isFigureExist(originObj)) {
- referenceView = originObj;
- } else if (isFigureExist(leftView)) {
- referenceView = leftView;
- } else {
- referenceView = rightView;
- }
- return referenceView;
- }
-
- /**
- * It creates a new phantom from the given difference, view and figure.
- *
- * @param diff
- * The related difference used as index for the main phantom.
- * @param referenceView
- * The reference view as base for creation of the phantom.
- * @param referenceFigure
- * The reference figure as base for creation of the phantom.
- * @param side
- * The side where the phantom has to be created.
- * @return The phantom or null if the target layer is not found.
- */
- private Phantom createPhantom(Diff diff, View referenceView, IFigure referenceFigure,
- MergeViewerSide side) {
- IFigure targetLayer = getLayer(referenceView, side);
- if (targetLayer != null) {
- MergeViewerSide referenceSide = getSide(referenceView);
-
- Rectangle rect = referenceFigure.getBounds().getCopy();
-
- IFigure referenceLayer = getLayer(referenceView, referenceSide);
- translateCoordinates(referenceFigure, referenceLayer, rect);
-
- DecoratorFigure ghost = null;
-
- Phantom phantom = new Phantom(targetLayer, side, referenceView, referenceFigure, diff);
-
- // Container "list" case
- if (isNodeList(referenceView)) {
-
- int index = getIndex(diff, referenceView, side);
-
- IFigure referenceParentFigure = referenceFigure.getParent();
- Rectangle referenceParentBounds = referenceParentFigure.getBounds().getCopy();
- translateCoordinates(referenceParentFigure, referenceLayer, referenceParentBounds);
-
- View parentView = (View)getMatchView(referenceView.eContainer(), side);
- if (parentView != null) {
- int nbElements = getVisibleViews(parentView).size();
- // CHECKSTYLE:OFF
- if (index > nbElements) {
- // CHECKSTYLE:ON
- index = nbElements;
- }
- }
-
- // FIXME: The add of decorators modifies the physical coordinates of elements
- // FIXME: Compute position from the y position of the first child + sum of height of the
- // children.
- int pos = rect.height * index + referenceParentBounds.y + 1;
- Map<String, Object> parameters = new HashMap<String, Object>();
- parameters.put(NodeListFigure.PARAM_Y_POS, Integer.valueOf(pos));
-
- ghost = new NodeListFigure(diff, isThreeWay(), getCompareColor(), referenceFigure, rect,
- true, parameters);
-
- // Edge case
- } else if (referenceView instanceof Edge) {
- // If the edge phantom ties shapes where their coordinates changed
- if (hasAnExtremityChange((Edge)referenceView, side)) {
- EditPart edgeEditPart = createEdgeEditPart((Edge)referenceView, referenceSide, side);
- // CHECKSTYLE:OFF
- if (edgeEditPart instanceof GraphicalEditPart) {
- // CHECKSTYLE:ON
- phantom.setEditPart(edgeEditPart);
-
- IFigure fig = ((GraphicalEditPart)edgeEditPart).getFigure();
- fig.getChildren().clear();
- ghost = new DecoratorFigure(diff, isThreeWay(), getCompareColor(),
- referenceFigure, fig, true);
-
- }
- // Else, it creates only a polyline connection figure with the same properties as the
- // reference
- } else {
- if (referenceFigure instanceof PolylineConnection) {
- ghost = new EdgeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
- rect, true);
- }
- }
- }
-
- // Default case: Nodes
- if (ghost == null) {
- ghost = new NodeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure, rect,
- true);
- }
-
- phantom.setDecoratorFigure(ghost);
-
- translateWhenInsideContainerChange(phantom);
-
- return phantom;
- }
-
- return null;
-
- }
-
- /**
- * Get the index of the phantom to draw.
- *
- * @param diff
- * The related difference used as index for the main phantom.
- * @param referenceView
- * The reference view to compute the phantom.
- * @param side
- * The side where the phantom has to be drawn.
- * @return The index in the list where the phantom has to be drawn.
- */
- private int getIndex(Diff diff, View referenceView, MergeViewerSide side) {
- // Case for invisible objects
- if (diff instanceof Hide || diff instanceof Show) {
- List<Object> source = null;
- List<Object> target = null;
- Object newElement = null;
- Match match = diff.getMatch();
- List<Object> leftList = ReferenceUtil.getAsList(match.getLeft().eContainer(),
- NotationPackage.Literals.VIEW__PERSISTED_CHILDREN);
- List<Object> rightList = ReferenceUtil.getAsList(match.getRight().eContainer(),
- NotationPackage.Literals.VIEW__PERSISTED_CHILDREN);
- if (diff instanceof Hide) {
- source = rightList;
- target = leftList;
- newElement = diff.getMatch().getRight();
- } else {
- source = leftList;
- target = rightList;
- newElement = diff.getMatch().getLeft();
- }
- Iterable<Object> ignoredElements = Iterables.filter(target, new Predicate() {
- public boolean apply(Object input) {
- return input instanceof View && !((View)input).isVisible();
- }
- });
- return DiffUtil.findInsertionIndex(getCompareConfiguration().getComparison(), ignoredElements,
- source, target, newElement);
- }
- // Case for deleted objects
- Diff refiningDiff = Iterators.find(diff.getRefinedBy().iterator(), and(valueIs(referenceView),
- onFeature(NotationPackage.Literals.VIEW__PERSISTED_CHILDREN.getName())));
-
- return DiffUtil.findInsertionIndex(getCompareConfiguration().getComparison(), refiningDiff,
- side == MergeViewerSide.LEFT);
- }
-
- /**
- * Get the visible view under the given parent view.
- *
- * @param parent
- * The parent view.
- * @return The list of views.
- */
- private List<View> getVisibleViews(View parent) {
- return (List<View>)Lists
- .newArrayList(Iterators.filter(parent.getChildren().iterator(), new Predicate<Object>() {
- public boolean apply(Object input) {
- return input instanceof View && ((View)input).isVisible();
- }
- }));
- }
-
- /**
- * It translates and resizes the figure of the given phantom when this one is nested in a container
- * which is subjected to a coordinates change.
- *
- * @param phantom
- * The phantom.
- */
- private void translateWhenInsideContainerChange(Phantom phantom) {
- boolean isCandidate = false;
- Diff diff = phantom.getDifference();
- if (diff instanceof DiagramDiff) {
- EObject parent = ((DiagramDiff)diff).getView().eContainer();
- while (parent instanceof View && !isCandidate) {
- isCandidate = Iterables.any(
- getCompareConfiguration().getComparison().getDifferences(parent),
- instanceOf(CoordinatesChange.class));
- parent = parent.eContainer();
- }
- }
- if (isCandidate) {
- View referenceView = phantom.getOriginView();
- View parentReferenceView = (View)referenceView.eContainer();
- if (parentReferenceView != null) {
- View parentView = (View)getMatchView(parentReferenceView, phantom.getSide());
- IFigure parentFigure = getFigure(parentView);
- if (parentFigure != null) {
- Rectangle parentRect = parentFigure.getBounds().getCopy();
- translateCoordinates(parentFigure, getLayer(parentReferenceView, getSide(parentView)),
- parentRect);
-
- IFigure parentReferenceFigure = getFigure(parentReferenceView);
- // CHECKSTYLE:OFF
- if (parentReferenceFigure != null) {
- Rectangle parentReferenceRect = parentReferenceFigure.getBounds().getCopy();
- translateCoordinates(parentReferenceFigure,
- getLayer(parentReferenceView, getSide(parentReferenceView)),
- parentReferenceRect);
-
- int deltaX = parentRect.x - parentReferenceRect.x;
- int deltaY = parentRect.y - parentReferenceRect.y;
- int deltaWidth = parentRect.width - parentReferenceRect.width;
- int deltaHeight = parentRect.height - parentReferenceRect.height;
-
- IFigure figure = phantom.getFigure();
-
- Rectangle rect = figure.getBounds().getCopy();
- rect.x += deltaX;
- rect.y += deltaY;
- rect.width += deltaWidth;
- if (!(figure instanceof Polyline)) {
- rect.height += deltaHeight;
- }
- figure.setBounds(rect);
-
- if (figure instanceof Polyline) {
-
- Point firstPoint = ((Polyline)figure).getPoints().getFirstPoint().getCopy();
- Point lastPoint = ((Polyline)figure).getPoints().getLastPoint().getCopy();
-
- firstPoint.x += deltaX;
- firstPoint.y += deltaY;
-
- lastPoint.x += deltaX + deltaWidth;
- lastPoint.y += deltaY;
-
- ((Polyline)figure).setEndpoints(firstPoint, lastPoint);
-
- }
- }
- // CHECKSTYLE:ON
- }
- }
- }
- }
-
- /**
- * It checks that the given edge is linked to graphical objects subjected to coordinate changes, on
- * the given side.
- *
- * @param edge
- * The edge to check.
- * @param targetSide
- * The side to check extremities (side of the phantom).
- * @return True if an extremity at least changed its location, False otherwise.
- */
- private boolean hasAnExtremityChange(Edge edge, MergeViewerSide targetSide) {
- View referenceSource = edge.getSource();
- View referenceTarget = edge.getTarget();
- return hasChange(referenceSource, targetSide) || hasChange(referenceTarget, targetSide);
- }
-
- /**
- * It checks that the coordinates of the given view changed between left and right, from the given
- * side.
- *
- * @param referenceView
- * The view to check.
- * @param targetSide
- * The side to focus.
- * @return True if the view changed its location, False otherwise.
- */
- private boolean hasChange(View referenceView, MergeViewerSide targetSide) {
- View extremity = (View)getMatchView(referenceView, targetSide);
- // Look for a related change coordinates on the extremity of the edge reference.
- Collection<Diff> diffs = Collections2.filter(
- getCompareConfiguration().getComparison().getDifferences(referenceView),
- instanceOf(CoordinatesChange.class));
- if (diffs.isEmpty()) {
- // Look for a related change coordinates on the matching extremity (other side) of the edge
- // reference.
- diffs = Collections2.filter(
- getCompareConfiguration().getComparison().getDifferences(extremity),
- instanceOf(CoordinatesChange.class));
- }
- return !diffs.isEmpty();
- }
-
- /**
- * It creates and returns a new edit part from the given edge. This edit part listens to the reference
- * edge but is attached to the controllers of the target (phantom) side.
- *
- * @param referenceEdge
- * The edge as base of the edit part.
- * @param referenceSide
- * The side of this edge.
- * @param targetSide
- * The side where the edit part has to be created to draw the related phantom.
- * @return The new edit part.
- */
- private EditPart createEdgeEditPart(Edge referenceEdge, MergeViewerSide referenceSide,
- MergeViewerSide targetSide) {
- EditPart edgeEditPartReference = getViewer(referenceSide).getEditPart(referenceEdge);
- EditPart edgeEditPart = null;
- if (edgeEditPartReference instanceof ConnectionEditPart) {
-
- edgeEditPart = getOrCreatePhantomEditPart(referenceEdge, referenceSide, targetSide);
-
- if (edgeEditPart instanceof ConnectionEditPart) {
- EditPart edgeSourceEp = getOrCreateExtremityPhantomEditPart(
- ((ConnectionEditPart)edgeEditPartReference).getSource(), referenceSide,
- targetSide);
-
- ((ConnectionEditPart)edgeEditPart).setSource(edgeSourceEp);
-
- EditPart edgeTargetEp = getOrCreateExtremityPhantomEditPart(
- ((ConnectionEditPart)edgeEditPartReference).getTarget(), referenceSide,
- targetSide);
-
- ((ConnectionEditPart)edgeEditPart).setTarget(edgeTargetEp);
- }
- }
- return edgeEditPart;
- }
-
- /**
- * From the given edit part, it retrieves the matched one, from the given target side. If the
- * retrieved edit part is not linked to a GMF object, in the target side, a phantom GEF edit part is
- * returned which will locate a rectangle invisible figure in the same location as the related
- * phantom.
- *
- * @param referenceEdgeExtremityEp
- * The reference edit part for one of the extremities of an edge.
- * @param referenceSide
- * The side of the reference.
- * @param targetSide
- * The other side, where the phantom has to be drawn.
- * @return The phantom edit part used to attach the extremity of an edge phantom.
- */
- private EditPart getOrCreateExtremityPhantomEditPart(EditPart referenceEdgeExtremityEp,
- MergeViewerSide referenceSide, MergeViewerSide targetSide) {
- View referenceExtremityView = (View)referenceEdgeExtremityEp.getModel();
-
- EditPart edgeExtremityEp = getOrCreatePhantomEditPart(referenceExtremityView, referenceSide,
- targetSide);
-
- if (isPhantomEditPart((AbstractGraphicalEditPart)edgeExtremityEp)) {
-
- final AbstractGraphicalEditPart edgeExtremityEpParent = (AbstractGraphicalEditPart)edgeExtremityEp
- .getParent();
-
- List<Phantom> phantoms = getOrCreateRelatedPhantoms(referenceExtremityView, targetSide);
- if (!phantoms.isEmpty()) {
- Phantom phantomToTarget = phantoms.get(0);
- final IFigure figureToTarget = phantomToTarget.getFigure();
-
- edgeExtremityEp = new org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart(
- referenceExtremityView) {
- @Override
- protected void createDefaultEditPolicies() {
- }
-
- @Override
- protected IFigure createFigure() {
- RectangleFigure fig = new RectangleFigure();
- fig.setBounds(figureToTarget.getBounds());
- fig.setParent(edgeExtremityEpParent.getFigure());
- return fig;
- }
- };
-
- edgeExtremityEp.setParent(edgeExtremityEpParent);
- }
-
- ((AbstractGraphicalEditPart)edgeExtremityEp).activate();
- ((AbstractGraphicalEditPart)edgeExtremityEp).getFigure();
- }
-
- return edgeExtremityEp;
- }
-
- /**
- * It checks if the given edit part is related to a phantom edit part (created for nothing, without
- * link to a GMF object in the target side).
- *
- * @param editPart
- * The edit part to check.
- * @return True if it is a phantom edit part, false otherwise.
- */
- private boolean isPhantomEditPart(AbstractGraphicalEditPart editPart) {
- Rectangle targetBounds = editPart.getFigure().getBounds();
- return targetBounds.x == 0 && targetBounds.y == 0 && targetBounds.width == 0
- && targetBounds.height == 0;
- }
-
- /**
- * It creates and returns a new edit part from the given view. This edit part listens the reference
- * view but is attached to the controllers of the target (phantom) side.
- *
- * @param referenceView
- * The view as base of the edit part.
- * @param referenceSide
- * The side of this view.
- * @param targetSide
- * The side where the edit part has to be created to draw the related phantom.
- * @return The new edit part.
- */
- private EditPart getOrCreatePhantomEditPart(EObject referenceView, MergeViewerSide referenceSide,
- MergeViewerSide targetSide) {
- EditPart editPartParent = null;
- EditPart editPart = null;
- EditPart editPartReference = getViewer(referenceSide).getEditPart(referenceView);
- EditPart editPartReferenceParent = editPartReference.getParent();
- Object referenceViewParent = editPartReferenceParent.getModel();
- if (!(referenceViewParent instanceof EObject)) {
- referenceViewParent = referenceView.eContainer();
- }
- View viewParent = (View)getMatchView((EObject)referenceViewParent, targetSide);
- if (viewParent != null) {
- editPartParent = getViewer(targetSide).getEditPart(viewParent);
- }
- if (editPartParent == null) {
- editPartParent = getOrCreatePhantomEditPart((EObject)referenceViewParent, referenceSide,
- targetSide);
-
- }
- if (editPartParent != null) {
- View view = (View)getMatchView(referenceView, targetSide);
- if (view != null) {
- editPart = getViewer(targetSide).getEditPart(view);
- }
- if (editPart == null) {
-
- editPart = getViewer(targetSide).getGraphicalViewer().getEditPartFactory()
- .createEditPart(editPartParent, referenceView);
- editPart.setParent(editPartParent);
- getViewer(targetSide).getGraphicalViewer().getEditPartRegistry().put(referenceView,
- editPart);
-
- }
-
- }
- return editPart;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
- */
- public void hideAll() {
- for (Phantom phantom : fPhantomRegistry.values()) {
- handleDeleteDecorator(phantom, phantom.getLayer(), phantom.getFigure());
- }
- }
- }
-
- /**
- * Marker manager to create, hide or reveal marker figures related to deleted or added graphical objects.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private class MarkerManager extends AbstractDecoratorManager {
-
- /**
- * Marker represented by a <code>figure</code> on a <code>layer</code>, from the given
- * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
- * some cases.<br>
- * The marker is related to a <code>difference</code> and it is binded with the reference view and
- * figure.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private class Marker extends AbstractDecorator {
-
- /**
- * Constructor.
- *
- * @param layer
- * {@link Marker#fLayer}.
- * @param side
- * {@link Marker#fSide}.
- * @param originView
- * {@link Marker#fOriginView}.
- * @param originFigure
- * {@link Marker#fOriginFigure}.
- * @param diff
- * {@link Marker#fDifference}.
- */
- Marker(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure, Diff diff) {
- setLayer(layer);
- setSide(side);
- setOriginView(originView);
- setOriginFigure(originFigure);
- setDifference(diff);
- }
- }
-
- /** Registry of created markers, indexed by difference. */
- private Multimap<Diff, Marker> fMarkerRegistry = HashMultimap.create();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getReferenceViews(org.eclipse.emf.compare.diagram.DiagramDiff)
- */
- @Override
- protected List<View> getReferenceViews(DiagramDiff difference) {
- List<View> result = new ArrayList<View>();
- Match matchValue = getCompareConfiguration().getComparison().getMatch(difference.getView());
- if (matchValue != null) {
- if (matchValue.getLeft() != null) {
- result.add((View)matchValue.getLeft());
- }
- if (matchValue.getRight() != null) {
- result.add((View)matchValue.getRight());
- }
- if (getCompareConfiguration().getComparison().isThreeWay()) {
- switch (difference.getKind()) {
- case DELETE:
- case CHANGE:
- case MOVE:
- result.add((View)matchValue.getOrigin());
- break;
- default:
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.Match,
- * org.eclipse.gmf.runtime.notation.View)
- */
- @Override
- protected MergeViewerSide getTargetSide(Match match, View referenceView) {
- return getSide(referenceView);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
- * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
- * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
- */
- @Override
- protected Marker createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
- MergeViewerSide targetSide) {
- Marker marker = createMarker(diff, referenceView, referenceFigure, targetSide);
- if (marker != null) {
- fMarkerRegistry.put(diff, marker);
- }
- return marker;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
- */
- @Override
- public void removeDecorators(Diff difference) {
- fMarkerRegistry.removeAll(difference);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#removeAll()
- */
- @Override
- public void removeAll() {
- fMarkerRegistry.clear();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
- */
- @Override
- protected Collection<Marker> getDecorators(Diff difference) {
- return fMarkerRegistry.get(difference);
- }
-
- @Override
- protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
- boolean isMain) {
- super.handleAddDecorator(decorator, parent, toAdd, isMain);
- DiagramMergeViewer viewer = getViewer(decorator.getSide());
- EditPart editPart = viewer.getEditPart(decorator.getOriginView());
- if (editPart != null) {
- viewer.getGraphicalViewer().reveal(editPart);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.
- * DiagramContentMergeViewer.AbstractDecoratorManager#goodCandidate()<br>
- * All graphical differences are concerned.
- */
- @Override
- protected Predicate<Diff> goodCandidate() {
- return new Predicate<Diff>() {
- public boolean apply(Diff difference) {
- return instanceOf(DiagramDiff.class).apply(difference);
- }
- };
- }
-
- /**
- * It creates a new marker from the given difference, view and figure.
- *
- * @param diff
- * The related difference used as index for the main marker.
- * @param referenceView
- * The reference view as base for creation of the marker.
- * @param referenceFigure
- * The reference figure as base for creation of the marker.
- * @param side
- * The side where the marker has to be created.
- * @return The phantom or null if the target layer is not found.
- */
- private Marker createMarker(Diff diff, View referenceView, IFigure referenceFigure,
- MergeViewerSide side) {
-
- IFigure referenceLayer = getLayer(referenceView, side);
- if (referenceLayer != null) {
- Rectangle referenceBounds = referenceFigure.getBounds().getCopy();
- translateCoordinates(referenceFigure, referenceLayer, referenceBounds);
-
- DecoratorFigure markerFigure = null;
-
- Marker marker = new Marker(referenceLayer, side, referenceView, referenceFigure, diff);
-
- if (isNodeList(referenceView)) {
- markerFigure = new NodeListFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
- referenceBounds, false);
- } else if (referenceView instanceof Edge && referenceFigure instanceof PolylineConnection) {
- markerFigure = new EdgeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
- referenceBounds, false);
- }
-
- // Default case: Nodes
- if (markerFigure == null) {
- markerFigure = new NodeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
- referenceBounds, false);
- }
-
- marker.setDecoratorFigure(markerFigure);
- return marker;
- }
-
- return null;
-
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
- */
- public void hideAll() {
- for (Marker marker : fMarkerRegistry.values()) {
- handleDeleteDecorator(marker, marker.getLayer(), marker.getFigure());
- }
- }
-
- }
-
- /**
- * Decorator manager to create, hide or reveal all decorator figures related to graphical changes.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
- private class DecoratorsManager implements IDecoratorManager {
- /** Phantoms manager. */
- private IDecoratorManager fPhantomManager = new PhantomManager();
-
- /** Markers manager. */
- private IDecoratorManager fMarkerManager = new MarkerManager();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideDecorators(org.eclipse.emf.compare.Diff)
- */
- public void hideDecorators(Diff difference) {
- fMarkerManager.hideDecorators(difference);
- fPhantomManager.hideDecorators(difference);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#revealDecorators(org.eclipse.emf.compare.Diff)
- */
- public void revealDecorators(Diff difference) {
- fMarkerManager.revealDecorators(difference);
- fPhantomManager.revealDecorators(difference);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
- */
- public void hideAll() {
- fMarkerManager.hideAll();
- fPhantomManager.hideAll();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
- */
- public void removeDecorators(Diff difference) {
- fMarkerManager.removeDecorators(difference);
- fPhantomManager.removeDecorators(difference);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#removeAll()
- */
- public void removeAll() {
- fMarkerManager.removeAll();
- fPhantomManager.removeAll();
- }
-
- }
-
- /**
* Bundle name of the property file containing all displayed strings.
*/
private static final String BUNDLE_NAME = DiagramContentMergeViewer.class.getName();
/** The phantom manager to use in the context of this viewer. */
- private final DecoratorsManager fDecoratorsManager = new DecoratorsManager();
+ private DecoratorsManager fDecoratorsManager;
/** The current "opened" difference. */
private Diff fCurrentSelectedDiff;
@@ -1771,6 +93,15 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
}
/**
+ * Get the {@link DecoratorsManager}.
+ *
+ * @return the {@link DecoratorsManager}.
+ */
+ public DecoratorsManager getDecoratorsManager() {
+ return fDecoratorsManager;
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getAncestorMergeViewer()
@@ -1819,7 +150,7 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#createMergeViewer(org.eclipse.swt.widgets.Composite,
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#createMergeViewer(org.eclipse.swt.widgets.Composite,
* org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
*/
@Override
@@ -1832,7 +163,7 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#paintCenter(org.eclipse.swt.graphics.GC)
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#paintCenter(org.eclipse.swt.graphics.GC)
*/
@Override
protected void paintCenter(GC g) {
@@ -1842,12 +173,15 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#updateContent(java.lang.Object,
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#updateContent(java.lang.Object,
* java.lang.Object, java.lang.Object)
*/
@Override
protected void updateContent(Object ancestor, Object left, Object right) {
+ fDecoratorsManager = new DecoratorsManager(getCompareConfiguration(), getLeftMergeViewer(),
+ getRightMergeViewer(), getAncestorMergeViewer(), getCompareColor());
+
// Delete decorators at each selection of a difference (force the computation)
fDecoratorsManager.hideAll();
fDecoratorsManager.removeAll();
@@ -1933,6 +267,11 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
return null;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#createToolItems(org.eclipse.jface.action.ToolBarManager)
+ */
@Override
protected void createToolItems(ToolBarManager toolBarManager) {
super.createToolItems(toolBarManager);
@@ -1943,6 +282,8 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
/**
* {@inheritDoc} When the zoom on any of the sides changes, the same zoom level is applied to other sides.
+ *
+ * @see org.eclipse.gef.editparts.ZoomListener#zoomChanged(double)
*/
@Override
public void zoomChanged(double zoom) {
@@ -1970,7 +311,7 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
// Delete decorators at each change of the input models (after merging or CTRL-Z, CTRL-Y)
Object source = event.getSource();
- if (source instanceof CommandStack) {
+ if (source instanceof CommandStack && fDecoratorsManager != null) {
Command command = ((CommandStack)source).getMostRecentCommand();
if (command instanceof CopyCommand) {
Iterator<DiagramDiff> diffs = Iterators.filter(command.getAffectedObjects().iterator(),
@@ -2007,88 +348,4 @@ public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer impl
getRightMergeViewer().removeSelectionChangedListener(this);
}
- /**
- * Utility method to retrieve the {@link DiagramMergeViewer} from the given side.
- *
- * @param side
- * The side to focus.
- * @return The viewer.
- */
- private DiagramMergeViewer getViewer(MergeViewerSide side) {
- DiagramMergeViewer result = null;
- switch (side) {
- case LEFT:
- result = getLeftMergeViewer();
- break;
- case RIGHT:
- result = getRightMergeViewer();
- break;
- case ANCESTOR:
- result = getAncestorMergeViewer();
- break;
- default:
- }
- return result;
- }
-
- /**
- * Utility method to know the side where is located the given view.
- *
- * @param view
- * The view.
- * @return The side of the view.
- */
- private MergeViewerSide getSide(View view) {
- MergeViewerSide result = null;
- Match match = getCompareConfiguration().getComparison().getMatch(view);
- if (match.getLeft() == view) {
- result = MergeViewerSide.LEFT;
- } else if (match.getRight() == view) {
- result = MergeViewerSide.RIGHT;
- } else if (match.getOrigin() == view) {
- result = MergeViewerSide.ANCESTOR;
- }
- return getEffectiveSide(result);
- }
-
- /**
- * Utility method to get the object matching with the given one, to the given side.
- *
- * @param object
- * The object as base of the lookup.
- * @param side
- * The side where the potential matching object has to be retrieved.
- * @return The matching object.
- */
- private EObject getMatchView(EObject object, MergeViewerSide side) {
- Match match = getCompareConfiguration().getComparison().getMatch(object);
- return getMatchView(match, side);
- }
-
- /**
- * Utility method to get the object in the given side from the given match.
- *
- * @param match
- * The match.
- * @param side
- * The side where the potential matching object has to be retrieved.
- * @return The matching object.
- */
- private EObject getMatchView(Match match, MergeViewerSide side) {
- EObject result = null;
- switch (side) {
- case LEFT:
- result = match.getLeft();
- break;
- case RIGHT:
- result = match.getRight();
- break;
- case ANCESTOR:
- result = match.getOrigin();
- break;
- default:
- }
- return result;
- }
-
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
index 38bb1ff91..314c2223b 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2017 Obeo and others.
+ * Copyright (c) 2013, 2020 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -52,7 +52,7 @@ import org.eclipse.swt.widgets.Control;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-class DiagramMergeViewer extends AbstractGraphicalMergeViewer {
+public class DiagramMergeViewer extends AbstractGraphicalMergeViewer {
/**
* Selection manager to forbid manual selections on graphical objects.
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/IDecoratorManager.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/IDecoratorManager.java
new file mode 100644
index 000000000..0bbd1417f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/IDecoratorManager.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import java.util.Collection;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator;
+
+/**
+ * Interface for the management of decorators.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public interface IDecoratorManager {
+
+ /**
+ * It hides the revealed decorators.
+ */
+ void hideAll();
+
+ /**
+ * From a given difference, it hides the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ void hideDecorators(Diff difference);
+
+ /**
+ * From a given difference, it reveals the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ void revealDecorators(Diff difference);
+
+ /**
+ * From a given difference, it removes the related decorators from cash.
+ *
+ * @param difference
+ * The difference.
+ */
+ void removeDecorators(Diff difference);
+
+ /**
+ * It removes all the displayed decorators from cache.
+ */
+ void removeAll();
+
+ /**
+ * Get all registered decorators.
+ *
+ * @return the list of all decorators.
+ */
+ Collection<AbstractDecorator> getAllDecorators();
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/MarkerManager.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/MarkerManager.java
new file mode 100644
index 000000000..4d052dbe9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/MarkerManager.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import static com.google.common.base.Predicates.instanceOf;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.DecoratorFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.EdgeFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeListFigure;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Marker manager to create, hide or reveal marker figures related to deleted or added graphical objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class MarkerManager extends AbstractDecoratorManager {
+
+ /**
+ * Marker represented by a <code>figure</code> on a <code>layer</code>, from the given <code>side</code>
+ * of the merge viewer. An edit part may be linked to the <code>figure</code> in some cases.<br>
+ * The marker is related to a <code>difference</code> and it is binded with the reference view and figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class Marker extends AbstractDecorator {
+
+ /**
+ * Constructor.
+ *
+ * @param layer
+ * {@link Marker#fLayer}.
+ * @param side
+ * {@link Marker#fSide}.
+ * @param originView
+ * {@link Marker#fOriginView}.
+ * @param originFigure
+ * {@link Marker#fOriginFigure}.
+ * @param diff
+ * {@link Marker#fDifference}.
+ */
+ Marker(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure, Diff diff) {
+ setLayer(layer);
+ setSide(side);
+ setOriginView(originView);
+ setOriginFigure(originFigure);
+ setDifference(diff);
+ }
+ }
+
+ /** Registry of created markers, indexed by difference. */
+ private Multimap<Diff, Marker> fMarkerRegistry = HashMultimap.create();
+
+ /**
+ * Constructor.
+ *
+ * @param compareConfiguration
+ * The compare configuration of the viewer.
+ * @param left
+ * The left area of the viewer.
+ * @param right
+ * The right area of the viewer.
+ * @param ancestor
+ * The ancestor area of the viewer.
+ * @param color
+ * The color of the difference.
+ */
+ public MarkerManager(EMFCompareConfiguration compareConfiguration, DiagramMergeViewer left,
+ DiagramMergeViewer right, DiagramMergeViewer ancestor, ICompareColor color) {
+ super(compareConfiguration, left, right, ancestor, color);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getReferenceViews(
+ * org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff)
+ */
+ @Override
+ protected List<View> getReferenceViews(DiagramDiff difference) {
+ List<View> result = new ArrayList<View>();
+ Match matchValue = getCompareConfiguration().getComparison().getMatch(difference.getView());
+ if (matchValue != null) {
+ if (matchValue.getLeft() != null) {
+ result.add((View)matchValue.getLeft());
+ }
+ if (matchValue.getRight() != null) {
+ result.add((View)matchValue.getRight());
+ }
+ if (getCompareConfiguration().getComparison().isThreeWay()) {
+ switch (difference.getKind()) {
+ case DELETE:
+ case CHANGE:
+ case MOVE:
+ result.add((View)matchValue.getOrigin());
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.Match,
+ * org.eclipse.gmf.runtime.notation.View)
+ */
+ @Override
+ public MergeViewerSide getTargetSide(Match match, View referenceView) {
+ return getSide(referenceView);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
+ * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
+ * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
+ @Override
+ protected Marker createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide targetSide) {
+ Marker marker = createMarker(diff, referenceView, referenceFigure, targetSide);
+ if (marker != null) {
+ fMarkerRegistry.put(diff, marker);
+ }
+ return marker;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ public void removeDecorators(Diff difference) {
+ fMarkerRegistry.removeAll(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#removeAll()
+ */
+ @Override
+ public void removeAll() {
+ fMarkerRegistry.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ protected Collection<Marker> getDecorators(Diff difference) {
+ return fMarkerRegistry.get(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#handleAddDecorator(org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator,
+ * org.eclipse.draw2d.IFigure, org.eclipse.draw2d.IFigure, boolean)
+ */
+ @Override
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ super.handleAddDecorator(decorator, parent, toAdd, isMain);
+ DiagramMergeViewer viewer = getViewer(decorator.getSide());
+ EditPart editPart = viewer.getEditPart(decorator.getOriginView());
+ if (editPart != null) {
+ viewer.getGraphicalViewer().reveal(editPart);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#goodCandidate()
+ * <br>
+ * All graphical differences are concerned.
+ */
+ @Override
+ protected Predicate<Diff> goodCandidate() {
+ return new Predicate<Diff>() {
+ public boolean apply(Diff difference) {
+ return instanceOf(DiagramDiff.class).apply(difference);
+ }
+ };
+ }
+
+ /**
+ * It creates a new marker from the given difference, view and figure.
+ *
+ * @param diff
+ * The related difference used as index for the main marker.
+ * @param referenceView
+ * The reference view as base for creation of the marker.
+ * @param referenceFigure
+ * The reference figure as base for creation of the marker.
+ * @param side
+ * The side where the marker has to be created.
+ * @return The phantom or null if the target layer is not found.
+ */
+ private Marker createMarker(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide side) {
+
+ IFigure referenceLayer = getLayer(referenceView, side);
+ if (referenceLayer != null) {
+ Rectangle referenceBounds = referenceFigure.getBounds().getCopy();
+ translateCoordinates(referenceFigure, referenceLayer, referenceBounds);
+
+ DecoratorFigure markerFigure = null;
+
+ Marker marker = new Marker(referenceLayer, side, referenceView, referenceFigure, diff);
+
+ if (isNodeList(referenceView)) {
+ markerFigure = new NodeListFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
+ referenceBounds, false);
+ } else if (referenceView instanceof Edge && referenceFigure instanceof PolylineConnection) {
+ markerFigure = new EdgeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
+ referenceBounds, false);
+ }
+
+ // Default case: Nodes
+ if (markerFigure == null) {
+ markerFigure = new NodeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
+ referenceBounds, false);
+ }
+
+ marker.setDecoratorFigure(markerFigure);
+ return marker;
+ }
+
+ return null;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ for (Marker marker : fMarkerRegistry.values()) {
+ handleDeleteDecorator(marker, marker.getLayer(), marker.getFigure());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#getAllDecorators()
+ */
+ public Collection<AbstractDecorator> getAllDecorators() {
+ Collection<AbstractDecorator> markers = new ArrayList<AbstractDecorator>();
+ for (AbstractDecorator marker : fMarkerRegistry.values()) {
+ markers.add(marker);
+ }
+ return markers;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/PhantomManager.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/PhantomManager.java
new file mode 100644
index 000000000..baf82750a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/PhantomManager.java
@@ -0,0 +1,837 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
+
+import static com.google.common.base.Predicates.and;
+import static com.google.common.base.Predicates.instanceOf;
+import static com.google.common.base.Predicates.or;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueIs;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.DecoratorFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.EdgeFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeFigure;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.figures.NodeListFigure;
+import org.eclipse.emf.compare.diagram.internal.extensions.CoordinatesChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
+import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
+import org.eclipse.emf.compare.internal.utils.DiffUtil;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.compare.utils.ReferenceUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Phantom manager to create, hide or reveal phantom figures related to deleted or added graphical objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class PhantomManager extends AbstractDecoratorManager {
+
+ /**
+ * Phantom represented by a <code>figure</code> on a <code>layer</code>, from the given <code>side</code>
+ * of the merge viewer. An edit part may be linked to the <code>figure</code> in some cases.<br>
+ * The phantom is related to a <code>difference</code> and it is binded with the reference view and
+ * figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class Phantom extends AbstractDecorator {
+
+ /**
+ * Constructor.
+ *
+ * @param layer
+ * {@link Phantom#fLayer}.
+ * @param side
+ * {@link Phantom#fSide}.
+ * @param originView
+ * {@link Phantom#fOriginView}.
+ * @param originFigure
+ * {@link Phantom#fOriginFigure}.
+ * @param diff
+ * {@link Phantom#fDifference}.
+ */
+ Phantom(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure, Diff diff) {
+ setLayer(layer);
+ setSide(side);
+ setOriginView(originView);
+ setOriginFigure(originFigure);
+ setDifference(diff);
+ }
+
+ /**
+ * Get the decorator dependencies of this one. The dependencies are the decorator ancestors plus the
+ * extremities of an edge decorator.<br>
+ * DO NOT CALL in an iterate of {@link PhantomManager#fPhantomRegistry}
+ *
+ * @return The list of found decorators.
+ */
+ public List<? extends AbstractDecorator> getDependencies() {
+ List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
+ result.addAll(getAncestors());
+ if (fOriginView instanceof Edge) {
+ View source = ((Edge)fOriginView).getSource();
+ View target = ((Edge)fOriginView).getTarget();
+ result.addAll(getOrCreateRelatedPhantoms(source, fSide));
+ result.addAll(getOrCreateRelatedPhantoms(target, fSide));
+ }
+ return result;
+ }
+
+ /**
+ * Get the ancestor decorators of this one.
+ *
+ * @return The list of the ancestors.
+ */
+ private List<? extends AbstractDecorator> getAncestors() {
+ List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
+ EObject parentOriginView = fOriginView.eContainer();
+ while (parentOriginView != null) {
+ result.addAll(getOrCreateRelatedPhantoms(parentOriginView, fSide));
+ parentOriginView = parentOriginView.eContainer();
+ }
+ return result;
+ }
+ }
+
+ /** Registry of created phantoms, indexed by difference. */
+ private final Map<Diff, Phantom> fPhantomRegistry = new HashMap<Diff, Phantom>();
+
+ /** Predicate witch checks that the given difference is an ADD or DELETE of a graphical object. */
+ private Predicate<Diff> isAddOrDelete = and(instanceOf(DiagramDiff.class),
+ or(ofKind(DifferenceKind.ADD), ofKind(DifferenceKind.DELETE)));
+
+ /** Predicate witch checks that the given difference is a HIDE or REVEAL of a graphical object. */
+ private Predicate<Diff> isHideOrReveal = or(instanceOf(Show.class), instanceOf(Hide.class));
+
+ /**
+ * Constructor.
+ *
+ * @param compareConfiguration
+ * The compare configuration of the viewer.
+ * @param left
+ * The left area of the viewer.
+ * @param right
+ * The right area of the viewer.
+ * @param ancestor
+ * The ancestor area of the viewer.
+ * @param color
+ * The color of the difference.
+ */
+ public PhantomManager(EMFCompareConfiguration compareConfiguration, DiagramMergeViewer left,
+ DiagramMergeViewer right, DiagramMergeViewer ancestor, ICompareColor color) {
+ super(compareConfiguration, left, right, ancestor, color);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#goodCandidate()
+ * <br>
+ * Only the diagram differences ADD/REVEAL or DELETE/HIDE are concerned by this display.
+ */
+ @Override
+ protected Predicate<Diff> goodCandidate() {
+ return new Predicate<Diff>() {
+ public boolean apply(Diff difference) {
+ return Predicates.or(isAddOrDelete, isHideOrReveal).apply(difference)
+ && difference.getState() == DifferenceState.UNRESOLVED;
+ }
+ };
+ }
+
+ /**
+ * From the given view, get or create the related phantoms in the given side.
+ *
+ * @param referenceView
+ * The given view.
+ * @param side
+ * The given side.
+ * @return The list of phantoms.
+ */
+ private List<Phantom> getOrCreateRelatedPhantoms(EObject referenceView, MergeViewerSide side) {
+ List<Phantom> result = new ArrayList<Phantom>();
+ Collection<Diff> changes = Collections2.filter(
+ getCompareConfiguration().getComparison().getDifferences(referenceView), goodCandidate());
+ for (Diff change : changes) {
+ Phantom phantom = fPhantomRegistry.get(change);
+ if (phantom == null) {
+ IFigure referenceFigure = PhantomManager.this.getFigure((View)referenceView);
+ if (referenceFigure != null) {
+ phantom = createAndRegisterDecorator(change, (View)referenceView, referenceFigure, side);
+ }
+ }
+ if (phantom != null) {
+ result.add(phantom);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getReferenceViews(
+ * org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff)
+ */
+ @Override
+ protected List<View> getReferenceViews(DiagramDiff difference) {
+ List<View> result = new ArrayList<View>();
+
+ Match match = getCompareConfiguration().getComparison().getMatch(difference.getView());
+
+ EObject originObj = match.getOrigin();
+ EObject leftObj = match.getLeft();
+ EObject rightObj = match.getRight();
+
+ if (leftObj instanceof View || rightObj instanceof View) {
+ View referenceView = getReferenceView((View)originObj, (View)leftObj, (View)rightObj);
+ // It may be null if it is hidden
+ if (referenceView != null) {
+ result.add(referenceView);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.
+ * Match, org.eclipse.gmf.runtime.notation.View) <br>
+ * If the left object is null, a phantom should be drawn instead. Else, it means that the right
+ * object is null and a phantom should be displayed on the right side.
+ */
+ @Override
+ public MergeViewerSide getTargetSide(Match match, View referenceView) {
+ MergeViewerSide targetSide = null;
+ EObject leftMatch = match.getLeft();
+
+ if (leftMatch == null || (leftMatch instanceof View && !isFigureExist((View)leftMatch))) {
+ targetSide = MergeViewerSide.LEFT;
+ } else {
+ targetSide = MergeViewerSide.RIGHT;
+ }
+ return getEffectiveSide(targetSide);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
+ * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
+ * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
+ @Override
+ protected Phantom createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide targetSide) {
+ Phantom phantom = createPhantom(diff, referenceView, referenceFigure, targetSide);
+ if (phantom != null) {
+ fPhantomRegistry.put(diff, phantom);
+ }
+ return phantom;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#removeDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ public void removeDecorators(Diff difference) {
+ fPhantomRegistry.remove(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#removeAll()
+ */
+ @Override
+ public void removeAll() {
+ fPhantomRegistry.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ protected List<Phantom> getDecorators(Diff difference) {
+ List<Phantom> result = new ArrayList<PhantomManager.Phantom>();
+ Phantom phantom = fPhantomRegistry.get(difference);
+ if (phantom != null) {
+ result.add(phantom);
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}.<br>
+ * DO NOT CALL on a phantom within an iteration on the phantom registry.
+ * {@link PhantomManager#fPhantomRegistry}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#handleDecorator(org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator,
+ * boolean, boolean)
+ */
+ @Override
+ protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
+ super.handleDecorator(decorator, isAdd, isMain);
+ // Display the dependencies (context) of this decorator
+ for (AbstractDecorator ancestor : ((Phantom)decorator).getDependencies()) {
+ super.handleDecorator(ancestor, isAdd, false);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager#handleAddDecorator(org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.AbstractDecoratorManager.AbstractDecorator,
+ * org.eclipse.draw2d.IFigure, org.eclipse.draw2d.IFigure, boolean)
+ */
+ @Override
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ super.handleAddDecorator(decorator, parent, toAdd, isMain);
+ // Set the highlight of the figure
+ if (isMain) {
+ decorator.getDecoratorFigure().highlight();
+ getViewer(decorator.getSide()).getGraphicalViewer().reveal(toAdd);
+ } else {
+ decorator.getDecoratorFigure().unhighlight();
+ }
+ }
+
+ /**
+ * It checks that the given view graphically exists.
+ *
+ * @param view
+ * The view.
+ * @return True if it exists.
+ */
+ private boolean isFigureExist(View view) {
+ return view != null && view.isVisible();
+ }
+
+ /**
+ * Get the view which has to be used as reference to build a phantom.<br>
+ * The reference is the non null object among the given objects. In case of delete object, in the context
+ * of three-way comparison, the reference will be the ancestor one (<code>originObj</code>).
+ *
+ * @param originObj
+ * The ancestor object.
+ * @param leftView
+ * The left object.
+ * @param rightView
+ * The right object.
+ * @return The reference object.
+ */
+ private View getReferenceView(View originObj, View leftView, View rightView) {
+ View referenceView;
+ if (isFigureExist(originObj)) {
+ referenceView = originObj;
+ } else if (isFigureExist(leftView)) {
+ referenceView = leftView;
+ } else {
+ referenceView = rightView;
+ }
+ return referenceView;
+ }
+
+ /**
+ * It creates a new phantom from the given difference, view and figure.
+ *
+ * @param diff
+ * The related difference used as index for the main phantom.
+ * @param referenceView
+ * The reference view as base for creation of the phantom.
+ * @param referenceFigure
+ * The reference figure as base for creation of the phantom.
+ * @param side
+ * The side where the phantom has to be created.
+ * @return The phantom or null if the target layer is not found.
+ */
+ private Phantom createPhantom(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide side) {
+ IFigure targetLayer = getLayer(referenceView, side);
+ if (targetLayer != null) {
+ MergeViewerSide referenceSide = getSide(referenceView);
+
+ Rectangle rect = referenceFigure.getBounds().getCopy();
+
+ IFigure referenceLayer = getLayer(referenceView, referenceSide);
+ translateCoordinates(referenceFigure, referenceLayer, rect);
+
+ DecoratorFigure ghost = null;
+
+ Phantom phantom = new Phantom(targetLayer, side, referenceView, referenceFigure, diff);
+
+ // Container "list" case
+ if (isNodeList(referenceView)) {
+
+ int index = getIndex(diff, referenceView, side);
+
+ IFigure referenceParentFigure = referenceFigure.getParent();
+ Rectangle referenceParentBounds = referenceParentFigure.getBounds().getCopy();
+ translateCoordinates(referenceParentFigure, referenceLayer, referenceParentBounds);
+
+ View parentView = (View)getMatchView(referenceView.eContainer(), side);
+ if (parentView != null) {
+ int nbElements = getVisibleViews(parentView).size();
+ // CHECKSTYLE:OFF
+ if (index > nbElements) {
+ // CHECKSTYLE:ON
+ index = nbElements;
+ }
+ }
+
+ // FIXME: The add of decorators modifies the physical coordinates of elements
+ // FIXME: Compute position from the y position of the first child + sum of height of the
+ // children.
+ int pos = rect.height * index + referenceParentBounds.y + 1;
+ Map<String, Object> parameters = new HashMap<String, Object>();
+ parameters.put(NodeListFigure.PARAM_Y_POS, Integer.valueOf(pos));
+
+ ghost = new NodeListFigure(diff, isThreeWay(), getCompareColor(), referenceFigure, rect, true,
+ parameters);
+
+ // Edge case
+ } else if (referenceView instanceof Edge) {
+ // If the edge phantom ties shapes where their coordinates changed
+ if (hasAnExtremityChange((Edge)referenceView, side)) {
+ EditPart edgeEditPart = createEdgeEditPart((Edge)referenceView, referenceSide, side);
+ // CHECKSTYLE:OFF
+ if (edgeEditPart instanceof GraphicalEditPart) {
+ // CHECKSTYLE:ON
+ phantom.setEditPart(edgeEditPart);
+
+ IFigure fig = ((GraphicalEditPart)edgeEditPart).getFigure();
+ fig.getChildren().clear();
+ ghost = new DecoratorFigure(diff, isThreeWay(), getCompareColor(), referenceFigure,
+ fig, true);
+
+ }
+ // Else, it creates only a polyline connection figure with the same properties as the
+ // reference
+ } else {
+ if (referenceFigure instanceof PolylineConnection) {
+ ghost = new EdgeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure, rect,
+ true);
+ }
+ }
+ }
+
+ // Default case: Nodes
+ if (ghost == null) {
+ ghost = new NodeFigure(diff, isThreeWay(), getCompareColor(), referenceFigure, rect, true);
+ }
+
+ phantom.setDecoratorFigure(ghost);
+
+ translateWhenInsideContainerChange(phantom);
+
+ return phantom;
+ }
+
+ return null;
+
+ }
+
+ /**
+ * Get the index of the phantom to draw.
+ *
+ * @param diff
+ * The related difference used as index for the main phantom.
+ * @param referenceView
+ * The reference view to compute the phantom.
+ * @param side
+ * The side where the phantom has to be drawn.
+ * @return The index in the list where the phantom has to be drawn.
+ */
+ private int getIndex(Diff diff, View referenceView, MergeViewerSide side) {
+ // Case for invisible objects
+ if (diff instanceof Hide || diff instanceof Show) {
+ List<Object> source = null;
+ List<Object> target = null;
+ Object newElement = null;
+ Match match = diff.getMatch();
+ List<Object> leftList = ReferenceUtil.getAsList(match.getLeft().eContainer(),
+ NotationPackage.Literals.VIEW__PERSISTED_CHILDREN);
+ List<Object> rightList = ReferenceUtil.getAsList(match.getRight().eContainer(),
+ NotationPackage.Literals.VIEW__PERSISTED_CHILDREN);
+ if (diff instanceof Hide) {
+ source = rightList;
+ target = leftList;
+ newElement = diff.getMatch().getRight();
+ } else {
+ source = leftList;
+ target = rightList;
+ newElement = diff.getMatch().getLeft();
+ }
+ Iterable<Object> ignoredElements = Iterables.filter(target, new Predicate() {
+ public boolean apply(Object input) {
+ return input instanceof View && !((View)input).isVisible();
+ }
+ });
+ return DiffUtil.findInsertionIndex(getCompareConfiguration().getComparison(), ignoredElements,
+ source, target, newElement);
+ }
+ // Case for deleted objects
+ Diff refiningDiff = Iterators.find(diff.getRefinedBy().iterator(), and(valueIs(referenceView),
+ onFeature(NotationPackage.Literals.VIEW__PERSISTED_CHILDREN.getName())));
+
+ return DiffUtil.findInsertionIndex(getCompareConfiguration().getComparison(), refiningDiff,
+ side == MergeViewerSide.LEFT);
+ }
+
+ /**
+ * Get the visible view under the given parent view.
+ *
+ * @param parent
+ * The parent view.
+ * @return The list of views.
+ */
+ private List<View> getVisibleViews(View parent) {
+ return (List<View>)Lists
+ .newArrayList(Iterators.filter(parent.getChildren().iterator(), new Predicate<Object>() {
+ public boolean apply(Object input) {
+ return input instanceof View && ((View)input).isVisible();
+ }
+ }));
+ }
+
+ /**
+ * It translates and resizes the figure of the given phantom when this one is nested in a container which
+ * is subjected to a coordinates change.
+ *
+ * @param phantom
+ * The phantom.
+ */
+ private void translateWhenInsideContainerChange(Phantom phantom) {
+ boolean isCandidate = false;
+ Diff diff = phantom.getDifference();
+ if (diff instanceof DiagramDiff) {
+ EObject parent = ((DiagramDiff)diff).getView().eContainer();
+ while (parent instanceof View && !isCandidate) {
+ isCandidate = Iterables.any(getCompareConfiguration().getComparison().getDifferences(parent),
+ instanceOf(CoordinatesChange.class));
+ parent = parent.eContainer();
+ }
+ }
+ if (isCandidate) {
+ View referenceView = phantom.getOriginView();
+ View parentReferenceView = (View)referenceView.eContainer();
+ if (parentReferenceView != null) {
+ View parentView = (View)getMatchView(parentReferenceView, phantom.getSide());
+ IFigure parentFigure = getFigure(parentView);
+ if (parentFigure != null) {
+ Rectangle parentRect = parentFigure.getBounds().getCopy();
+ translateCoordinates(parentFigure, getLayer(parentReferenceView, getSide(parentView)),
+ parentRect);
+
+ IFigure parentReferenceFigure = getFigure(parentReferenceView);
+ // CHECKSTYLE:OFF
+ if (parentReferenceFigure != null) {
+ Rectangle parentReferenceRect = parentReferenceFigure.getBounds().getCopy();
+ translateCoordinates(parentReferenceFigure,
+ getLayer(parentReferenceView, getSide(parentReferenceView)),
+ parentReferenceRect);
+
+ int deltaX = parentRect.x - parentReferenceRect.x;
+ int deltaY = parentRect.y - parentReferenceRect.y;
+ int deltaWidth = parentRect.width - parentReferenceRect.width;
+ int deltaHeight = parentRect.height - parentReferenceRect.height;
+
+ IFigure figure = phantom.getFigure();
+
+ Rectangle rect = figure.getBounds().getCopy();
+ rect.x += deltaX;
+ rect.y += deltaY;
+ rect.width += deltaWidth;
+ if (!(figure instanceof Polyline)) {
+ rect.height += deltaHeight;
+ }
+ figure.setBounds(rect);
+
+ if (figure instanceof Polyline) {
+
+ Point firstPoint = ((Polyline)figure).getPoints().getFirstPoint().getCopy();
+ Point lastPoint = ((Polyline)figure).getPoints().getLastPoint().getCopy();
+
+ firstPoint.x += deltaX;
+ firstPoint.y += deltaY;
+
+ lastPoint.x += deltaX + deltaWidth;
+ lastPoint.y += deltaY;
+
+ ((Polyline)figure).setEndpoints(firstPoint, lastPoint);
+
+ }
+ }
+ // CHECKSTYLE:ON
+ }
+ }
+ }
+ }
+
+ /**
+ * It checks that the given edge is linked to graphical objects subjected to coordinate changes, on the
+ * given side.
+ *
+ * @param edge
+ * The edge to check.
+ * @param targetSide
+ * The side to check extremities (side of the phantom).
+ * @return True if an extremity at least changed its location, False otherwise.
+ */
+ private boolean hasAnExtremityChange(Edge edge, MergeViewerSide targetSide) {
+ View referenceSource = edge.getSource();
+ View referenceTarget = edge.getTarget();
+ return hasChange(referenceSource, targetSide) || hasChange(referenceTarget, targetSide);
+ }
+
+ /**
+ * It checks that the coordinates of the given view changed between left and right, from the given side.
+ *
+ * @param referenceView
+ * The view to check.
+ * @param targetSide
+ * The side to focus.
+ * @return True if the view changed its location, False otherwise.
+ */
+ private boolean hasChange(View referenceView, MergeViewerSide targetSide) {
+ View extremity = (View)getMatchView(referenceView, targetSide);
+ // Look for a related change coordinates on the extremity of the edge reference.
+ Collection<Diff> diffs = Collections2.filter(
+ getCompareConfiguration().getComparison().getDifferences(referenceView),
+ instanceOf(CoordinatesChange.class));
+ if (diffs.isEmpty()) {
+ // Look for a related change coordinates on the matching extremity (other side) of the edge
+ // reference.
+ diffs = Collections2.filter(getCompareConfiguration().getComparison().getDifferences(extremity),
+ instanceOf(CoordinatesChange.class));
+ }
+ return !diffs.isEmpty();
+ }
+
+ /**
+ * It creates and returns a new edit part from the given edge. This edit part listens to the reference
+ * edge but is attached to the controllers of the target (phantom) side.
+ *
+ * @param referenceEdge
+ * The edge as base of the edit part.
+ * @param referenceSide
+ * The side of this edge.
+ * @param targetSide
+ * The side where the edit part has to be created to draw the related phantom.
+ * @return The new edit part.
+ */
+ private EditPart createEdgeEditPart(Edge referenceEdge, MergeViewerSide referenceSide,
+ MergeViewerSide targetSide) {
+ EditPart edgeEditPartReference = getViewer(referenceSide).getEditPart(referenceEdge);
+ EditPart edgeEditPart = null;
+ if (edgeEditPartReference instanceof ConnectionEditPart) {
+
+ edgeEditPart = getOrCreatePhantomEditPart(referenceEdge, referenceSide, targetSide);
+
+ if (edgeEditPart instanceof ConnectionEditPart) {
+ EditPart edgeSourceEp = getOrCreateExtremityPhantomEditPart(
+ ((ConnectionEditPart)edgeEditPartReference).getSource(), referenceSide, targetSide);
+
+ ((ConnectionEditPart)edgeEditPart).setSource(edgeSourceEp);
+
+ EditPart edgeTargetEp = getOrCreateExtremityPhantomEditPart(
+ ((ConnectionEditPart)edgeEditPartReference).getTarget(), referenceSide, targetSide);
+
+ ((ConnectionEditPart)edgeEditPart).setTarget(edgeTargetEp);
+ }
+ }
+ return edgeEditPart;
+ }
+
+ /**
+ * From the given edit part, it retrieves the matched one, from the given target side. If the retrieved
+ * edit part is not linked to a GMF object, in the target side, a phantom GEF edit part is returned which
+ * will locate a rectangle invisible figure in the same location as the related phantom.
+ *
+ * @param referenceEdgeExtremityEp
+ * The reference edit part for one of the extremities of an edge.
+ * @param referenceSide
+ * The side of the reference.
+ * @param targetSide
+ * The other side, where the phantom has to be drawn.
+ * @return The phantom edit part used to attach the extremity of an edge phantom.
+ */
+ private EditPart getOrCreateExtremityPhantomEditPart(EditPart referenceEdgeExtremityEp,
+ MergeViewerSide referenceSide, MergeViewerSide targetSide) {
+ View referenceExtremityView = (View)referenceEdgeExtremityEp.getModel();
+
+ EditPart edgeExtremityEp = getOrCreatePhantomEditPart(referenceExtremityView, referenceSide,
+ targetSide);
+
+ if (isPhantomEditPart((AbstractGraphicalEditPart)edgeExtremityEp)) {
+
+ final AbstractGraphicalEditPart edgeExtremityEpParent = (AbstractGraphicalEditPart)edgeExtremityEp
+ .getParent();
+
+ List<Phantom> phantoms = getOrCreateRelatedPhantoms(referenceExtremityView, targetSide);
+ if (!phantoms.isEmpty()) {
+ Phantom phantomToTarget = phantoms.get(0);
+ final IFigure figureToTarget = phantomToTarget.getFigure();
+
+ edgeExtremityEp = new org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart(
+ referenceExtremityView) {
+ @Override
+ protected void createDefaultEditPolicies() {
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ RectangleFigure fig = new RectangleFigure();
+ fig.setBounds(figureToTarget.getBounds());
+ fig.setParent(edgeExtremityEpParent.getFigure());
+ return fig;
+ }
+ };
+
+ edgeExtremityEp.setParent(edgeExtremityEpParent);
+ }
+
+ ((AbstractGraphicalEditPart)edgeExtremityEp).activate();
+ ((AbstractGraphicalEditPart)edgeExtremityEp).getFigure();
+ }
+
+ return edgeExtremityEp;
+ }
+
+ /**
+ * It checks if the given edit part is related to a phantom edit part (created for nothing, without link
+ * to a GMF object in the target side).
+ *
+ * @param editPart
+ * The edit part to check.
+ * @return True if it is a phantom edit part, false otherwise.
+ */
+ private boolean isPhantomEditPart(AbstractGraphicalEditPart editPart) {
+ Rectangle targetBounds = editPart.getFigure().getBounds();
+ return targetBounds.x == 0 && targetBounds.y == 0 && targetBounds.width == 0
+ && targetBounds.height == 0;
+ }
+
+ /**
+ * It creates and returns a new edit part from the given view. This edit part listens the reference view
+ * but is attached to the controllers of the target (phantom) side.
+ *
+ * @param referenceView
+ * The view as base of the edit part.
+ * @param referenceSide
+ * The side of this view.
+ * @param targetSide
+ * The side where the edit part has to be created to draw the related phantom.
+ * @return The new edit part.
+ */
+ private EditPart getOrCreatePhantomEditPart(EObject referenceView, MergeViewerSide referenceSide,
+ MergeViewerSide targetSide) {
+ EditPart editPartParent = null;
+ EditPart editPart = null;
+ EditPart editPartReference = getViewer(referenceSide).getEditPart(referenceView);
+ EditPart editPartReferenceParent = editPartReference.getParent();
+ Object referenceViewParent = editPartReferenceParent.getModel();
+ if (!(referenceViewParent instanceof EObject)) {
+ referenceViewParent = referenceView.eContainer();
+ }
+ View viewParent = (View)getMatchView((EObject)referenceViewParent, targetSide);
+ if (viewParent != null) {
+ editPartParent = getViewer(targetSide).getEditPart(viewParent);
+ }
+ if (editPartParent == null) {
+ editPartParent = getOrCreatePhantomEditPart((EObject)referenceViewParent, referenceSide,
+ targetSide);
+
+ }
+ if (editPartParent != null) {
+ View view = (View)getMatchView(referenceView, targetSide);
+ if (view != null) {
+ editPart = getViewer(targetSide).getEditPart(view);
+ }
+ if (editPart == null) {
+
+ editPart = getViewer(targetSide).getGraphicalViewer().getEditPartFactory()
+ .createEditPart(editPartParent, referenceView);
+ editPart.setParent(editPartParent);
+ getViewer(targetSide).getGraphicalViewer().getEditPartRegistry().put(referenceView, editPart);
+
+ }
+
+ }
+ return editPart;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ for (Phantom phantom : fPhantomRegistry.values()) {
+ handleDeleteDecorator(phantom, phantom.getLayer(), phantom.getFigure());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.IDecoratorManager#getAllDecorators()
+ */
+ public Collection<AbstractDecorator> getAllDecorators() {
+ Collection<AbstractDecorator> phantoms = new ArrayList<AbstractDecorator>();
+ for (AbstractDecorator phantom : fPhantomRegistry.values()) {
+ phantoms.add(phantom);
+ }
+ return phantoms;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.checkstyle b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.checkstyle
new file mode 100644
index 000000000..43b833612
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.checkstyle
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <local-check-config name="EMF Compare" location="/org.eclipse.emf.compare-parent/codeStyle/EMFCompareCheckstyle6Configuration.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="all" enabled="true" check-config-name="EMF Compare" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+ <filter name="FilesFromPackage" enabled="true">
+ <filter-data value="src-gen"/>
+ </filter>
+</fileset-config>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.classpath b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.classpath
new file mode 100644
index 000000000..39810b7d6
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.project b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.project
new file mode 100644
index 000000000..b9a27bd78
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.diagram.sirius.tests.design</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.core.prefs
index 79ea86fdb..303696ee1 100644
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.core.prefs
@@ -7,10 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -101,8 +100,13 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
+org.eclipse.jdt.core.formatter.align_with_spaces=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -111,24 +115,39 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
@@ -137,6 +156,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
@@ -150,8 +170,11 @@ org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
@@ -160,7 +183,9 @@ org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=110
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
@@ -184,6 +209,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
@@ -206,11 +232,15 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -237,10 +267,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declar
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -265,13 +299,20 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -315,10 +356,13 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_decla
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -355,9 +399,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -369,21 +416,60 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_decla
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.lineSplit=110
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.text_block_indentation=0
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..7e2f24dd1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,67 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMF Compare
+formatter_settings_version=18
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.push_down_negation=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_modifiers=false
+sp_cleanup.remove_redundant_semicolons=false
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_array_creation=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_autoboxing=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_unboxing=false
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5f273ef5e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare.diagram.sirius.tests.design;singleton:=true
+Bundle-Version: 3.5.3.qualifier
+Bundle-Activator: org.eclipse.emf.compare.diagram.sirius.tests.design.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.sirius,
+ org.eclipse.sirius.common.acceleo.aql,
+ org.eclipse.emf.compare.tests;bundle-version="3.5.3"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Vendor: %providerName
+Automatic-Module-Name: org.eclipse.emf.compare.diagram.sirius.tests.design
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/about.html b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/about.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/build.properties b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/build.properties
new file mode 100644
index 000000000..b2823ec3f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/build.properties
@@ -0,0 +1,20 @@
+ #*******************************************************************************
+ # Copyright (c) 2020 Obeo.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ # Obeo - initial API and implementation
+ #******************************************************************************/
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ description/,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html
+src.includes = about.html,\
+ description/
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign
new file mode 100644
index 000000000..e1c780223
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http://www.eclipse.org/sirius/description/tool/1.1.0" name="nodes" version="12.0.0.2017041100">
+ <ownedViewpoints name="Nodes Design" modelFileExtension="nodes">
+ <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Nodes Diagram" domainClass="nodes::Node" enablePopupBars="true">
+ <metamodel href="../../org.eclipse.emf.compare.tests/model/nodes.ecore#/"/>
+ <defaultLayer name="Default">
+ <containerMappings name="ND_Node" detailDescriptions="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@toolSections.2/@ownedTools[name='ND_CreateNodeDiagram']" deletionDescription="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@toolSections.1/@ownedTools[name='ND_DeleteNode']" labelDirectEdit="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@toolSections.2/@ownedTools[name='ND_DirectEdit']" semanticCandidatesExpression="feature:containmentRef1" domainClass="nodes::Node" reusedContainerMappings="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']">
+ <style xsi:type="style:FlatContainerStyleDescription" borderSizeComputationExpression="1" labelSize="12">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
+ <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/>
+ </style>
+ </containerMappings>
+ <toolSections name="Creation Tools">
+ <ownedTools xsi:type="tool:ContainerCreationDescription" name="ND_CreateNode" label="Create Node" containerMappings="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']">
+ <variable name="container"/>
+ <viewVariable name="containerView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:CreateInstance" typeName="nodes::Node" referenceName="containmentRef1">
+ <subModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="aql:'Node'"/>
+ </firstModelOperations>
+ </initialOperation>
+ </ownedTools>
+ </toolSections>
+ <toolSections name="Deletion Tools">
+ <ownedTools xsi:type="tool:DeleteElementDescription" name="ND_DeleteNode" label="Delete Node">
+ <element name="element"/>
+ <elementView name="elementView"/>
+ <containerView name="containerView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:RemoveElement"/>
+ </initialOperation>
+ </ownedTools>
+ </toolSections>
+ <toolSections name="Usability Tools">
+ <ownedTools xsi:type="tool:DiagramCreationDescription" name="ND_CreateNodeDiagram" label="Nodes Diagram" diagramDescription="//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']">
+ <initialOperation/>
+ <containerViewVariable name="containerView"/>
+ <representationNameVariable name="diagramName"/>
+ </ownedTools>
+ <ownedTools xsi:type="tool:DirectEditLabel" name="ND_DirectEdit">
+ <mask mask="{0}"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="var:arg0"/>
+ </initialOperation>
+ </ownedTools>
+ </toolSections>
+ <toolSections name="Menu Tools">
+ <ownedTools xsi:type="tool_1:PopupMenu" name="ND_AddElement" label="Add">
+ <menuItemDescription xsi:type="tool_1:OperationAction" name="Node" precondition="aql:self.oclIsKindOf(nodes::Node)" icon="/org.eclipse.emf.compare.tests.edit/icons/full/obj16/Node.gif">
+ <view name="views"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool_1:CreateInstance" typeName="nodes::Node" referenceName="containmentRef1">
+ <subModelOperations xsi:type="tool_1:SetValue" featureName="name" valueExpression="aql:'Node'"/>
+ </firstModelOperations>
+ </initialOperation>
+ </menuItemDescription>
+ </ownedTools>
+ </toolSections>
+ </defaultLayer>
+ </ownedRepresentations>
+ <ownedJavaExtensions qualifiedClassName="org.eclipse.emf.compare.diagram.sirius.tests.design.Services"/>
+ </ownedViewpoints>
+</description:Group>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.properties
new file mode 100644
index 000000000..1195fdf2c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.properties
@@ -0,0 +1,14 @@
+################################################################################
+# Copyright (c) 2020 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare Tests Viewpoint specification
+providerName = Eclipse Modeling Project
+
+viewpointName = Nodes
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.xml
new file mode 100644
index 000000000..ef41a0e85
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/plugin.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension point="org.eclipse.sirius.componentization">
+ <component class="org.eclipse.emf.compare.diagram.sirius.tests.design.Activator"
+ id="org.eclipse.emf.compare.diagram.sirius.tests.design"
+ name="%viewpointName">
+ </component>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/pom.xml b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/pom.xml
new file mode 100644
index 000000000..4aff51f09
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2020 Obeo
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - Initial API and implementation
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>emf.compare-test-parent</artifactId>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent/test-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>org.eclipse.emf.compare.diagram.sirius.tests.design</artifactId>
+ <version>3.5.3-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Activator.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Activator.java
new file mode 100644
index 000000000..b6d216350
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Activator.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.tests.design;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.sirius.business.api.componentization.ViewpointRegistry;
+import org.eclipse.sirius.viewpoint.description.Viewpoint;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.emf.compare.diagram.sirius.tests.design"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ private static Set<Viewpoint> viewpoints;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ viewpoints = new HashSet<Viewpoint>();
+ viewpoints.addAll(
+ ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/nodes.odesign")); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ if (viewpoints != null) {
+ for (final Viewpoint viewpoint : viewpoints) {
+ ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint);
+ }
+ viewpoints.clear();
+ viewpoints = null;
+ }
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Services.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Services.java
new file mode 100644
index 000000000..c9cdc2cea
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests.design/src/org/eclipse/emf/compare/diagram/sirius/tests/design/Services.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.tests.design;
+
+/**
+ * The services class used by VSM.
+ */
+public class Services {
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.checkstyle b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.checkstyle
new file mode 100644
index 000000000..2684ff12f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <local-check-config name="EMF Compare" location="/org.eclipse.emf.compare-parent/codeStyle/EMFCompareCheckstyle6Configuration.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="all" enabled="true" check-config-name="EMF Compare" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.classpath b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.classpath
new file mode 100644
index 000000000..3e5654f17
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.project b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.project
new file mode 100644
index 000000000..f351ded3c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.diagram.sirius.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..303696ee1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,475 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=error
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeFieldsInNullAnalysis=disabled
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
+org.eclipse.jdt.core.formatter.align_with_spaces=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=110
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.lineSplit=110
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.text_block_indentation=0
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..7e2f24dd1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,67 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMF Compare
+formatter_settings_version=18
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.push_down_negation=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_modifiers=false
+sp_cleanup.remove_redundant_semicolons=false
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_array_creation=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_autoboxing=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_unboxing=false
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..a92a4e280
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare.diagram.sirius.tests
+Bundle-Version: 1.1.0.qualifier
+Bundle-Vendor: %providerName
+Automatic-Module-Name: org.eclipse.emf.compare.diagram.sirius.tests
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Localization: plugin
+Require-Bundle: org.junit,
+ org.mockito,
+ org.hamcrest,
+ org.eclipse.emf.compare.tests,
+ org.eclipse.emf.compare,
+ org.eclipse.emf.compare.diagram.sirius,
+ org.eclipse.emf.compare.diagram,
+ org.eclipse.sirius,
+ org.eclipse.emf.compare.ide.ui,
+ org.eclipse.emf.compare.rcp,
+ org.eclipse.emf.compare.edit,
+ org.eclipse.emf.compare.ide.ui.tests
+Export-Package: org.eclipse.emf.compare.diagram.sirius.tests
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/about.html b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/about.html
new file mode 100644
index 000000000..670d10856
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/build.properties b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/build.properties
new file mode 100644
index 000000000..e5cd41b4d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/build.properties
@@ -0,0 +1,17 @@
+ #*******************************************************************************
+ # Copyright (c) 2020 Obeo.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ # Obeo - initial API and implementation
+ #******************************************************************************/
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/plugin.properties
new file mode 100644
index 000000000..d5cf79ba2
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/plugin.properties
@@ -0,0 +1,12 @@
+################################################################################
+# Copyright (c) 2020 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare Sirius integration Tests
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/pom.xml b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/pom.xml
new file mode 100644
index 000000000..c1c1b9f2e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2020 Obeo
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - Initial API and implementation
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>emf.compare-test-parent</artifactId>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../org.eclipse.emf.compare-parent/test-parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>org.eclipse.emf.compare.diagram.sirius.tests</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org/eclipse/emf/compare/diagram/sirius/tests/suite/AllTests.class</include>
+ </includes>
+ <useUIHarness>true</useUIHarness>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/TestBug561458.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/TestBug561458.java
new file mode 100644
index 000000000..cfefcaca1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/TestBug561458.java
@@ -0,0 +1,319 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.internal;
+
+import static org.eclipse.emf.compare.DifferenceKind.ADD;
+import static org.eclipse.emf.compare.DifferenceKind.DELETE;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.sirius.tests.AbstractSiriusTest;
+import org.eclipse.emf.compare.merge.AbstractMerger;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.sirius.viewpoint.DMappingBased;
+import org.eclipse.sirius.viewpoint.DSemanticDecorator;
+import org.junit.Test;
+
+/**
+ * This test is related to the bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=561458">561458.</a>
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class TestBug561458 extends AbstractSiriusTest {
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The "addedContainers.aird" data resource.
+ */
+ private Resource addedContainers;
+
+ /**
+ * The "deletedContainers.aird" data resource.
+ */
+ private Resource deletedContainers;
+
+ /**
+ * The "singleAddedContainer.aird" data resource.
+ */
+ private Resource singleAddedContainer;
+
+ /**
+ * The "singleDeletedContainer.aird" data resource.
+ */
+ private Resource singleDeletedContainer;
+
+ /**
+ * Used to initialize the comparison scope.
+ */
+ private Resource origin;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ /**
+ * Set up the test models.
+ * <p>
+ * addedContainers.nodes: In this model we have a tree nodes structured like this:
+ * <ul>
+ * <li>A Node "A" that holds a Node "B" that holds a Node "C" that holds a Node "D".</li>
+ * </ul>
+ * deletedContainers.nodes: In this model "C" and "D" have been deleted.
+ * </p>
+ * <p>
+ * A 2-way comparison between their representations files addedContainers.aird and deletedContainers.aird
+ * gives us these differences in particular:
+ * <ul>
+ * <li>A ReferenceChange difference for the addition/deletion of "C" DNodeContainer.</li>
+ * <li>A ReferenceChange difference for the addition/deletion of "D" DNodeContainer.</li>
+ * <li>A ReferenceChange difference for the modification of "C.actualMapping" ContainerMapping.</li>
+ * <li>A ReferenceChange difference for the modification of "D.actualMapping" ContainerMapping.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * singleAddedContainer.nodes: In this model we have a tree nodes structured like this:
+ * <ul>
+ * <li>A Node "A" that holds a Node "B".</li>
+ * </ul>
+ * singleDeletedContainer.nodes: In this model "B" has been deleted.
+ * </p>
+ * <p>
+ * A 2-way comparison between their representations files singleAddedContainer.aird and
+ * singleDeletedContainer.aird gives us these differences in particular:
+ * <ul>
+ * <li>A ReferenceChange difference for the addition/deletion of "B" DNodeContainer.</li>
+ * <li>A ReferenceChange difference for the modification of "B.actualMapping" ContainerMapping.</li>
+ * </ul>
+ * </p>
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Override
+ public void setUp() throws IOException {
+ super.setUp();
+ Bug561458 inputData = new Bug561458();
+ addedContainers = inputData.getResource("addedContainers.aird"); //$NON-NLS-1$
+ deletedContainers = inputData.getResource("deletedContainers.aird"); //$NON-NLS-1$
+ singleAddedContainer = inputData.getResource("singleAddedContainer.aird"); //$NON-NLS-1$
+ singleDeletedContainer = inputData.getResource("singleDeletedContainer.aird"); //$NON-NLS-1$
+ origin = null;
+ }
+
+ /**
+ * Tests that the added node difference implies its mapping difference.
+ */
+ @Test
+ public void testSingleAddedContainerImpliesMapping() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<ReferenceChange> decorators = getAddedOrRemovedDecorators();
+
+ ReferenceChange addedDiff = decorators.get(0);
+ DSemanticDecorator value = (DSemanticDecorator)addedDiff.getValue();
+ Diff mapping = comparison.getDifferences(((DMappingBased)value).getMapping()).get(0);
+
+ assertTrue(addedDiff.getKind() == ADD);
+ assertEquals(mapping, addedDiff.getImplies().get(0));
+ }
+
+ /**
+ * Tests that the deleted node difference is implied by its mapping difference.
+ */
+ @Test
+ public void testSingleDeletedContainerImpliedByMapping() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<ReferenceChange> decorators = getAddedOrRemovedDecorators();
+
+ ReferenceChange deletedDiff = decorators.get(0);
+ DSemanticDecorator value = (DSemanticDecorator)deletedDiff.getValue();
+ Diff mapping = comparison.getDifferences(((DMappingBased)value).getMapping()).get(0);
+
+ assertTrue(deletedDiff.getKind() == DELETE);
+ assertEquals(mapping, deletedDiff.getImpliedBy().get(0));
+ }
+
+ /**
+ * Tests that the added nodes differences implies their mapping difference.
+ */
+ @Test
+ public void testAddedContainersImpliesMapping() {
+ scope = new DefaultComparisonScope(addedContainers, deletedContainers, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<ReferenceChange> decorators = getAddedOrRemovedDecorators();
+
+ ReferenceChange firstAddedDiff = decorators.get(0);
+ DSemanticDecorator firstValue = (DSemanticDecorator)firstAddedDiff.getValue();
+ Diff firstMapping = comparison.getDifferences(((DMappingBased)firstValue).getMapping()).get(0);
+
+ ReferenceChange secondAddedDiff = decorators.get(1);
+ DSemanticDecorator secondValue = (DSemanticDecorator)secondAddedDiff.getValue();
+ Diff secondMapping = comparison.getDifferences(((DMappingBased)secondValue).getMapping()).get(0);
+
+ assertTrue(firstAddedDiff.getKind() == ADD);
+ assertTrue(secondAddedDiff.getKind() == ADD);
+ assertEquals(firstMapping, firstAddedDiff.getImplies().get(0));
+ assertEquals(secondMapping, secondAddedDiff.getImplies().get(0));
+ }
+
+ /**
+ * Tests that the deleted nodes differences are implied by their mapping difference.
+ */
+ @Test
+ public void testDeletedContainersImpliedByMapping() {
+ scope = new DefaultComparisonScope(deletedContainers, addedContainers, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ List<ReferenceChange> decorators = getAddedOrRemovedDecorators();
+
+ ReferenceChange firstDeletedDiff = decorators.get(0);
+ DSemanticDecorator firstValue = (DSemanticDecorator)firstDeletedDiff.getValue();
+ Diff firstMapping = comparison.getDifferences(((DMappingBased)firstValue).getMapping()).get(0);
+
+ ReferenceChange secondDeletedDiff = decorators.get(1);
+ DSemanticDecorator secondValue = (DSemanticDecorator)secondDeletedDiff.getValue();
+ Diff secondMapping = comparison.getDifferences(((DMappingBased)secondValue).getMapping()).get(0);
+
+ assertTrue(firstDeletedDiff.getKind() == DELETE);
+ assertTrue(secondDeletedDiff.getKind() == DELETE);
+ assertEquals(firstMapping, firstDeletedDiff.getImpliedBy().get(0));
+ assertEquals(secondMapping, secondDeletedDiff.getImpliedBy().get(0));
+ }
+
+ /**
+ * Tests that the merge from right to left of a deleted container does not fail.
+ */
+ @Test
+ public void testMergeRightToLeftDeletedContainer() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from left to right of a deleted container does not fail.
+ */
+ @Test
+ public void testMergeLeftToRightDeletedContainer() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from right to left of an added container does not fail.
+ */
+ @Test
+ public void testMergeRightToLeftAddedContainer() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from left to right of an added container does not fail.
+ */
+ @Test
+ public void testMergeLeftToRightAddedContainer() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * It creates a collection of differences with DSemanticDecorator type values that have been added or
+ * deleted.
+ *
+ * @see org.eclipse.sirius.viewpoint.DSemanticDecorator
+ * @return the list of added or removed decorators
+ */
+ protected List<ReferenceChange> getAddedOrRemovedDecorators() {
+ Stream<ReferenceChange> refChanges = comparison.getDifferences().stream()
+ .filter(diff -> diff instanceof ReferenceChange
+ && ((ReferenceChange)diff).getReference().isContainment())
+ .map(ReferenceChange.class::cast);
+ Stream<ReferenceChange> addedOrRemovedSemanticDecorators = refChanges
+ .filter(diff -> diff.getValue() instanceof DSemanticDecorator);
+ return addedOrRemovedSemanticDecorators.collect(Collectors.toList());
+ }
+
+ /**
+ * Getter for the scope.
+ *
+ * @return scope.
+ */
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+
+ /**
+ * Input data for this bug.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+ public class Bug561458 extends AbstractInputData {
+
+ /**
+ * The data path.
+ */
+ private static final String PATH_PREFIX = "data/_561458/"; //$NON-NLS-1$
+
+ /**
+ * Used to load a resource.
+ *
+ * @param resourceName
+ * the resource to load.
+ * @return the resource loaded.
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getResource(String resourceName) throws IOException {
+ StringBuilder resourceURL = new StringBuilder(PATH_PREFIX);
+ resourceURL.append(resourceName);
+ return loadFromClassLoader(resourceURL.toString());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.aird
new file mode 100644
index 000000000..6ea1c31bc
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.aird
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_q_I48G9LEeqceciJOW5Tyg" selectedViews="_29VwUG9LEeqceciJOW5Tyg" version="14.3.0.201909031200">
+ <semanticResources>addedContainers.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_29VwUG9LEeqceciJOW5Tyg">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_3PfQQW9LEeqceciJOW5Tyg" name="new Nodes Diagram" repPath="#_3Pbl4G9LEeqceciJOW5Tyg" changeId="219f3da6-4a34-4459-a7a7-0d460e89ef6a">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="addedContainers.nodes#_u9iBIG9LEeqceciJOW5Tyg"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_3Pbl4G9LEeqceciJOW5Tyg">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_3PdbEG9LEeqceciJOW5Tyg" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_3PdbEW9LEeqceciJOW5Tyg"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_3PlW4G9LEeqceciJOW5Tyg" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_3PlW4W9LEeqceciJOW5Tyg" type="Sirius" element="_3Pbl4G9LEeqceciJOW5Tyg" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_3R9VcG9LEeqceciJOW5Tyg" type="2002" element="_3R4c8G9LEeqceciJOW5Tyg">
+ <children xmi:type="notation:Node" xmi:id="_3R_KoG9LEeqceciJOW5Tyg" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_3R_xsG9LEeqceciJOW5Tyg" type="7001">
+ <children xmi:type="notation:Node" xmi:id="_3R_xs29LEeqceciJOW5Tyg" type="3008" element="_3R65MG9LEeqceciJOW5Tyg">
+ <children xmi:type="notation:Node" xmi:id="_3SAYwG9LEeqceciJOW5Tyg" type="5005"/>
+ <children xmi:type="notation:Node" xmi:id="_3SAYwW9LEeqceciJOW5Tyg" type="7002">
+ <children xmi:type="notation:Node" xmi:id="_3SA_0G9LEeqceciJOW5Tyg" type="3008" element="_3R65M29LEeqceciJOW5Tyg">
+ <children xmi:type="notation:Node" xmi:id="_3SA_029LEeqceciJOW5Tyg" type="5005"/>
+ <children xmi:type="notation:Node" xmi:id="_3SA_1G9LEeqceciJOW5Tyg" type="7002">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_3SA_1W9LEeqceciJOW5Tyg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_3SA_1m9LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_3SA_0W9LEeqceciJOW5Tyg" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3SA_0m9LEeqceciJOW5Tyg" x="30" y="29"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_3SAYwm9LEeqceciJOW5Tyg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_3SAYw29LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_3R_xtG9LEeqceciJOW5Tyg" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3R_xtW9LEeqceciJOW5Tyg" x="30" y="29"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_3R_xsW9LEeqceciJOW5Tyg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_3R_xsm9LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_3R9VcW9LEeqceciJOW5Tyg" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3R9Vcm9LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_3PlW4m9LEeqceciJOW5Tyg"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_3R4c8G9LEeqceciJOW5Tyg" name="B">
+ <target xmi:type="nodes:Node" href="addedContainers.nodes#_yl0WcG9LEeqceciJOW5Tyg"/>
+ <semanticElements xmi:type="nodes:Node" href="addedContainers.nodes#_yl0WcG9LEeqceciJOW5Tyg"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_3R5rEG9LEeqceciJOW5Tyg" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_3R65MG9LEeqceciJOW5Tyg" name="C">
+ <target xmi:type="nodes:Node" href="addedContainers.nodes#_y1xeAG9LEeqceciJOW5Tyg"/>
+ <semanticElements xmi:type="nodes:Node" href="addedContainers.nodes#_y1xeAG9LEeqceciJOW5Tyg"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_3R65MW9LEeqceciJOW5Tyg" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_3R65M29LEeqceciJOW5Tyg" name="D">
+ <target xmi:type="nodes:Node" href="addedContainers.nodes#_zMAzwG9LEeqceciJOW5Tyg"/>
+ <semanticElements xmi:type="nodes:Node" href="addedContainers.nodes#_zMAzwG9LEeqceciJOW5Tyg"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_3R65NG9LEeqceciJOW5Tyg" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ </ownedDiagramElements>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_3PcM8G9LEeqceciJOW5Tyg"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="addedContainers.nodes#_u9iBIG9LEeqceciJOW5Tyg"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.nodes
new file mode 100644
index 000000000..c91fb62b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/addedContainers.nodes
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_u9iBIG9LEeqceciJOW5Tyg" name="A">
+ <containmentRef1 xmi:id="_yl0WcG9LEeqceciJOW5Tyg" name="B">
+ <containmentRef1 xmi:id="_y1xeAG9LEeqceciJOW5Tyg" name="C">
+ <containmentRef1 xmi:id="_zMAzwG9LEeqceciJOW5Tyg" name="D"/>
+ </containmentRef1>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.aird
new file mode 100644
index 000000000..1a02ddae5
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.aird
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_q_I48G9LEeqceciJOW5Tyg" selectedViews="_29VwUG9LEeqceciJOW5Tyg" version="14.3.0.201909031200">
+ <semanticResources>deletedContainers.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_29VwUG9LEeqceciJOW5Tyg">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_3PfQQW9LEeqceciJOW5Tyg" name="new Nodes Diagram" repPath="#_3Pbl4G9LEeqceciJOW5Tyg" changeId="f6613245-be3f-4de2-a066-8fac5059883e">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="deletedContainers.nodes#_u9iBIG9LEeqceciJOW5Tyg"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_3Pbl4G9LEeqceciJOW5Tyg">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_3PdbEG9LEeqceciJOW5Tyg" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_3PdbEW9LEeqceciJOW5Tyg"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_3PlW4G9LEeqceciJOW5Tyg" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_3PlW4W9LEeqceciJOW5Tyg" type="Sirius" element="_3Pbl4G9LEeqceciJOW5Tyg" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_3R9VcG9LEeqceciJOW5Tyg" type="2002" element="_3R4c8G9LEeqceciJOW5Tyg">
+ <children xmi:type="notation:Node" xmi:id="_3R_KoG9LEeqceciJOW5Tyg" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_3R_xsG9LEeqceciJOW5Tyg" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_3R_xsW9LEeqceciJOW5Tyg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_3R_xsm9LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_3R9VcW9LEeqceciJOW5Tyg" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3R9Vcm9LEeqceciJOW5Tyg"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_3PlW4m9LEeqceciJOW5Tyg"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_3R4c8G9LEeqceciJOW5Tyg" name="B">
+ <target xmi:type="nodes:Node" href="deletedContainers.nodes#_yl0WcG9LEeqceciJOW5Tyg"/>
+ <semanticElements xmi:type="nodes:Node" href="deletedContainers.nodes#_yl0WcG9LEeqceciJOW5Tyg"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_3R5rEG9LEeqceciJOW5Tyg" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_3PcM8G9LEeqceciJOW5Tyg"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="deletedContainers.nodes#_u9iBIG9LEeqceciJOW5Tyg"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.nodes
new file mode 100644
index 000000000..8a74467df
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/deletedContainers.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_u9iBIG9LEeqceciJOW5Tyg" name="A">
+ <containmentRef1 xmi:id="_yl0WcG9LEeqceciJOW5Tyg" name="B"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.aird
new file mode 100644
index 000000000..a8c1a81f9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.aird
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleAddedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="b0a77288-bf38-43c5-942e-b53e26d9dbee">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_JSQrkHAwEeqXy8bBNMW8cQ" type="2002" element="_JROw0HAwEeqXy8bBNMW8cQ">
+ <children xmi:type="notation:Node" xmi:id="_JSYAUHAwEeqXy8bBNMW8cQ" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_JSZOcHAwEeqXy8bBNMW8cQ" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JSZOcXAwEeqXy8bBNMW8cQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JSZOcnAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_JSQrkXAwEeqXy8bBNMW8cQ" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JSQrknAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_JROw0HAwEeqXy8bBNMW8cQ" name="B">
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <semanticElements xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_JRSbMHAwEeqXy8bBNMW8cQ" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.nodes
new file mode 100644
index 000000000..3e48cff63
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleAddedContainer.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A">
+ <containmentRef1 xmi:id="_EOwVcHAwEeqXy8bBNMW8cQ" name="B"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.aird
new file mode 100644
index 000000000..e71f2f1eb
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.aird
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleDeletedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="005005d3-0211-4680-ba81-333f77b59742">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.nodes
new file mode 100644
index 000000000..2f2855297
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/data/_561458/singleDeletedContainer.nodes
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug561825.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug561825.java
new file mode 100644
index 000000000..74ce15b96
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug561825.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.sirius.tests.AbstractSiriusTest;
+import org.eclipse.emf.compare.merge.AbstractMerger;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.sirius.viewpoint.DMappingBased;
+import org.eclipse.sirius.viewpoint.description.RepresentationElementMapping;
+import org.junit.Test;
+
+/**
+ * This test is related to the bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=561825">561825.</a>
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class TestBug561825 extends AbstractSiriusTest {
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The "singleAddedContainer.aird" data resource.
+ */
+ private Resource singleAddedContainer;
+
+ /**
+ * The "singleDeletedContainer.aird" data resource.
+ */
+ private Resource singleDeletedContainer;
+
+ /**
+ * Used to initialize the comparison scope.
+ */
+ private Resource origin;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ /**
+ * Set up the test models.
+ * <p>
+ * singleAddedContainer.nodes: In this model we have a tree nodes structured like this:
+ * <ul>
+ * <li>A Node "A" that holds a Node "B".</li>
+ * </ul>
+ * singleDeletedContainer.nodes: In this model "B" has been deleted.
+ * </p>
+ * <p>
+ * A 2-way comparison between their representations files singleAddedContainer.aird and
+ * singleDeletedContainer.aird gives us these differences in particular:
+ * <ul>
+ * <li>A ReferenceChange difference for the addition/deletion of "B" DNodeContainer.</li>
+ * <li>A ReferenceChange difference for the modification of "B.actualMapping" ContainerMapping.</li>
+ * </ul>
+ * </p>
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Override
+ public void setUp() throws IOException {
+ super.setUp();
+ Bug561825 inputData = new Bug561825();
+ singleAddedContainer = inputData.getResource("singleAddedContainer.aird"); //$NON-NLS-1$
+ singleDeletedContainer = inputData.getResource("singleDeletedContainer.aird"); //$NON-NLS-1$
+ origin = null;
+ }
+
+ /**
+ * Tests that the merge from right to left of a deleted container on the left correctly sets the left
+ * value of the match corresponding to the mapping, and also the mapping of this value, without failing.
+ */
+ @Test
+ public void testSingleDeletedContainerMappingSet() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ ReferenceChange mappingDiff = getRepresentationElementMappingDiffs(comparison.getDifferences())
+ .get(0);
+ ReferenceChange nodeDiff = getDMappingBasedDiffs(comparison.getDifferences()).get(0);
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+
+ assertEquals(comparison.getMatch(nodeDiff.getValue()), mappingDiff.getMatch());
+ assertNotNull(mappingDiff.getMatch().getLeft());
+ assertTrue(mappingDiff.getMatch().getLeft() instanceof DMappingBased);
+ assertNotNull(((DMappingBased)mappingDiff.getMatch().getLeft()).getMapping());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from left to right of a deleted container on the left correctly unsets the right
+ * value of the match corresponding to the mapping, without failing.
+ */
+ @Test
+ public void testSingleDeletedContainerMappingUnset() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ ReferenceChange mappingDiff = getRepresentationElementMappingDiffs(comparison.getDifferences())
+ .get(0);
+ ReferenceChange nodeDiff = getDMappingBasedDiffs(comparison.getDifferences()).get(0);
+
+ Match valueMatch = comparison.getMatch(nodeDiff.getValue());
+ mergeDiffsLeftToRight(comparison.getDifferences());
+
+ assertEquals(valueMatch, mappingDiff.getMatch());
+ assertNull(comparison.getMatch(nodeDiff.getValue()));
+ assertNull(mappingDiff.getMatch().getRight());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from left to right of an added container on the left correctly sets the right
+ * value of the match corresponding to the mapping, and also the mapping of this value, without failing.
+ */
+ @Test
+ public void testSingleAddedContainerMappingSet() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ ReferenceChange mappingDiff = getRepresentationElementMappingDiffs(comparison.getDifferences())
+ .get(0);
+ ReferenceChange nodeDiff = getDMappingBasedDiffs(comparison.getDifferences()).get(0);
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+
+ assertEquals(comparison.getMatch(nodeDiff.getValue()), mappingDiff.getMatch());
+ assertNotNull(mappingDiff.getMatch().getRight());
+ assertTrue(mappingDiff.getMatch().getRight() instanceof DMappingBased);
+ assertNotNull(((DMappingBased)mappingDiff.getMatch().getRight()).getMapping());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Tests that the merge from right to left of an added container on the left correctly unsets the left
+ * value of the match corresponding to the mapping, without failing.
+ */
+ @Test
+ public void testSingleAddedContainerMappingUnset() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(scope);
+ ReferenceChange mappingDiff = getRepresentationElementMappingDiffs(comparison.getDifferences())
+ .get(0);
+ ReferenceChange nodeDiff = getDMappingBasedDiffs(comparison.getDifferences()).get(0);
+
+ Match valueMatch = comparison.getMatch(nodeDiff.getValue());
+ mergeDiffsRightToLeft(comparison.getDifferences());
+
+ assertEquals(valueMatch, mappingDiff.getMatch());
+ assertNull(comparison.getMatch(nodeDiff.getValue()));
+ assertNull(mappingDiff.getMatch().getLeft());
+ comparison.getDifferences().forEach(diff -> assertTrue(AbstractMerger.isInTerminalState(diff)));
+ }
+
+ /**
+ * Filters a list of differences by keeping only the differences concerned by a mapping in their "implied"
+ * relation.
+ *
+ * @param differences
+ * the list of differences to filter.
+ * @return the differences concerned by a mapping in their "implied" relation.
+ */
+ private Stream<ReferenceChange> filterMappingDifferences(List<Diff> differences) {
+ Stream<ReferenceChange> refChanges = differences.stream()
+ .filter(diff -> diff instanceof ReferenceChange).map(ReferenceChange.class::cast);
+ Stream<ReferenceChange> mappingDifferences = refChanges
+ .filter(diff -> (!diff.getImpliedBy().isEmpty() || !diff.getImplies().isEmpty())
+ && (diff.getValue() instanceof DMappingBased
+ || diff.getValue() instanceof RepresentationElementMapping));
+ return mappingDifferences;
+
+ }
+
+ /**
+ * Used to filter a list by keeping only the differences with RepresentationElementMapping type values.
+ *
+ * @see org.eclipse.sirius.viewpoint.description.RepresentationElementMapping
+ * @param differences
+ * the list of differences to filter.
+ * @return the list of mappings differences.
+ */
+ private List<ReferenceChange> getRepresentationElementMappingDiffs(List<Diff> differences) {
+ return filterMappingDifferences(differences)
+ .filter(diff -> diff.getValue() instanceof RepresentationElementMapping)
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Used to filter a list by keeping only the differences with DMappingBased type values, such as DNode,
+ * DNodeContainer and DEdge.
+ *
+ * @see org.eclipse.sirius.viewpoint.DMappingBased
+ * @param differences
+ * the list of differences to filter.
+ * @return the list of DMappingBased differences.
+ */
+ private List<ReferenceChange> getDMappingBasedDiffs(List<Diff> differences) {
+ return filterMappingDifferences(differences).filter(diff -> diff.getValue() instanceof DMappingBased)
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Getter for the scope.
+ *
+ * @return scope.
+ */
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+
+ /**
+ * Input data for this bug.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+ public class Bug561825 extends AbstractInputData {
+
+ /**
+ * The data path.
+ */
+ private static final String PATH_PREFIX = "data/_561825/"; //$NON-NLS-1$
+
+ /**
+ * Used to load a resource.
+ *
+ * @param resourceName
+ * the resource to load.
+ * @return the resource loaded.
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getResource(String resourceName) throws IOException {
+ StringBuilder resourceURL = new StringBuilder(PATH_PREFIX);
+ resourceURL.append(resourceName);
+ return loadFromClassLoader(resourceURL.toString());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug562321.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug562321.java
new file mode 100644
index 000000000..d2ad61c3d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/TestBug562321.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.internal.merge;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.sirius.tests.AbstractSiriusTest;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.sirius.viewpoint.DRepresentationElement;
+import org.junit.Test;
+
+/**
+ * This test is related to the bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=562321">562321.</a>
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class TestBug562321 extends AbstractSiriusTest {
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The "singleAddedContainer.aird" data resource.
+ */
+ private Resource singleAddedContainer;
+
+ /**
+ * The "singleDeletedContainer.aird" data resource.
+ */
+ private Resource singleDeletedContainer;
+
+ /**
+ * Used to initialize the comparison scope.
+ */
+ private Resource origin;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ /**
+ * Set up the test models.
+ * <p>
+ * singleAddedContainer.nodes: In this model we have a tree nodes structured like this:
+ * <ul>
+ * <li>A Node "A" that holds a Node "B".</li>
+ * </ul>
+ * singleDeletedContainer.nodes: In this model "B" has been deleted.
+ * </p>
+ * <p>
+ * A 2-way comparison between their representations files singleAddedContainer.aird and
+ * singleDeletedContainer.aird gives us these differences in particular:
+ * <ul>
+ * <li>A ReferenceChange difference for the addition/deletion of "B" DNodeContainer.</li>
+ * <li>A ReferenceChange difference for the modification of "B.actualMapping" ContainerMapping.</li>
+ * </ul>
+ * </p>
+ *
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ @Override
+ public void setUp() throws IOException {
+ super.setUp();
+ Bug562321InputData inputData = new Bug562321InputData();
+ singleAddedContainer = inputData.getResource("singleAddedContainer.aird"); //$NON-NLS-1$
+ singleDeletedContainer = inputData.getResource("singleDeletedContainer.aird"); //$NON-NLS-1$
+ origin = null;
+ }
+
+ /**
+ * Tests that the undo and redo actions after a merge from right to left of a deleted container on the
+ * left correctly restores the model to its previous state.
+ */
+ @Test
+ public void testUndoRedoR2LSingleDeletedContainer() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(getScope());
+
+ DRepresentationElement node = getSiriusNodes(comparison.getDifferences()).get(0);
+ Match valueMatch = comparison.getMatch(node);
+
+ assertEquals(node, valueMatch.getRight());
+ assertNull(valueMatch.getLeft());
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ assertNodeIsSet((DRepresentationElement)valueMatch.getLeft());
+
+ undo();
+ assertNull(valueMatch.getLeft());
+
+ redo();
+ assertNodeIsSet((DRepresentationElement)valueMatch.getLeft());
+ }
+
+ /**
+ * Tests that the undo and redo actions after a merge from left to right of a deleted container on the
+ * left correctly restores the model to its previous state.
+ */
+ @Test
+ public void testUndoRedoL2RSingleDeletedContainer() {
+ scope = new DefaultComparisonScope(singleDeletedContainer, singleAddedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(getScope());
+
+ DRepresentationElement node = getSiriusNodes(comparison.getDifferences()).get(0);
+ Match valueMatch = comparison.getMatch(node);
+
+ assertEquals(node, valueMatch.getRight());
+ assertNodeIsSet(node);
+ assertNull(valueMatch.getLeft());
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ assertNodeIsUnset(node);
+ assertNull(valueMatch.getRight());
+
+ undo();
+ assertNodeIsSet(node);
+ assertEquals(node, valueMatch.getRight());
+
+ redo();
+ assertNodeIsUnset(node);
+ assertNull(valueMatch.getRight());
+ }
+
+ /**
+ * Tests that the undo and redo actions after a merge from right to left of an added container on the left
+ * correctly restores the model to its previous state.
+ */
+ @Test
+ public void testUndoRedoR2LSingleAddedContainer() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(getScope());
+
+ DRepresentationElement node = getSiriusNodes(comparison.getDifferences()).get(0);
+ Match valueMatch = comparison.getMatch(node);
+
+ assertEquals(node, valueMatch.getLeft());
+ assertNodeIsSet(node);
+ assertNull(valueMatch.getRight());
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ assertNodeIsUnset(node);
+ assertNull(valueMatch.getLeft());
+
+ undo();
+ assertNodeIsSet(node);
+ assertEquals(node, valueMatch.getLeft());
+
+ redo();
+ assertNodeIsUnset(node);
+ assertNull(valueMatch.getLeft());
+ }
+
+ /**
+ * Tests that the undo and redo actions after a merge from left to right of an added container on the left
+ * correctly restores the model to its previous state.
+ */
+ @Test
+ public void testUndoRedoL2RSingleAddedContainer() {
+ scope = new DefaultComparisonScope(singleAddedContainer, singleDeletedContainer, origin);
+ comparison = EMFCompare.builder().setPostProcessorRegistry(getPostProcessorRegistry()).build()
+ .compare(getScope());
+
+ DRepresentationElement node = getSiriusNodes(comparison.getDifferences()).get(0);
+ Match valueMatch = comparison.getMatch(node);
+
+ assertEquals(node, valueMatch.getLeft());
+ assertNull(valueMatch.getRight());
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ assertNodeIsSet((DRepresentationElement)valueMatch.getRight());
+
+ undo();
+ assertNull(valueMatch.getRight());
+
+ redo();
+ assertNodeIsSet((DRepresentationElement)valueMatch.getRight());
+ }
+
+ /**
+ * Ensures that the given node is correctly unset.
+ *
+ * @param node
+ * the Sirius Node to check.
+ */
+ private static void assertNodeIsUnset(DRepresentationElement node) {
+ assertNull(node.getMapping());
+ assertNull(node.getTarget());
+ assertTrue(node.getSemanticElements().isEmpty());
+ }
+
+ /**
+ * Ensures that the given node is correctly set.
+ *
+ * @param node
+ * the Sirius Node to check.
+ */
+ private static void assertNodeIsSet(DRepresentationElement node) {
+ assertNotNull(node.getMapping());
+ assertNotNull(node.getTarget());
+ assertFalse(node.getSemanticElements().isEmpty());
+ }
+
+ /**
+ * Provides access to Sirius Nodes that exist in the difference list.
+ *
+ * @param differences
+ * the list of differences.
+ * @return the list of Sirius Nodes.
+ */
+ protected List<DRepresentationElement> getSiriusNodes(List<Diff> differences) {
+ Set<ReferenceChange> siriusDiff = differences.stream().filter(diff -> diff instanceof ReferenceChange)
+ .map(ReferenceChange.class::cast)
+ .filter(diff -> diff.getValue() instanceof DRepresentationElement)
+ .collect(Collectors.toSet());
+
+ Set<DRepresentationElement> siriusNodes = new HashSet<DRepresentationElement>();
+ for (ReferenceChange diff : siriusDiff) {
+ siriusNodes.add((DRepresentationElement)diff.getValue());
+ }
+ return new ArrayList<DRepresentationElement>(siriusNodes);
+ }
+
+ /**
+ * Getter for the scope.
+ *
+ * @return scope.
+ */
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+
+ /**
+ * Input data for this bug.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+ public class Bug562321InputData extends AbstractInputData {
+
+ /**
+ * The data path.
+ */
+ private static final String PATH_PREFIX = "data/_562321/"; //$NON-NLS-1$
+
+ /**
+ * Used to load a resource.
+ *
+ * @param resourceName
+ * the resource to load.
+ * @return the resource loaded.
+ * @throws IOException
+ * Thrown if we could not access either this class' resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getResource(String resourceName) throws IOException {
+ StringBuilder resourceURL = new StringBuilder(PATH_PREFIX);
+ resourceURL.append(resourceName);
+ return loadFromClassLoader(resourceURL.toString());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.aird
new file mode 100644
index 000000000..a8c1a81f9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.aird
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleAddedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="b0a77288-bf38-43c5-942e-b53e26d9dbee">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_JSQrkHAwEeqXy8bBNMW8cQ" type="2002" element="_JROw0HAwEeqXy8bBNMW8cQ">
+ <children xmi:type="notation:Node" xmi:id="_JSYAUHAwEeqXy8bBNMW8cQ" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_JSZOcHAwEeqXy8bBNMW8cQ" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JSZOcXAwEeqXy8bBNMW8cQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JSZOcnAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_JSQrkXAwEeqXy8bBNMW8cQ" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JSQrknAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_JROw0HAwEeqXy8bBNMW8cQ" name="B">
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <semanticElements xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_JRSbMHAwEeqXy8bBNMW8cQ" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.nodes
new file mode 100644
index 000000000..3e48cff63
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleAddedContainer.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A">
+ <containmentRef1 xmi:id="_EOwVcHAwEeqXy8bBNMW8cQ" name="B"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.aird
new file mode 100644
index 000000000..e71f2f1eb
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.aird
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleDeletedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="005005d3-0211-4680-ba81-333f77b59742">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.nodes
new file mode 100644
index 000000000..2f2855297
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_561825/singleDeletedContainer.nodes
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.aird
new file mode 100644
index 000000000..a8c1a81f9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.aird
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleAddedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="b0a77288-bf38-43c5-942e-b53e26d9dbee">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_JSQrkHAwEeqXy8bBNMW8cQ" type="2002" element="_JROw0HAwEeqXy8bBNMW8cQ">
+ <children xmi:type="notation:Node" xmi:id="_JSYAUHAwEeqXy8bBNMW8cQ" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_JSZOcHAwEeqXy8bBNMW8cQ" type="7001">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_JSZOcXAwEeqXy8bBNMW8cQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_JSZOcnAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_JSQrkXAwEeqXy8bBNMW8cQ" fontName="Segoe UI" fontHeight="12"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JSQrknAwEeqXy8bBNMW8cQ"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" uid="_JROw0HAwEeqXy8bBNMW8cQ" name="B">
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <semanticElements xmi:type="nodes:Node" href="singleAddedContainer.nodes#_EOwVcHAwEeqXy8bBNMW8cQ"/>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_JRSbMHAwEeqXy8bBNMW8cQ" labelSize="12" borderSize="1" borderSizeComputationExpression="1">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer/@containerMappings[name='ND_Node']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleAddedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.nodes
new file mode 100644
index 000000000..3e48cff63
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleAddedContainer.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A">
+ <containmentRef1 xmi:id="_EOwVcHAwEeqXy8bBNMW8cQ" name="B"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.aird b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.aird
new file mode 100644
index 000000000..e71f2f1eb
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.aird
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description">
+ <viewpoint:DAnalysis uid="_4LbGcHAvEeqXy8bBNMW8cQ" selectedViews="_I9pGcHAwEeqXy8bBNMW8cQ" version="14.3.0.201909031200">
+ <semanticResources>singleDeletedContainer.nodes</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" uid="_I9pGcHAwEeqXy8bBNMW8cQ">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_JRkIAXAwEeqXy8bBNMW8cQ" name="new Nodes Diagram" repPath="#_JQLA4HAwEeqXy8bBNMW8cQ" changeId="005005d3-0211-4680-ba81-333f77b59742">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram uid="_JQLA4HAwEeqXy8bBNMW8cQ">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JRhrwHAwEeqXy8bBNMW8cQ" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_JRhrwXAwEeqXy8bBNMW8cQ"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_JSCCEHAwEeqXy8bBNMW8cQ" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_JSCpIHAwEeqXy8bBNMW8cQ" type="Sirius" element="_JQLA4HAwEeqXy8bBNMW8cQ" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_JSCpIXAwEeqXy8bBNMW8cQ"/>
+ </data>
+ </ownedAnnotationEntries>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_JQZqYHAwEeqXy8bBNMW8cQ"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.compare.diagram.sirius.tests.design/description/nodes.odesign#//@ownedViewpoints[name='Nodes%20Design']/@ownedRepresentations[name='Nodes%20Diagram']/@defaultLayer"/>
+ <target xmi:type="nodes:Node" href="singleDeletedContainer.nodes#__XENwHAvEeqXy8bBNMW8cQ"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.nodes b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.nodes
new file mode 100644
index 000000000..2f2855297
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/data/_562321/singleDeletedContainer.nodes
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="__XENwHAvEeqXy8bBNMW8cQ" name="A"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/AbstractSiriusTest.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/AbstractSiriusTest.java
new file mode 100644
index 000000000..ca7d9c156
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/AbstractSiriusTest.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.tests;
+
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor;
+import org.eclipse.emf.compare.diagram.sirius.internal.SiriusDiffPostProcessor;
+import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.AbstractReverseActionTest;
+import org.eclipse.emf.compare.postprocessor.BasicPostProcessorDescriptorImpl;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.emf.compare.postprocessor.PostProcessorDescriptorRegistryImpl;
+
+/**
+ * This class helps to initialize and use the registers for Sirius tests.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractSiriusTest extends AbstractReverseActionTest {
+
+ /**
+ * The PostProcessors registry.
+ */
+ private IPostProcessor.Descriptor.Registry<String> postProcessorRegistry;
+
+ /**
+ * Used to initialize the registers.
+ */
+ @Override
+ public void setUp() throws IOException {
+ super.setUp();
+ postProcessorRegistry = registerSiriusPostProcessors();
+ }
+
+ /**
+ * Used to register new post processors.
+ *
+ * @see org.eclipse.emf.compare.diagram.sirius.internal.SiriusDiffPostProcessor
+ * @see org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor
+ * @return the register composed of SiriusDiffPostProcessor and CompareDiagramPostProcessor.
+ */
+ protected IPostProcessor.Descriptor.Registry<String> registerSiriusPostProcessors() {
+ final IPostProcessor.Descriptor.Registry<String> registry = new PostProcessorDescriptorRegistryImpl<String>();
+
+ registry.put(SiriusDiffPostProcessor.class.getName(),
+ new BasicPostProcessorDescriptorImpl(new SiriusDiffPostProcessor(),
+ Pattern.compile("http://www.eclipse.org/sirius/1.1.0"), //$NON-NLS-1$
+ Pattern.compile(""))); //$NON-NLS-1$
+ registry.put(CompareDiagramPostProcessor.class.getName(),
+ new BasicPostProcessorDescriptorImpl(new CompareDiagramPostProcessor(),
+ Pattern.compile("http://www.eclipse.org/gmf/runtime/\\d+\\.\\d+\\.\\d+/notation"), //$NON-NLS-1$
+ Pattern.compile(""))); //$NON-NLS-1$
+ return registry;
+ }
+
+ /**
+ * Returns the post processor registry.
+ *
+ * @return postProcessorRegistry.
+ */
+ protected IPostProcessor.Descriptor.Registry<String> getPostProcessorRegistry() {
+ return postProcessorRegistry;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/AllTests.java
new file mode 100644
index 000000000..869e07a15
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/AllTests.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.tests.suite;
+
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.compare.tests.nodes.NodesPackage;
+import org.eclipse.emf.compare.tests.nodes.util.NodesResourceFactoryImpl;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This class is used to run all the test classes of the
+ * <code>org.eclipse.emf.compare.diagram.sirius.tests</code> project.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@RunWith(Suite.class)
+@SuiteClasses({BugsTestSuite.class })
+public class AllTests {
+
+ /**
+ * Used to fill EMF registers.
+ */
+ @BeforeClass
+ public static void fillEMFRegistries() {
+ EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
+
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("nodes", //$NON-NLS-1$
+ new NodesResourceFactoryImpl());
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/BugsTestSuite.java b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/BugsTestSuite.java
new file mode 100644
index 000000000..6a6c6bfdd
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius.tests/src/org/eclipse/emf/compare/diagram/sirius/tests/suite/BugsTestSuite.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.tests.suite;
+
+import org.eclipse.emf.compare.diagram.sirius.internal.TestBug561458;
+import org.eclipse.emf.compare.diagram.sirius.internal.merge.TestBug561825;
+import org.eclipse.emf.compare.diagram.sirius.internal.merge.TestBug562321;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * This class is used to run all the bugfix test classes of the
+ * <code>org.eclipse.emf.compare.diagram.sirius.tests</code> project.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@RunWith(Suite.class)
+@SuiteClasses({TestBug561458.class, TestBug561825.class, TestBug562321.class })
+public class BugsTestSuite {
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.sirius/META-INF/MANIFEST.MF
index ff0709b40..61592b6fe 100644
--- a/plugins/org.eclipse.emf.compare.diagram.sirius/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius/META-INF/MANIFEST.MF
@@ -7,10 +7,10 @@ Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Localization: plugin
-Import-Package: com.google.common.annotations;version="[27.0.0,28.0.0)",
- com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.annotations;version="[27.0.0,30.2.0)",
+ com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare;bundle-version="3.2.0",
org.eclipse.emf.compare.diagram;bundle-version="2.3.0",
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.sirius/plugin.xml
index bcb4989f6..93f64f383 100644
--- a/plugins/org.eclipse.emf.compare.diagram.sirius/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.4"?>
<!--
- Copyright (c) 2015 Obeo.
+ Copyright (c) 2015, 2020 Obeo.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -24,5 +24,12 @@
</nsURI>
</processor>
</extension>
+ <extension
+ point="org.eclipse.emf.compare.rcp.merger">
+ <merger
+ class="org.eclipse.emf.compare.diagram.sirius.internal.merge.SiriusReferenceChangeMerger"
+ ranking="25">
+ </merger>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/SiriusDiffPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/SiriusDiffPostProcessor.java
index a82fc2273..2dd5a587f 100644
--- a/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/SiriusDiffPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/SiriusDiffPostProcessor.java
@@ -1,16 +1,18 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2020 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.compare.diagram.sirius.internal;
import static com.google.common.collect.Collections2.filter;
+import static org.eclipse.emf.compare.DifferenceKind.ADD;
+import static org.eclipse.emf.compare.DifferenceKind.DELETE;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.CONTAINMENT_REFERENCE_CHANGE;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.fromSide;
@@ -36,22 +38,26 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.sirius.diagram.DDiagramElementContainer;
+import org.eclipse.sirius.diagram.DEdge;
import org.eclipse.sirius.diagram.DNode;
+import org.eclipse.sirius.diagram.DNodeListElement;
import org.eclipse.sirius.diagram.DiagramPackage;
-import org.eclipse.sirius.diagram.description.NodeMapping;
+import org.eclipse.sirius.viewpoint.DMappingBased;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.ViewpointPackage;
+import org.eclipse.sirius.viewpoint.description.RepresentationElementMapping;
/**
* A post processor to refine the differences found on a Sirius model.
- *
+ *
* @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
*/
@SuppressWarnings("restriction")
public class SiriusDiffPostProcessor implements IPostProcessor {
/**
* Create a new predicate to check whether the value of a {@link ReferenceChange} is of a given type.
- *
+ *
* @param clazz
* an EClass.
* @return true if the value of the {@link ReferenceChange} is of the given type.
@@ -73,6 +79,32 @@ public class SiriusDiffPostProcessor implements IPostProcessor {
}
/**
+ * Checks that the actualMapping reference is correct.
+ *
+ * @param actualMappingChange
+ * the mapping difference.
+ * @param value
+ * the value which holds the actualMapping.
+ * @return true if the reference is correct.
+ */
+ private boolean isActualMappingReferenceChangeFor(ReferenceChange actualMappingChange,
+ DMappingBased value) {
+ boolean result = false;
+ if (value instanceof DNode) {
+ result = actualMappingChange.getReference() == DiagramPackage.eINSTANCE.getDNode_ActualMapping();
+ } else if (value instanceof DDiagramElementContainer) {
+ result = actualMappingChange.getReference() == DiagramPackage.eINSTANCE
+ .getDDiagramElementContainer_ActualMapping();
+ } else if (value instanceof DNodeListElement) {
+ result = actualMappingChange.getReference() == DiagramPackage.eINSTANCE
+ .getDNodeListElement_ActualMapping();
+ } else if (value instanceof DEdge) {
+ result = actualMappingChange.getReference() == DiagramPackage.eINSTANCE.getDEdge_ActualMapping();
+ }
+ return result;
+ }
+
+ /**
* {@inheritDoc}
*/
public void postMatch(Comparison comparison, Monitor monitor) {
@@ -114,17 +146,20 @@ public class SiriusDiffPostProcessor implements IPostProcessor {
addRequiresToDecoratedElement(diffsByValue, referenceChange, semanticTarget);
}
/*
- * A DNode should always have its actualMapping reference set.
+ * A DMappingBased should always have its actualMapping reference set.
*/
- if (value instanceof DNode) {
- NodeMapping map = ((DNode)value).getActualMapping();
+ if (value instanceof DMappingBased) {
+ RepresentationElementMapping map = ((DMappingBased)value).getMapping();
if (map != null) {
for (ReferenceChange actualMappingChange : Iterables
.filter(comparison.getDifferences(map), ReferenceChange.class)) {
- if (actualMappingChange.getReference() == DiagramPackage.eINSTANCE
- .getDNode_ActualMapping()
+ if (isActualMappingReferenceChangeFor(actualMappingChange, (DMappingBased)value)
&& fromSide(referenceChange.getSource()).apply(actualMappingChange)) {
- referenceChange.getImplies().add(actualMappingChange);
+ if (referenceChange.getKind() == ADD) {
+ referenceChange.getImplies().add(actualMappingChange);
+ } else if (referenceChange.getKind() == DELETE) {
+ referenceChange.getImpliedBy().add(actualMappingChange);
+ }
}
}
}
@@ -154,7 +189,7 @@ public class SiriusDiffPostProcessor implements IPostProcessor {
/**
* Add diff requires for every change related to the semantic target.
- *
+ *
* @param diffsByValue
* {@link ReferenceChange} differences indexed by value.
* @param referenceChange
@@ -216,7 +251,7 @@ public class SiriusDiffPostProcessor implements IPostProcessor {
/**
* Collect the differences which have to be added as a refinment of the current DiagramDiff.
- *
+ *
* @param comparison
* the current comparison.
* @param refinesToAdd
diff --git a/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/SiriusReferenceChangeMerger.java b/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/SiriusReferenceChangeMerger.java
new file mode 100644
index 000000000..b226d9c8c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.sirius/src/org/eclipse/emf/compare/diagram/sirius/internal/merge/SiriusReferenceChangeMerger.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.sirius.internal.merge;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.merge.ComputeDiffsToMerge;
+import org.eclipse.emf.compare.merge.DiffRelationshipComputer;
+import org.eclipse.emf.compare.merge.IDiffRelationshipComputer;
+import org.eclipse.emf.compare.merge.ReferenceChangeMerger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.sirius.viewpoint.DMappingBased;
+import org.eclipse.sirius.viewpoint.description.RepresentationElementMapping;
+
+/**
+ * This specific implementation of {@link ReferenceChangeMerger} will be used to merge Sirius changes.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class SiriusReferenceChangeMerger extends ReferenceChangeMerger {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.merge.IMerger#isMergerFor(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ public boolean isMergerFor(Diff target) {
+ boolean result = false;
+ if (target instanceof ReferenceChange) {
+ EObject value = ((ReferenceChange)target).getValue();
+ result = (value instanceof DMappingBased || value instanceof RepresentationElementMapping)
+ && (!target.getImpliedBy().isEmpty() || !target.getImplies().isEmpty());
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.merge.AbstractMerger#copyDiff(org.eclipse.emf.compare.Diff,
+ * org.eclipse.emf.common.util.Monitor, boolean)
+ */
+ @Override
+ protected void copyDiff(Diff target, Monitor monitor, boolean rightToLeft) {
+ super.copyDiff(target, monitor, rightToLeft);
+
+ Set<Diff> impliedMerges = getImpliedMerges(target, rightToLeft);
+ Set<Diff> impliedMappings = new HashSet<Diff>();
+ while (!impliedMerges.isEmpty()) {
+ Diff impliedMerge = impliedMerges.iterator().next();
+ impliedMerges.addAll(getImpliedMerges(impliedMerge, rightToLeft));
+ if (impliedMerge instanceof ReferenceChange) {
+ EObject value = ((ReferenceChange)impliedMerge).getValue();
+ if (value instanceof DMappingBased || value instanceof RepresentationElementMapping) {
+ impliedMerge.setState(DifferenceState.UNRESOLVED);
+ impliedMappings.add(impliedMerge);
+ }
+ }
+ impliedMerges.remove(impliedMerge);
+ }
+
+ mergeImpliedMappings(impliedMappings, rightToLeft);
+ }
+
+ /**
+ * Used to merge implied differences which are related to a RepresentationElementMapping or DMappingBased,
+ * in the correct order, according to the required dependencies.
+ *
+ * @param impliedMappings
+ * The set of implied differences which have a mapping.
+ * @param rightToLeft
+ * Merge direction.
+ */
+ private void mergeImpliedMappings(Set<Diff> impliedMappings, boolean rightToLeft) {
+ IDiffRelationshipComputer relationshipComputer = new DiffRelationshipComputer(getRegistry());
+ ComputeDiffsToMerge computer = new ComputeDiffsToMerge(rightToLeft, relationshipComputer);
+ for (Diff impliedMapping : impliedMappings) {
+ for (Diff toMerge : computer.getAllDiffsToMerge(impliedMapping)) {
+ if (!isInTerminalState(toMerge)) {
+ mergeDiff(toMerge, rightToLeft, null);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
index 48d9b1a4a..d5db9544e 100644
--- a/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
@@ -12,8 +12,8 @@ Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.gmf.runtime.diagram.ui,
org.eclipse.emf.compare;bundle-version="2.0.0",
org.eclipse.emf.compare.ide;bundle-version="3.0.0"
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.emf.compare.diagram.internal.CompareDiagramPlugin
Export-Package: org.eclipse.emf.compare.diagram.internal;
diff --git a/plugins/org.eclipse.emf.compare.diagram/plugin.xml b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
index 19318ebd0..b45d7cbe4 100644
--- a/plugins/org.eclipse.emf.compare.diagram/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
@@ -30,7 +30,7 @@
label="Diagram Post processor"
ordinal="30">
<nsURI
- value="http://www.eclipse.org/gmf/runtime/\d.\d.\d/notation">
+ value="http://www.eclipse.org/gmf/runtime/\d+\.\d+\.\d+/notation">
</nsURI>
</processor>
</extension>
diff --git a/plugins/org.eclipse.emf.compare.doc/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.doc/META-INF/MANIFEST.MF
index b8067e12b..e8e3dd2b8 100644
--- a/plugins/org.eclipse.emf.compare.doc/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.doc/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.doc; singleton:=true
-Bundle-Version: 3.3.9.qualifier
+Bundle-Version: 3.3.19.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.compare.doc/pom.xml b/plugins/org.eclipse.emf.compare.doc/pom.xml
index a0a150241..0fa1d4940 100644
--- a/plugins/org.eclipse.emf.compare.doc/pom.xml
+++ b/plugins/org.eclipse.emf.compare.doc/pom.xml
@@ -16,12 +16,12 @@
<parent>
<artifactId>emf.compare-parent</artifactId>
<groupId>org.eclipse.emf.compare</groupId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<relativePath>../../org.eclipse.emf.compare-parent</relativePath>
</parent>
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>org.eclipse.emf.compare.doc</artifactId>
- <version>3.3.9-SNAPSHOT</version>
+ <version>3.3.19-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
@@ -121,7 +121,7 @@
<argument>${project.build.directory}/website</argument>
<argument>-version</argument>
<!-- Please update qualified version for each release.-->
- <argument>3.3.9.${buildQualifier}</argument>
+ <argument>3.3.19.${buildQualifier}</argument>
</arguments>
</configuration>
</execution>
@@ -141,7 +141,7 @@
<configuration>
<target>
<!-- Please update qualified version for each release.-->
- <zip destfile="${project.build.directory}/${project.artifactId}-website-3.3.9.${buildQualifier}.zip">
+ <zip destfile="${project.build.directory}/${project.artifactId}-website-3.3.19.${buildQualifier}.zip">
<zipfileset dir="${project.build.directory}/website"/>
</zip>
</target>
diff --git a/plugins/org.eclipse.emf.compare.doc/src/user/user-guide.mediawiki b/plugins/org.eclipse.emf.compare.doc/src/user/user-guide.mediawiki
index b1b6ac557..4f184badb 100644
--- a/plugins/org.eclipse.emf.compare.doc/src/user/user-guide.mediawiki
+++ b/plugins/org.eclipse.emf.compare.doc/src/user/user-guide.mediawiki
@@ -22,7 +22,7 @@ EMF has been part of the Eclipse release train since Galileo, you can install it
http://download.eclipse.org/releases/helios
http://download.eclipse.org/releases/galileo
-The [http://www.eclipse.org/emf/compare/downloads/ Download page] lists more specific update sites if you wish to try one of the latest integration builds.
+The [https://www.eclipse.org/emf/compare/download.html Download page] lists more specific update sites if you wish to try one of the latest integration builds.
==== Compatibility ====
diff --git a/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
index 19829aaf7..c552d7232 100644
--- a/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
@@ -27,6 +27,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.transaction;bundle-version="1.3.0",
org.eclipse.emf.ecore.edit;visibility:=reexport
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.annotations;version="[27.0.0,28.0.0)",
- com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.annotations;version="[27.0.0,30.2.0)",
+ com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/domain/impl/EMFCompareChangeRecorder.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/domain/impl/EMFCompareChangeRecorder.java
index 962984227..cd1feebbc 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/domain/impl/EMFCompareChangeRecorder.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/domain/impl/EMFCompareChangeRecorder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Obeo.
+ * Copyright (c) 2019, 2020 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,12 +12,17 @@
package org.eclipse.emf.compare.domain.impl;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.change.ChangeDescription;
import org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl;
import org.eclipse.emf.ecore.change.util.ChangeRecorder;
@@ -29,10 +34,16 @@ import org.eclipse.emf.ecore.util.InternalEList;
* This custom implementation of a change recorder will avoid copying the internal lists every time they're
* needed as they can grow to very large sizes along with the size of the compared models.
*
- * @author lgoubet
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
public class EMFCompareChangeRecorder extends ChangeRecorder {
/**
+ * The set used to register notifiers and reduce the size of the "originalTargetObjects" list before using
+ * it in the consolidateChanges() method.
+ */
+ private Set<Notifier> setOriginalTargetObjects = new HashSet<Notifier>();
+
+ /**
* Overrides the superclass method to ignore the "originalTargetObjets" list since we never resume
* recording a paused change description.
*/
@@ -65,9 +76,14 @@ public class EMFCompareChangeRecorder extends ChangeRecorder {
handleTarget(targetEObject);
} else {
- Iterator<?> contents = target instanceof ResourceSet
- ? ((ResourceSet)target).getResources().iterator()
- : target instanceof Resource ? ((Resource)target).getContents().iterator() : null;
+ Iterator<?> contents;
+ if (target instanceof ResourceSet) {
+ contents = ((ResourceSet)target).getResources().iterator();
+ } else if (target instanceof Resource) {
+ contents = ((Resource)target).getContents().iterator();
+ } else {
+ contents = null;
+ }
if (contents != null) {
while (contents.hasNext()) {
@@ -78,6 +94,49 @@ public class EMFCompareChangeRecorder extends ChangeRecorder {
}
}
+ /**
+ * The "setOriginalTargetObjects" Set is used to register target objects instead of the
+ * "originalTargetObjects" list to avoid duplicates, and fill this list with the bare minimum afterwards,
+ * for optimization purposes.
+ */
+ @Override
+ protected void handleFeature(EStructuralFeature feature, EReference containment,
+ Notification notification, EObject eObject) {
+ Object oldValue = notification.getOldValue();
+ if (oldValue instanceof Notifier) {
+ setOriginalTargetObjects.add((Notifier)oldValue);
+ }
+ super.handleFeature(feature, containment, notification, eObject);
+ }
+
+ /**
+ * {@inheritDoc} This avoids growing the "originalTargetObjects" and "setOriginalTargetObjects"
+ * collections indefinitely during the same comparison each time a merge is executed.
+ */
+ @Override
+ public void beginRecording(ChangeDescription changeDescription, Collection<?> rootObjects) {
+ originalTargetObjects.clear();
+ setOriginalTargetObjects.clear();
+ super.beginRecording(changeDescription, rootObjects);
+ }
+
+ /**
+ * {@inheritDoc} See bug 562321. Some Sirius objects that changed during merging may become orphans and
+ * were removed by the org.eclipse.emf.ecore.change.util.ChangeRecorder#consolidateChanges() method. So we
+ * fill the originalTargetObjects list with these orphaned objects to keep them.
+ */
+ @Override
+ protected void consolidateChanges() {
+ for (Notifier target : setOriginalTargetObjects) {
+ if (target instanceof EObject) {
+ if (isOrphan((EObject)target)) {
+ originalTargetObjects.add(target);
+ }
+ }
+ }
+ super.consolidateChanges();
+ }
+
/*
* See bug 521886. This avoids the problem that the ChangeDescription acts as a container for removed
* objects resulting in UML's CacheAdapter attaching to the change description and degrading performance.
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/.classpath b/plugins/org.eclipse.emf.compare.egit.ui/.classpath
index 3bc247511..eca7bdba8 100755
--- a/plugins/org.eclipse.emf.compare.egit.ui/.classpath
+++ b/plugins/org.eclipse.emf.compare.egit.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.egit.ui/.settings/org.eclipse.jdt.core.prefs
index 5b96208b8..32cbd1a1e 100644
--- a/plugins/org.eclipse.emf.compare.egit.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.emf.compare.egit.ui/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -100,8 +100,10 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -109,17 +111,20 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
@@ -205,11 +210,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -240,6 +246,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -264,13 +272,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -318,6 +330,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -354,9 +368,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -382,7 +399,11 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.egit.ui/META-INF/MANIFEST.MF
index edf237c87..999a50d53 100755
--- a/plugins/org.eclipse.emf.compare.egit.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.egit.ui/META-INF/MANIFEST.MF
@@ -4,22 +4,24 @@ Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.egit.ui;singleton:=true
Bundle-Version: 1.1.3.qualifier
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.emf.compare.egit,
- org.eclipse.egit.ui;bundle-version="4.2.0",
+ org.eclipse.egit.ui;bundle-version="5.0.0",
org.eclipse.core.runtime,
org.eclipse.compare,
org.eclipse.ui,
org.eclipse.core.resources,
- org.eclipse.jgit;bundle-version="4.2.0",
+ org.eclipse.jgit;bundle-version="5.0.0",
org.eclipse.team.core,
org.eclipse.team.ui,
- org.eclipse.egit.core;bundle-version="4.2.0",
+ org.eclipse.egit.core;bundle-version="5.0.0",
org.eclipse.ui.ide,
org.eclipse.emf.compare,
org.eclipse.emf.compare.ide.ui,
org.eclipse.emf.compare.ide,
- org.eclipse.egit;bundle-version="4.2.0"
+ org.eclipse.egit;bundle-version="5.0.0",
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.workbench.texteditor
Bundle-Vendor: %providerName
Export-Package: org.eclipse.emf.compare.egit.ui.internal;x-internal:=true,
org.eclipse.emf.compare.egit.ui.internal.actions;x-internal:=true,
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/actions/ModelMergeToolActionHandler.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/actions/ModelMergeToolActionHandler.java
index dfe8d6437..038be8774 100644
--- a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/actions/ModelMergeToolActionHandler.java
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/actions/ModelMergeToolActionHandler.java
@@ -18,8 +18,11 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.actions.MergeToolActionHandler;
+import org.eclipse.egit.ui.internal.merge.MergeInputMode;
import org.eclipse.egit.ui.internal.merge.MergeModeDialog;
+import org.eclipse.emf.compare.egit.internal.EGitCompatibilityUtil;
import org.eclipse.emf.compare.egit.ui.internal.merge.ModelGitMergeEditorInput;
+import org.eclipse.emf.compare.egit.ui.internal.merge.ModelGitMergeEditorInputLegacy;
import org.eclipse.jface.window.Window;
/**
@@ -40,10 +43,20 @@ public class ModelMergeToolActionHandler extends MergeToolActionHandler {
if (dlg.open() != Window.OK) {
return null;
}
- input = new ModelGitMergeEditorInput(dlg.useWorkspace(), locations);
+ if (EGitCompatibilityUtil.getEGitVersion().compareTo(EGitCompatibilityUtil.EGIT_6_0) >= 0) {
+ input = new ModelGitMergeEditorInput(dlg.getMergeMode(), locations);
+ } else {
+ Boolean useWs = (Boolean)EGitCompatibilityUtil.invoke(dlg.getClass(), dlg, "useWorkspace");
+ input = new ModelGitMergeEditorInputLegacy(useWs.booleanValue(), locations);
+ }
} else {
- boolean useWorkspace = mergeMode == 1;
- input = new ModelGitMergeEditorInput(useWorkspace, locations);
+ if (EGitCompatibilityUtil.getEGitVersion().compareTo(EGitCompatibilityUtil.EGIT_6_0) >= 0) {
+ MergeInputMode mode = MergeInputMode.fromInteger(mergeMode);
+ input = new ModelGitMergeEditorInput(mode, locations);
+ } else {
+ boolean useWorkspace = mergeMode == 1;
+ input = new ModelGitMergeEditorInputLegacy(useWorkspace, locations);
+ }
}
CompareUI.openCompareEditor(input);
return null;
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/AbstractGitCompareEditorInput.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/AbstractGitCompareEditorInput.java
new file mode 100644
index 000000000..26cd2a6ca
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/AbstractGitCompareEditorInput.java
@@ -0,0 +1,1027 @@
+/*******************************************************************************
+ * Copyright (C) 2010, 2021 Mathias Kinzler <mathias.kinzler@sap.com> and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.emf.compare.egit.ui.internal.merge;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.CompareViewerPane;
+import org.eclipse.compare.IResourceProvider;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
+import org.eclipse.compare.structuremergeviewer.DiffContainer;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Adapters;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.egit.core.info.GitInfo;
+import org.eclipse.egit.core.internal.efs.HiddenResources;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
+import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.internal.UIIcons;
+import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.egit.ui.internal.merge.CompareEditorInputViewerAction;
+import org.eclipse.egit.ui.internal.merge.CompareWithEachOtherAction;
+import org.eclipse.egit.ui.internal.merge.GitDiffTreeViewer;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jgit.lib.AnyObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.internal.ui.synchronize.EditableSharedDocumentAdapter.ISharedDocumentAdapterListener;
+import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerActivation;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.ide.IDE.SharedImages;
+import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.ui.services.IServiceLocator;
+
+/**
+ * A Git-specific {@link CompareEditorInput}.
+ * <p>
+ * This class is a copy from {@link org.eclipse.egit.ui.internal.merge.AbstractGitCompareEditorInput}, except
+ * for the following:
+ * <ul>
+ * <li>{@link #buildInput(IProgressMonitor)} returns an Object instead of a DiffContainer</li>
+ * <li>{@link #inputBuilt(Object)} takes an Object instead of a DiffContainer</li>
+ * </p>
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractGitCompareEditorInput extends CompareEditorInput {
+
+ private static final Comparator<String> CMP = (left, right) -> {
+ String l = left.startsWith("/") ? left.substring(1) : left; //$NON-NLS-1$
+ String r = right.startsWith("/") ? right.substring(1) : right; //$NON-NLS-1$
+ return l.replace('/', '\001').compareToIgnoreCase(r.replace('/', '\001'));
+ };
+
+ private static final Image FOLDER_IMAGE = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FOLDER);
+
+ private static final Image PROJECT_IMAGE = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(SharedImages.IMG_OBJ_PROJECT);
+
+ private final IPath[] locations;
+
+ private List<IFile> toDelete;
+
+ private Map<String, IHandlerActivation> activations = new HashMap<>();
+
+ private Repository repository;
+
+ private Collection<String> gitPaths;
+
+ private boolean initialized;
+
+ /**
+ * Creates a new {@link AbstractGitCompareEditorInput}. Note that if the repository is null and no
+ * locations are given, initPaths will throw an exception.
+ *
+ * @param repository
+ * to operate in; if {@code null} will be determined from the {@code locations}
+ * @param locations
+ * absolute file system locations of the files/folders to restrict the operation to
+ */
+ protected AbstractGitCompareEditorInput(Repository repository, IPath... locations) {
+ super(new CompareConfiguration());
+ this.repository = repository;
+ this.locations = locations;
+ }
+
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
+ if ((adapter == IFile.class || adapter == IResource.class) && !isMultiFile()) {
+ ITypedElement element = getElement();
+ IResource resource = getResource(element);
+ if (resource != null && adapter.isInstance(resource) && resource.exists()) {
+ return adapter.cast(resource);
+ }
+ } else if (adapter == IShowInSource.class && isMultiFile()) {
+ DiffNode node = getNode();
+ if (node instanceof FolderNode) {
+ FolderNode folder = (FolderNode)node;
+ IContainer container = folder.getContainer();
+ if (container != null) {
+ return adapter.cast(new ShowInContext(this, new StructuredSelection(container)));
+ }
+ IPath path = folder.getPath();
+ if (path != null) {
+ if (path.isAbsolute()) {
+ return adapter.cast(
+ getShowInSource(new ShowInContext(this, new StructuredSelection(path))));
+ } else {
+ GitInfo info = getGitInfo(path);
+ if (info != null) {
+ return adapter.cast(
+ getShowInSource(new ShowInContext(this, new StructuredSelection(info))));
+ }
+ }
+ }
+ } else if (node != null) {
+ ITypedElement element = node.getLeft();
+ IResource resource = getResource(element);
+ if (resource instanceof IFile && resource.exists()) {
+ return adapter.cast(
+ getShowInSource(new ShowInContext(this, new StructuredSelection(resource))));
+ }
+ GitInfo info = Adapters.adapt(element, GitInfo.class);
+ if (info != null && info.getRepository() != null) {
+ IPath path = Path.fromPortableString(info.getGitPath());
+ if (!repository.isBare()) {
+ File f = new File(repository.getWorkTree(), path.toOSString());
+ if (f.exists()) {
+ return adapter.cast(getShowInSource(new ShowInContext(this,
+ new StructuredSelection(Path.fromOSString(f.getAbsolutePath())))));
+ }
+ }
+ // The repository is bare, or the path does not exist in the
+ // working tree. The history page can deal with these paths,
+ // so at least "Show in->History" should work.
+ return adapter
+ .cast(getShowInSource(new ShowInContext(this, new StructuredSelection(info))));
+ }
+ }
+ return adapter.cast(getShowInSource(null));
+ } else if (adapter == Repository.class) {
+ return adapter.cast(repository);
+ }
+ return super.getAdapter(adapter);
+ }
+
+ @Override
+ public Object getSelectedEdition() {
+ if (isUIThread()) {
+ return super.getSelectedEdition();
+ } else {
+ Object[] item = {null };
+ PlatformUI.getWorkbench().getDisplay().syncExec(() -> {
+ item[0] = super.getSelectedEdition();
+ });
+ return item[0];
+ }
+ }
+
+ private boolean isMultiFile() {
+ Object input = getCompareResult();
+ if (input instanceof IDiffContainer) {
+ IDiffElement[] children = ((IDiffContainer)input).getChildren();
+ if (children.length != 1) {
+ return true;
+ }
+ if (children[0] instanceof IDiffContainer && ((IDiffContainer)children[0]).hasChildren()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private ITypedElement getElement() {
+ Object selectedEdition = getSelectedEdition();
+ if (selectedEdition instanceof DiffNode) {
+ DiffNode diffNode = (DiffNode)selectedEdition;
+ return diffNode.getLeft();
+ }
+ return null;
+ }
+
+ private DiffNode getNode() {
+ Object selectedEdition = getSelectedEdition();
+ if (selectedEdition instanceof DiffNode) {
+ return (DiffNode)selectedEdition;
+ }
+ return null;
+ }
+
+ private IResource getResource(ITypedElement element) {
+ if (element != null) {
+ IResource resource = null;
+ if (element instanceof HiddenResourceTypedElement) {
+ resource = ((HiddenResourceTypedElement)element).getRealFile();
+ } else if (element instanceof IResourceProvider) {
+ resource = ((IResourceProvider)element).getResource();
+ }
+ return resource;
+ }
+ return null;
+ }
+
+ /**
+ * Hook method for subclasses to provide a {@link GitInfo} accessor for an item at the given path. The
+ * default implementation always returns {@code null}.
+ *
+ * @param path
+ * to get a {@link GitInfo} for
+ * @return the {@link GitInfo} accessor, or {@code null} if none can be determined
+ */
+ protected GitInfo getGitInfo(IPath path) {
+ return null;
+ }
+
+ private IShowInSource getShowInSource(ShowInContext context) {
+ return () -> context;
+ }
+
+ @Override
+ protected void contentsCreated() {
+ super.contentsCreated();
+ // select the first conflict
+ getNavigator().selectChange(true);
+ }
+
+ @Override
+ public Viewer createDiffViewer(Composite parent) {
+ GitDiffTreeViewer viewer = new GitDiffTreeViewer(parent, getContainer(), getCompareConfiguration());
+ viewer.setComparator(new ViewerComparator(CMP) {
+
+ @Override
+ public int category(Object element) {
+ if (element instanceof FolderNode) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ });
+ IAction compareAction = new CompareWithEachOtherAction(viewer,
+ UIText.GitMergeEditorInput_CompareWithEachOtherMenuLabel, UIIcons.ELCL16_COMPARE_VIEW);
+ viewer.setActions(Collections.singleton(compareAction));
+ registerAction(compareAction, CompareWithEachOtherAction.COMMAND_ID);
+ return viewer;
+ }
+
+ @Override
+ public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) {
+ Viewer newViewer = super.findContentViewer(oldViewer, input, parent);
+ ToolBarManager manager = CompareViewerPane.getToolBarManager(parent);
+ if (manager != null) {
+ initActions(manager, newViewer, input);
+ }
+ return newViewer;
+ }
+
+ /**
+ * Something that can get or create an action to be added to the toolbar of a content merge viewer.
+ */
+ @FunctionalInterface
+ protected interface ActionSupplier {
+
+ /**
+ * Obtains an action.
+ *
+ * @param create
+ * whether to create an action if none was created yet
+ * @return the action, or {@code null} if none created
+ */
+ public CompareEditorInputViewerAction get(boolean create);
+ }
+
+ /**
+ * Hook for subclasses to provide toolbar actions.
+ *
+ * @param manager
+ * to add the action to
+ * @param newViewer
+ * for the action
+ * @param input
+ * for the viewer
+ */
+ protected void initActions(ToolBarManager manager, Viewer newViewer, ICompareInput input) {
+ // Nothing.
+ }
+
+ /**
+ * Manages the action with the given id. If none exists in the toolbar but it is applicable, create one
+ * through the supplier. Otherwise set the enablement according to whether it is applicable. The action is
+ * registered with the {@link IHandlerService} as a command.
+ *
+ * @param manager
+ * to add the action to
+ * @param viewer
+ * for the action
+ * @param isApplicable
+ * {@code true} if the action applies
+ * @param id
+ * of the action; also used as a command id
+ * @param supplier
+ * to create or get the action
+ */
+ protected void setAction(ToolBarManager manager, Viewer viewer, boolean isApplicable, String id,
+ ActionSupplier supplier) {
+ IContributionItem item = manager.find(id);
+ if (item != null) {
+ if (item instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)item).getAction();
+ if (action instanceof CompareEditorInputViewerAction) {
+ ((CompareEditorInputViewerAction)action)
+ .setViewer(isApplicable ? (ContentMergeViewer)viewer : null);
+ action.setEnabled(isApplicable);
+ if (item.isVisible() != isApplicable) {
+ item.setVisible(isApplicable);
+ manager.update(true);
+ }
+ }
+ }
+ } else if (isApplicable) {
+ CompareEditorInputViewerAction action = supplier.get(true);
+ action.setViewer((ContentMergeViewer)viewer);
+ action.setEnabled(true);
+ manager.insert(0, new ActionContributionItem(action));
+ manager.update(true);
+ registerAction(action, id);
+ } else {
+ // Neither present nor applicable: disable it if it exists
+ CompareEditorInputViewerAction action = supplier.get(false);
+ if (action != null) {
+ action.setEnabled(false);
+ }
+ }
+ }
+
+ private void registerAction(IAction action, String commandId) {
+ if (activations.containsKey(commandId)) {
+ return;
+ }
+ action.setActionDefinitionId(commandId);
+ IServiceLocator locator = getContainer().getServiceLocator();
+ if (locator != null) {
+ IHandlerService handlers = locator.getService(IHandlerService.class);
+ if (handlers != null) {
+ activations.put(commandId, handlers.activateHandler(commandId, new ActionHandler(action)));
+ }
+ }
+ }
+
+ /**
+ * Hook for subclasses to dispose actions, if needed. Invoked during {@link #handleDispose()}.
+ */
+ protected void disposeActions() {
+ // Nothing
+ }
+
+ @Override
+ protected void handleDispose() {
+ super.handleDispose();
+ // We do NOT dispose the images, as these are shared.
+ activations.values().forEach(a -> a.getHandlerService().deactivateHandler(a));
+ activations.clear();
+ disposeActions();
+ // We need to remove the temporary resources. A CompareEditorInput is
+ // supposed to be the very last thing that is disposed in a compare
+ // viewer, but this is not always true. If content merge viewers add
+ // additional widgets, for instance for the Java structure comparison,
+ // we're suddenly no longer the last item to be disposed. The various
+ // viewers (left, right, structure, and so on) are all disposed when
+ // their widgets are disposed. Widget disposal happens recursively
+ // top-down on the UI thread, so an asyncExec should be safe here to
+ // ensure that we remove the files only once everything else has been
+ // disposed of. If we delete temporary resources before all viewers had
+ // disconnected the Document, some might not disconnect because
+ // SharedDocumentAdapter.getDocumentKey() returns null if the file has
+ // been deleted. If this happens the framework will find that still
+ // connected document the next time this resource is opened and show
+ // that instead of the true resource contents. This is wrong and is very
+ // annoying if this cached document is dirty: one can open only this
+ // dirty version from then on, until the next restart of Eclipse.
+ PlatformUI.getWorkbench().getDisplay().asyncExec(this::cleanUp);
+ }
+
+ private void cleanUp() {
+ if (toDelete == null || toDelete.isEmpty()) {
+ return;
+ }
+ List<IFile> toClean = toDelete;
+ toDelete = null;
+ // Don't clean up if the workbench is shutting down; we would exit with
+ // unsaved workspace changes. Instead, EGit core cleans the project on
+ // start.
+ Job job = new Job(UIText.GitMergeEditorInput_ResourceCleanupJobName) {
+
+ @Override
+ public boolean shouldSchedule() {
+ return super.shouldSchedule() && !PlatformUI.getWorkbench().isClosing();
+ }
+
+ @Override
+ public boolean shouldRun() {
+ return super.shouldRun() && !PlatformUI.getWorkbench().isClosing();
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IWorkspaceRunnable remove = m -> {
+ SubMonitor progress = SubMonitor.convert(m, toClean.size());
+ for (IFile tmp : toClean) {
+ if (PlatformUI.getWorkbench().isClosing()) {
+ return;
+ }
+ try {
+ tmp.delete(true, progress.newChild(1));
+ } catch (CoreException e) {
+ // Ignore
+ }
+ }
+ };
+ try {
+ ResourcesPlugin.getWorkspace().run(remove, null, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.setUser(false);
+ job.schedule();
+ }
+
+ private static boolean isUIThread() {
+ return Display.getCurrent() != null;
+ }
+
+ /**
+ * Creates a {@link HiddenResourceTypedElement}.
+ *
+ * @param uri
+ * to link to
+ * @param repo
+ * {@link Repository} the item is in
+ * @param gitPath
+ * within the repository
+ * @param name
+ * for the hidden resource
+ * @param file
+ * original file, if any
+ * @param encoding
+ * to use
+ * @return a {@link HiddenResourceTypedElement}
+ * @throws IOException
+ * on errors
+ */
+ protected LocalResourceTypedElement createWithHiddenResource(URI uri, Repository repo, String gitPath,
+ String name, IFile file, Charset encoding) throws IOException {
+ IFile tmp = createHiddenResource(uri, name, encoding);
+ return new HiddenResourceTypedElement(repo, gitPath, tmp, file);
+ }
+
+ /**
+ * Creates a hidden resource that will be removed when this {@link AbstractGitCompareEditorInput} is
+ * disposed.
+ *
+ * @param uri
+ * to link to
+ * @param name
+ * for the resource
+ * @param encoding
+ * to use
+ * @return the hidden resource
+ * @throws IOException
+ * on errors
+ */
+ protected IFile createHiddenResource(URI uri, String name, Charset encoding) throws IOException {
+ try {
+ IFile tmp = HiddenResources.INSTANCE.createFile(uri, name, encoding, null);
+ if (toDelete == null) {
+ toDelete = new ArrayList<>();
+ }
+ toDelete.add(tmp);
+ return tmp;
+ } catch (CoreException e) {
+ throw new IOException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Constructs diff nodes for folders connecting the file to the root.
+ *
+ * @param root
+ * to connect to
+ * @param repositoryPath
+ * full absolute path of the git repository working tree
+ * @param file
+ * to determine a {@link IProject} from
+ * @param location
+ * full absolute path of the file
+ * @return the folder node to attach a new {@link DiffNode} for the file to, already attached to root
+ */
+ protected IDiffContainer getFileParent(IDiffContainer root, IPath repositoryPath, IFile file,
+ IPath location) {
+ int projectSegment = -1;
+ String projectName = null;
+ if (file != null) {
+ IProject project = file.getProject();
+ IPath projectLocation = project.getLocation();
+ if (projectLocation != null) {
+ IPath projectPath = project.getLocation().makeRelativeTo(repositoryPath);
+ projectSegment = projectPath.segmentCount() - 1;
+ projectName = project.getName();
+ }
+ }
+
+ IPath path = location.makeRelativeTo(repositoryPath);
+ int pathLength = path.segmentCount() - 1;
+ IDiffContainer child = root;
+ for (int i = 0; i < pathLength; i++) {
+ if (i == projectSegment) {
+ child = getOrCreateChild(child, projectName, true);
+ } else {
+ child = getOrCreateChild(child, path.segment(i), false);
+ }
+ }
+ if (child != root) {
+ IContainer container = file != null ? file.getParent() : null;
+ path = location.removeLastSegments(1);
+ IDiffContainer folder = child;
+ while (folder != root) {
+ if (folder instanceof FolderNode) {
+ if (container != null) {
+ ((FolderNode)folder).setContainer(container);
+ if (container.isLinked()) {
+ container = null;
+ } else {
+ container = container.getParent();
+ if (container.getType() == IResource.ROOT) {
+ container = null;
+ }
+ }
+ } else if (path != null) {
+ ((FolderNode)folder).setPath(path);
+ }
+ if (path != null && pathLength > 0) {
+ path = path.removeLastSegments(1);
+ pathLength--;
+ } else {
+ break;
+ }
+ }
+ folder = folder.getParent();
+ }
+ }
+ return child;
+ }
+
+ /**
+ * Constructs diff nodes for folders connecting the file to the root.
+ *
+ * @param root
+ * to connect to
+ * @param gitPath
+ * git path (relative to the repository root)
+ * @return the folder node to attach a new {@link DiffNode} for the file to, already attached to root
+ */
+ protected IDiffContainer getFileParent(IDiffContainer root, String gitPath) {
+ IDiffContainer child = root;
+ IPath path = Path.fromPortableString(gitPath);
+ int pathLength = path.segmentCount() - 1;
+ for (int i = 0; i < pathLength; i++) {
+ child = getOrCreateChild(child, path.segment(i), false);
+ }
+ if (child != root) {
+ if (!repository.isBare()) {
+ path = Path.fromOSString(repository.getWorkTree().getAbsolutePath()).append(path);
+ }
+ path = path.removeLastSegments(1);
+ IDiffContainer folder = child;
+ while (folder != root) {
+ if (folder instanceof FolderNode) {
+ if (pathLength > 0) {
+ ((FolderNode)folder).setPath(path);
+ path = path.removeLastSegments(1);
+ pathLength--;
+ } else {
+ break;
+ }
+ }
+ folder = folder.getParent();
+ }
+ }
+ return child;
+ }
+
+ private DiffNode getOrCreateChild(IDiffContainer parent, final String name, final boolean projectMode) {
+ for (IDiffElement child : parent.getChildren()) {
+ if (child.getName().equals(name)) {
+ return ((DiffNode)child);
+ }
+ }
+ return new FolderNode(parent, name, projectMode ? PROJECT_IMAGE : FOLDER_IMAGE);
+ }
+
+ private void collapse(DiffContainer top) {
+ IDiffElement[] children = top.getChildren();
+ boolean isRoot = top.getParent() == null;
+ if (!isRoot) {
+ while (children != null && children.length == 1) {
+ IDiffElement singleChild = children[0];
+ if (singleChild instanceof FolderNode) {
+ FolderNode node = (FolderNode)singleChild;
+ top.remove(singleChild);
+ top.getParent().add(singleChild);
+ node.setName(top.getName() + '/' + singleChild.getName());
+ ((DiffContainer)top.getParent()).remove(top);
+ children = node.getChildren();
+ top = node;
+ } else {
+ // Hit a leaf.
+ return;
+ }
+ }
+ }
+ if (children != null && (isRoot || children.length > 1)) {
+ for (IDiffElement node : children) {
+ if (node instanceof FolderNode) {
+ collapse((DiffContainer)node);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean canRunAsJob() {
+ return true;
+ }
+
+ @Override
+ protected final Object prepareInput(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(UIText.GitMergeEditorInput_CheckingResourcesTaskName, IProgressMonitor.UNKNOWN);
+ try {
+ initPaths();
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ Object result = buildInput(monitor);
+ if (result instanceof DiffContainer) {
+ collapse((DiffContainer)result);
+ }
+ inputBuilt(result);
+ return result;
+ } finally {
+ monitor.done();
+ }
+ }
+
+ /**
+ * Build the {@link DiffNode}s and return the root node.
+ *
+ * @param monitor
+ * for cancellation and progress reporting
+ * @return the root diff node
+ * @throws InvocationTargetException
+ * on errors
+ * @throws InterruptedException
+ * on cancellation
+ * @see CompareEditorInput#prepareInput(IProgressMonitor monitor)
+ */
+ protected abstract Object buildInput(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException;
+
+ /**
+ * Hook for subclasses called once the full compare result has been built.
+ * <p>
+ * This default implementation does nothing.
+ * </p>
+ *
+ * @param root
+ * that will be returned as compare result
+ */
+ protected void inputBuilt(Object root) {
+ // Nothing
+ }
+
+ private void initPaths() throws InvocationTargetException {
+ if (initialized) {
+ return;
+ }
+ initialized = true;
+ if (repository == null || locations != null && locations.length > 0) {
+ Map<Repository, Collection<String>> pathsByRepository = ResourceUtil
+ .splitPathsByRepository(Arrays.asList(locations));
+ if (pathsByRepository.size() != 1) {
+ throw new InvocationTargetException(
+ new IllegalStateException(UIText.RepositoryAction_multiRepoSelection));
+ }
+ Entry<Repository, Collection<String>> entry = pathsByRepository.entrySet().iterator().next();
+ Repository repo = entry.getKey();
+ if (repository != null && !repo.getDirectory().equals(repository.getDirectory())) {
+ throw new InvocationTargetException(new IllegalStateException("Paths not in repo " //$NON-NLS-1$
+ + repository.getDirectory()));
+ }
+ if (repository == null) {
+ repository = repo;
+ }
+ gitPaths = new ArrayList<>(entry.getValue());
+ }
+ }
+
+ /**
+ * Retrieves the repository.
+ *
+ * @return the {@link Repository}
+ */
+ protected Repository getRepository() {
+ return repository;
+ }
+
+ /**
+ * Retrieves the git paths to filter the comparison by.
+ *
+ * @return the paths, or an empty collection if all paths in the repository shall be compared
+ */
+ protected Collection<String> getFilterPaths() {
+ if (gitPaths == null) {
+ return Collections.emptyList();
+ }
+ return gitPaths;
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(locations);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+ AbstractGitCompareEditorInput other = (AbstractGitCompareEditorInput)obj;
+ return Arrays.equals(locations, other.locations);
+ }
+
+ /**
+ * {@link AbstractGitCompareEditorInput} is not a {@code SaveableCompareEditorInput}. Editable
+ * {@link ITypedElement}s must handle saving on being flushed. Attaching a {@code LocalResourceSaver} to a
+ * {@link LocalResourceTypedElement} achieves that, and also refreshes as needed when hidden resources are
+ * used.
+ */
+ protected static class LocalResourceSaver implements ISharedDocumentAdapterListener {
+
+ LocalResourceTypedElement element;
+
+ /**
+ * Creates a new {@link LocalResourceSaver} for the given {@link LocalResourceTypedElement}.
+ *
+ * @param element
+ * to handle saving of
+ */
+ public LocalResourceSaver(LocalResourceTypedElement element) {
+ this.element = element;
+ }
+
+ /**
+ * Saves the element; invoked via {@link #handleDocumentFlushed()}.
+ *
+ * @throws CoreException
+ * on errors
+ */
+ protected void save() throws CoreException {
+ element.saveDocument(true, null);
+ refreshIndexDiff();
+ }
+
+ private void refreshIndexDiff() {
+ IResource resource = element.getResource();
+ if (resource != null && HiddenResources.INSTANCE.isHiddenProject(resource.getProject())) {
+ String gitPath = null;
+ Repository repository = null;
+ URI uri = resource.getLocationURI();
+ if (EFS.SCHEME_FILE.equals(uri.getScheme())) {
+ IPath location = new Path(uri.getSchemeSpecificPart());
+ repository = ResourceUtil.getRepository(location);
+ if (repository != null) {
+ location = ResourceUtil.getRepositoryRelativePath(location, repository);
+ if (location != null) {
+ gitPath = location.toPortableString();
+ }
+ }
+ } else {
+ repository = HiddenResources.INSTANCE.getRepository(uri);
+ if (repository != null) {
+ gitPath = HiddenResources.INSTANCE.getGitPath(uri);
+ }
+ }
+ if (gitPath != null && repository != null) {
+ IndexDiffCacheEntry indexDiffCacheForRepository = IndexDiffCache.INSTANCE
+ .getIndexDiffCacheEntry(repository);
+ if (indexDiffCacheForRepository != null) {
+ indexDiffCacheForRepository.refreshFiles(Collections.singletonList(gitPath));
+ }
+ }
+ }
+ }
+
+ @Override
+ public void handleDocumentConnected() {
+ // Nothing
+ }
+
+ @Override
+ public void handleDocumentDisconnected() {
+ // Nothing
+ }
+
+ @Override
+ public void handleDocumentFlushed() {
+ try {
+ save();
+ } catch (CoreException e) {
+ Activator.handleStatus(e.getStatus(), true);
+ }
+ }
+
+ @Override
+ public void handleDocumentDeleted() {
+ // Nothing
+ }
+
+ @Override
+ public void handleDocumentSaved() {
+ // Nothing
+ }
+ }
+
+ /**
+ * A {@link LocalResourceTypedElement} for a hidden resource, which may correspond to a real
+ * {@link IFile}.
+ */
+ protected static class HiddenResourceTypedElement extends LocalResourceTypedElement implements GitInfo {
+
+ private final IFile realFile;
+
+ private final Repository repository;
+
+ private final String gitPath;
+
+ private HiddenResourceTypedElement(Repository repository, String gitPath, IFile file,
+ IFile realFile) {
+ super(file);
+ this.realFile = realFile;
+ this.repository = repository;
+ this.gitPath = gitPath;
+ }
+
+ /**
+ * Retrieves the real file for this {@link HiddenResourceTypedElement}.
+ *
+ * @return the {@link IFile}, or {@code null} if none
+ */
+ public IFile getRealFile() {
+ return realFile;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ // local fields not considered
+ return super.equals(obj);
+ }
+
+ @Override
+ public int hashCode() {
+ // local fields not considered
+ return super.hashCode();
+ }
+
+ @Override
+ public Repository getRepository() {
+ return repository;
+ }
+
+ @Override
+ public String getGitPath() {
+ return gitPath;
+ }
+
+ @Override
+ public Source getSource() {
+ return Source.WORKING_TREE;
+ }
+
+ @Override
+ public AnyObjectId getCommitId() {
+ return null;
+ }
+ }
+
+ private static class FolderNode extends DiffNode {
+
+ private final Image image;
+
+ private String name;
+
+ private IContainer container;
+
+ private IPath path;
+
+ FolderNode(IDiffContainer parent, String name, Image image) {
+ super(parent, Differencer.NO_CHANGE);
+ this.name = name;
+ this.image = image;
+ }
+
+ @Override
+ public String getType() {
+ return ITypedElement.FOLDER_TYPE;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ void setName(String name) {
+ // Be careful when calling this. Changing the name of a node changes
+ // the hash code of this node and of all its children! Call only
+ // before the node's hashCode is needed.
+ this.name = name;
+ }
+
+ @Override
+ public Image getImage() {
+ return image;
+ }
+
+ void setContainer(IContainer container) {
+ this.container = container;
+ }
+
+ IContainer getContainer() {
+ return container;
+ }
+
+ void setPath(IPath path) {
+ this.path = path;
+ }
+
+ IPath getPath() {
+ return path;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ // Ignore my own fields. Super implementation includes getName().
+ return super.equals(other);
+ }
+
+ @Override
+ public int hashCode() {
+ // Ignore my own fields. Super implementation includes getName().
+ return super.hashCode();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/GitMergeEditorInput.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/GitMergeEditorInput.java
new file mode 100644
index 000000000..17330e7de
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/GitMergeEditorInput.java
@@ -0,0 +1,616 @@
+/*******************************************************************************
+ * Copyright (C) 2010, 2021 Mathias Kinzler <mathias.kinzler@sap.com> and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.emf.compare.egit.ui.internal.merge;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.charset.Charset;
+import java.text.MessageFormat;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
+import org.eclipse.compare.rangedifferencer.RangeDifference;
+import org.eclipse.compare.structuremergeviewer.DiffContainer;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.info.GitInfo;
+import org.eclipse.egit.core.internal.CompareCoreUtils;
+import org.eclipse.egit.core.internal.CoreText;
+import org.eclipse.egit.core.internal.efs.EgitFileSystem;
+import org.eclipse.egit.core.internal.storage.GitFileRevision;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
+import org.eclipse.egit.core.util.RevCommitUtils;
+import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.internal.CompareUtils;
+import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.egit.ui.internal.merge.CompareEditorInputViewerAction;
+import org.eclipse.egit.ui.internal.merge.GitCompareLabelProvider;
+import org.eclipse.egit.ui.internal.merge.MergeDiffNode;
+import org.eclipse.egit.ui.internal.merge.MergeInputMode;
+import org.eclipse.egit.ui.internal.merge.ToggleCurrentChangesAction;
+import org.eclipse.egit.ui.internal.revision.EditableRevision;
+import org.eclipse.egit.ui.internal.revision.FileRevisionTypedElement;
+import org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput.EmptyTypedElement;
+import org.eclipse.egit.ui.internal.revision.ResourceEditableRevision;
+import org.eclipse.egit.ui.internal.synchronize.compare.LocalNonWorkspaceTypedElement;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jgit.api.MergeCommand.ConflictStyle;
+import org.eclipse.jgit.attributes.Attribute;
+import org.eclipse.jgit.attributes.Attributes;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheEditor;
+import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.dircache.DirCacheIterator;
+import org.eclipse.jgit.lib.AnyObjectId;
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.revwalk.filter.RevFilter;
+import org.eclipse.jgit.treewalk.AbstractTreeIterator;
+import org.eclipse.jgit.treewalk.FileTreeIterator;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.team.core.history.IFileRevision;
+import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * A Git-specific {@link CompareEditorInput}.
+ * <p>
+ * This class is a copy from org.eclipse.egit.ui.internal.merge.GitMergeEditorInput save or the parts marked
+ * with "EMF Compare Specific". Note that the super class AbstractGitCompareEditorInput is also a slightly
+ * altered copy.
+ * </p>
+ *
+ * @author <a href="mailto:mathias.kinzler@sap.com">Mathias Kinzler</a>
+ */
+@SuppressWarnings("restriction")
+public class GitMergeEditorInput extends AbstractGitCompareEditorInput {
+
+ private static final String LABELPATTERN = "{0} - {1}"; //$NON-NLS-1$
+
+ private final MergeInputMode mode;
+
+ private final boolean useWorkspace;
+
+ private final boolean useOurs;
+
+ private CompareEditorInputViewerAction toggleCurrentChanges;
+
+ // This must be an identity map. If the built tree is post-processed and its
+ // structure is changed, hash codes of nodes may change!
+ private Map<DiffNode, String> customLabels = new IdentityHashMap<>();
+
+ /**
+ * Creates a new {@link GitMergeEditorInput}.
+ *
+ * @param mode
+ * defining what to use as input for the logical left side
+ * @param locations
+ * as selected by the user
+ */
+ public GitMergeEditorInput(MergeInputMode mode, IPath... locations) {
+ super(null, locations);
+ this.useWorkspace = !MergeInputMode.STAGE_2.equals(mode);
+ this.useOurs = MergeInputMode.MERGED_OURS.equals(mode);
+ this.mode = mode;
+ CompareConfiguration config = getCompareConfiguration();
+ config.setLeftEditable(true);
+ }
+
+ @Override
+ public int hashCode() {
+ return 31 * super.hashCode() + Objects.hash(mode);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!super.equals(obj)) {
+ return false;
+ }
+ GitMergeEditorInput other = (GitMergeEditorInput)obj;
+ return mode == other.mode;
+ }
+
+ @Override
+ protected void initActions(ToolBarManager manager, Viewer newViewer, ICompareInput input) {
+ super.initActions(manager, newViewer, input);
+ setToggleCurrentChangesAction(manager, newViewer, input);
+ }
+
+ private void setToggleCurrentChangesAction(ToolBarManager manager, Viewer newViewer,
+ ICompareInput input) {
+ boolean isApplicable = newViewer instanceof ContentMergeViewer && input instanceof MergeDiffNode
+ && input.getAncestor() != null;
+ setAction(manager, newViewer, isApplicable, ToggleCurrentChangesAction.COMMAND_ID, create -> {
+ if (toggleCurrentChanges == null && create) {
+ toggleCurrentChanges = new ToggleCurrentChangesAction(
+ UIText.GitMergeEditorInput_ToggleCurrentChangesLabel, this);
+ toggleCurrentChanges.setId(ToggleCurrentChangesAction.COMMAND_ID);
+ }
+ return toggleCurrentChanges;
+ });
+ }
+
+ @Override
+ protected void disposeActions() {
+ if (toggleCurrentChanges != null) {
+ toggleCurrentChanges.dispose();
+ toggleCurrentChanges = null;
+ }
+ super.disposeActions();
+ }
+
+ @Override
+ protected GitInfo getGitInfo(IPath path) {
+ return new GitInfo() {
+
+ @Override
+ public Repository getRepository() {
+ return GitMergeEditorInput.this.getRepository();
+ }
+
+ @Override
+ public String getGitPath() {
+ return path.toString();
+ }
+
+ @Override
+ public Source getSource() {
+ return Source.WORKING_TREE;
+ }
+
+ @Override
+ public AnyObjectId getCommitId() {
+ return null;
+ }
+ };
+ }
+
+ @Override
+ protected Object buildInput(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ RevWalk rw = null;
+ try {
+ Repository repo = getRepository();
+
+ rw = new RevWalk(repo);
+
+ // get the "right" side
+ final RevCommit rightCommit;
+ try {
+ rightCommit = RevCommitUtils.getTheirs(repo, rw);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+
+ // we need the HEAD, also to determine the common
+ // ancestor
+ final RevCommit headCommit;
+ try {
+ ObjectId head = repo.resolve(Constants.HEAD);
+ if (head == null) {
+ throw new IOException(
+ NLS.bind(CoreText.ValidationUtils_CanNotResolveRefMessage, Constants.HEAD));
+ }
+ headCommit = rw.parseCommit(head);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+
+ final String fullBranch;
+ try {
+ fullBranch = repo.getFullBranch();
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+
+ CompareConfiguration config = getCompareConfiguration();
+ // try to obtain the common ancestor
+ RevCommit ancestorCommit = null;
+ boolean unknownAncestor = false;
+ switch (repo.getRepositoryState()) {
+ case CHERRY_PICKING:
+ case REBASING_INTERACTIVE:
+ case REBASING_MERGE:
+ if (rightCommit.getParentCount() == 1) {
+ try {
+ ancestorCommit = rw.parseCommit(rightCommit.getParent(0));
+ } catch (IOException e) {
+ unknownAncestor = true;
+ }
+ } else {
+ // Cherry-pick of a merge commit -- git doesn't record the
+ // mainline index anywhere, so we don't know which parent
+ // was taken.
+ unknownAncestor = true;
+ }
+ if (!MergeInputMode.WORKTREE.equals(mode)) {
+ // Do not suppress any changes on the left if the input is
+ // the possibly pre-merged working tree version. Conflict
+ // markers exist only on the left; they would not be shown
+ // as differences, and are then too easy to miss.
+ config.setChangeIgnored(
+ config.isMirrored() ? RangeDifference.RIGHT : RangeDifference.LEFT, true);
+ config.setChangeIgnored(RangeDifference.ANCESTOR, true);
+ }
+ break;
+ default:
+ List<RevCommit> startPoints = new ArrayList<>();
+ rw.setRevFilter(RevFilter.MERGE_BASE);
+ startPoints.add(rightCommit);
+ startPoints.add(headCommit);
+ try {
+ rw.markStart(startPoints);
+ ancestorCommit = rw.next();
+ } catch (Exception e) {
+ // Ignore; ancestor remains null
+ }
+ break;
+ }
+
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ // set the labels
+ config.setRightLabel(NLS.bind(LABELPATTERN, rightCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(rightCommit.name())));
+
+ if (!useWorkspace) {
+ config.setLeftLabel(NLS.bind(LABELPATTERN, headCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(headCommit.name())));
+ } else if (useOurs) {
+ config.setLeftLabel(UIText.GitMergeEditorInput_WorkspaceOursHeader);
+ } else {
+ config.setLeftLabel(UIText.GitMergeEditorInput_WorkspaceHeader);
+ }
+ if (ancestorCommit != null) {
+ config.setAncestorLabel(NLS.bind(LABELPATTERN, ancestorCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(ancestorCommit.name())));
+ } else if (unknownAncestor) {
+ config.setAncestorLabel(NLS.bind(UIText.GitMergeEditorInput_AncestorUnknownHeader,
+ CompareUtils.truncatedRevision(rightCommit.name())));
+ }
+ // set title and icon
+ setTitle(NLS.bind(UIText.GitMergeEditorInput_MergeEditorTitle,
+ new Object[] {RepositoryUtil.INSTANCE.getRepositoryName(repo),
+ rightCommit.getShortMessage(), fullBranch }));
+
+ // EMF Compare Specific
+ ICompareInput input = prepareCompareInput(repo, getFilterPaths(), monitor);
+ if (input != null) {
+ return input;
+ }
+ // END EMF Compare Specific
+
+ // build the nodes
+ try {
+ return buildDiffContainer(repo, headCommit, ancestorCommit, rw, monitor);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ } finally {
+ if (rw != null) {
+ rw.dispose();
+ }
+ }
+ }
+
+ @Override
+ protected void inputBuilt(Object root) {
+ super.inputBuilt(root);
+ customLabels.forEach((node, name) -> setLeftLabel(node, name, false));
+ customLabels.clear();
+ }
+
+ private DiffContainer buildDiffContainer(Repository repository, RevCommit headCommit,
+ RevCommit ancestorCommit, RevWalk rw, IProgressMonitor monitor)
+ throws IOException, InterruptedException {
+
+ monitor.setTaskName(UIText.GitMergeEditorInput_CalculatingDiffTaskName);
+ DiffContainer result = new DiffNode(Differencer.CONFLICTING);
+
+ ConflictStyle style = null;
+ try (TreeWalk tw = new TreeWalk(repository)) {
+ int dirCacheIndex = tw.addTree(new DirCacheIterator(repository.readDirCache()));
+ FileTreeIterator fIter = new FileTreeIterator(repository);
+ int fileTreeIndex = tw.addTree(fIter);
+ fIter.setDirCacheIterator(tw, dirCacheIndex);
+ int repositoryTreeIndex = tw.addTree(rw.parseTree(repository.resolve(Constants.HEAD)));
+
+ // filter by selected resources
+ Collection<String> filterPaths = getFilterPaths();
+ if (!filterPaths.isEmpty()) {
+ if (filterPaths.size() > 1) {
+ tw.setFilter(PathFilterGroup.createFromStrings(filterPaths));
+ } else {
+ String path = filterPaths.iterator().next();
+ if (!path.isEmpty()) {
+ tw.setFilter(PathFilterGroup.createFromStrings(path));
+ }
+ }
+ }
+ tw.setRecursive(true);
+
+ while (tw.next()) {
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ String gitPath = tw.getPathString();
+ monitor.setTaskName(gitPath);
+
+ FileTreeIterator fit = tw.getTree(fileTreeIndex, FileTreeIterator.class);
+ if (fit == null) {
+ continue;
+ }
+
+ DirCacheIterator dit = tw.getTree(dirCacheIndex, DirCacheIterator.class);
+
+ final DirCacheEntry dirCacheEntry = dit == null ? null : dit.getDirCacheEntry();
+
+ boolean conflicting = dirCacheEntry != null && dirCacheEntry.getStage() > 0;
+
+ AbstractTreeIterator rt = tw.getTree(repositoryTreeIndex, AbstractTreeIterator.class);
+
+ // compare local file against HEAD to see if it was modified
+ boolean modified = rt != null && !fit.getEntryObjectId().equals(rt.getEntryObjectId());
+
+ // if this is neither conflicting nor changed, we skip it
+ if (!conflicting && !modified) {
+ continue;
+ }
+
+ ITypedElement right;
+ String encoding = null;
+ if (conflicting) {
+ GitFileRevision revision = GitFileRevision.inIndex(repository, gitPath,
+ DirCacheEntry.STAGE_3);
+ encoding = CompareCoreUtils.getResourceEncoding(repository, gitPath);
+ right = new FileRevisionTypedElement(revision, encoding);
+ } else {
+ right = CompareUtils.getFileRevisionTypedElement(gitPath, headCommit, repository);
+ }
+ // can this really happen?
+ if (right instanceof EmptyTypedElement) {
+ continue;
+ }
+ ITypedElement left;
+ IFileRevision rev;
+ // if the file is not conflicting (as it was auto-merged)
+ // we will show the auto-merged (local) version
+
+ Path repositoryPath = new Path(repository.getWorkTree().getAbsolutePath());
+ IPath location = repositoryPath.append(gitPath);
+ assert location != null;
+ IFile file = ResourceUtil.getFileForLocation(location, false);
+ boolean useWorkingTree = !conflicting || useWorkspace;
+ boolean stage2FromWorkingTree = false;
+ if (!useWorkingTree && conflicting && dirCacheEntry != null) {
+ // Normal conflict stages have a zero timestamp. If it's not
+ // zero, we marked it below when the content was saved to
+ // the working tree file in an earlier merge editor.
+ useWorkingTree = !Instant.EPOCH.equals(dirCacheEntry.getLastModifiedInstant());
+ stage2FromWorkingTree = useWorkingTree;
+ }
+ if (useWorkingTree) {
+ boolean useOursFilter = conflicting && useOurs;
+ int conflictMarkerSize = 7; // Git default
+ if (useOursFilter) {
+ Attributes attributes = tw.getAttributes();
+ useOursFilter = attributes.canBeContentMerged();
+ if (useOursFilter) {
+ Attribute markerSize = attributes.get("conflict-marker-size"); //$NON-NLS-1$
+ if (markerSize != null && Attribute.State.CUSTOM.equals(markerSize.getState())) {
+ try {
+ conflictMarkerSize = Integer.parseUnsignedInt(markerSize.getValue());
+ } catch (NumberFormatException e) {
+ // Ignore
+ }
+ }
+ }
+ }
+ LocalResourceTypedElement item;
+ if (useOursFilter) {
+ if (style == null) {
+ style = repository.getConfig().getEnum(ConfigConstants.CONFIG_MERGE_SECTION, null,
+ ConfigConstants.CONFIG_KEY_CONFLICTSTYLE, ConflictStyle.MERGE);
+ }
+ boolean useDiff3Style = ConflictStyle.DIFF3.equals(style);
+ String filter = (useDiff3Style ? 'O' : 'o') + Integer.toString(conflictMarkerSize);
+ URI uri = EgitFileSystem.createURI(repository, gitPath, "WORKTREE:" + filter); //$NON-NLS-1$
+ Charset rscEncoding = null;
+ if (file != null) {
+ if (encoding == null) {
+ encoding = CompareCoreUtils.getResourceEncoding(file);
+ }
+ try {
+ rscEncoding = Charset.forName(encoding);
+ } catch (IllegalArgumentException e) {
+ // Ignore here; use default.
+ }
+ }
+ item = createWithHiddenResource(uri, repository, gitPath, tw.getNameString(), file,
+ rscEncoding);
+ if (file != null) {
+ item.setSharedDocumentListener(new LocalResourceSaver(item) {
+
+ @Override
+ protected void save() throws CoreException {
+ super.save();
+ file.refreshLocal(IResource.DEPTH_ZERO, null);
+ }
+ });
+ } else {
+ item.setSharedDocumentListener(new LocalResourceSaver(item));
+ }
+ } else {
+ if (file != null) {
+ item = new LocalResourceTypedElement(file);
+ } else {
+ item = new LocalNonWorkspaceTypedElement(repository, location);
+ }
+ item.setSharedDocumentListener(new LocalResourceSaver(item));
+ }
+ left = item;
+ } else {
+ IFile rsc = file != null ? file
+ : createHiddenResource(location.toFile().toURI(), tw.getNameString(), null);
+ assert rsc != null;
+ // Stage 2 from index with backing IResource
+ rev = GitFileRevision.inIndex(repository, gitPath, DirCacheEntry.STAGE_2);
+ IRunnableContext runnableContext = getContainer();
+ if (runnableContext == null) {
+ runnableContext = PlatformUI.getWorkbench().getProgressService();
+ assert runnableContext != null;
+ }
+ left = new ResourceEditableRevision(rev, rsc, runnableContext);
+ // 'left' saves to the working tree. Update the index entry
+ // with the current time. Normal conflict stages have a
+ // timestamp of zero, so this is a non-invasive fully
+ // compatible way to mark this conflict stage so that the
+ // next time we do take the file contents.
+ ((EditableRevision)left)
+ .addContentChangeListener(source -> updateIndexTimestamp(repository, gitPath));
+ // make sure we don't need a round trip later
+ try {
+ ((EditableRevision)left).cacheContents(monitor);
+ } catch (CoreException e) {
+ throw new IOException(e.getMessage(), e);
+ }
+ }
+
+ int kind = Differencer.NO_CHANGE;
+ if (conflicting) {
+ kind = Differencer.CONFLICTING + Differencer.CHANGE;
+ } else if (modified) {
+ kind = Differencer.LEFT + Differencer.ADDITION;
+ }
+ IDiffContainer fileParent = getFileParent(result, repositoryPath, file, location);
+
+ ITypedElement ancestor = null;
+ if (ancestorCommit != null) {
+ ancestor = CompareUtils.getFileRevisionTypedElement(gitPath, ancestorCommit, repository);
+ // we get an ugly black icon if we have an EmptyTypedElement
+ // instead of null
+ if (ancestor instanceof EmptyTypedElement) {
+ ancestor = null;
+ }
+ } else if (conflicting) {
+ GitFileRevision revision = GitFileRevision.inIndex(repository, gitPath,
+ DirCacheEntry.STAGE_1);
+ if (encoding == null) {
+ encoding = CompareCoreUtils.getResourceEncoding(repository, gitPath);
+ }
+ ancestor = new FileRevisionTypedElement(revision, encoding);
+ }
+ // create the node as child
+ DiffNode node = new MergeDiffNode(fileParent, kind, ancestor, left, right);
+ if (stage2FromWorkingTree) {
+ customLabels.put(node, tw.getNameString());
+ } else if (left instanceof EditableRevision) {
+ String name = tw.getNameString();
+ ((EditableRevision)left)
+ .addContentChangeListener(source -> setLeftLabel(node, name, true));
+ }
+ }
+ return result;
+ } catch (URISyntaxException e) {
+ throw new IOException(e.getMessage(), e);
+ }
+ }
+
+ private void updateIndexTimestamp(Repository repository, String gitPath) {
+ DirCache cache = null;
+ try {
+ cache = repository.lockDirCache();
+ DirCacheEditor editor = cache.editor();
+ editor.add(new PathEdit(gitPath) {
+
+ private boolean done;
+
+ @Override
+ public void apply(DirCacheEntry ent) {
+ if (!done && ent.getStage() > 0) {
+ ent.setLastModified(Instant.now());
+ done = true;
+ }
+ }
+ });
+ editor.commit();
+ } catch (IOException e) {
+ Activator.logError(MessageFormat.format(UIText.GitMergeEditorInput_ErrorUpdatingIndex, gitPath),
+ e);
+ } finally {
+ if (cache != null) {
+ cache.unlock();
+ }
+ }
+ }
+
+ private void setLeftLabel(DiffNode node, String name, boolean fireChange) {
+ GitCompareLabelProvider labels = new GitCompareLabelProvider() {
+
+ @Override
+ public String getLeftLabel(Object input) {
+ return MessageFormat.format(UIText.GitCompareFileRevisionEditorInput_LocalLabel, name);
+ }
+
+ @Override
+ public String getRightLabel(Object input) {
+ return null; // Use default
+ }
+
+ @Override
+ public String getAncestorLabel(Object input) {
+ return null; // Use default
+ }
+ };
+ getCompareConfiguration().setLabelProvider(node, labels);
+ if (fireChange) {
+ labels.fireNodeLabelChanged(node);
+ }
+ }
+
+ // EMF Compare Specific
+ protected ICompareInput prepareCompareInput(Repository repository, Collection<String> filterPaths,
+ IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ return null;
+ }
+ // END EMF Compare Specific
+
+}
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
index 2c3ab1cf8..6dfe4f6c7 100644
--- a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInput.java
@@ -15,26 +15,14 @@ package org.eclipse.emf.compare.egit.ui.internal.merge;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
import java.util.Set;
-import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.IResourceProvider;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
@@ -47,53 +35,20 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.egit.core.internal.CompareCoreUtils;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffData;
import org.eclipse.egit.core.internal.job.RuleUtil;
-import org.eclipse.egit.core.internal.storage.GitFileRevision;
import org.eclipse.egit.core.internal.util.ResourceUtil;
import org.eclipse.egit.core.project.RepositoryMapping;
-import org.eclipse.egit.ui.Activator;
-import org.eclipse.egit.ui.internal.CompareUtils;
-import org.eclipse.egit.ui.internal.UIText;
-import org.eclipse.egit.ui.internal.revision.EditableRevision;
-import org.eclipse.egit.ui.internal.revision.FileRevisionTypedElement;
-import org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput.EmptyTypedElement;
-import org.eclipse.egit.ui.internal.revision.LocationEditableRevision;
-import org.eclipse.egit.ui.internal.revision.ResourceEditableRevision;
-import org.eclipse.egit.ui.internal.synchronize.compare.LocalNonWorkspaceTypedElement;
+import org.eclipse.egit.ui.internal.merge.MergeInputMode;
import org.eclipse.emf.compare.egit.internal.merge.DirCacheResourceVariantTreeProvider;
import org.eclipse.emf.compare.egit.internal.merge.GitResourceVariantTreeProvider;
import org.eclipse.emf.compare.egit.internal.merge.GitResourceVariantTreeSubscriber;
import org.eclipse.emf.compare.egit.internal.merge.LogicalModels;
import org.eclipse.emf.compare.egit.ui.internal.EMFCompareEGitUIMessages;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jgit.api.RebaseCommand;
-import org.eclipse.jgit.dircache.DirCacheEntry;
-import org.eclipse.jgit.dircache.DirCacheIterator;
-import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.jgit.revwalk.RevWalk;
-import org.eclipse.jgit.revwalk.filter.RevFilter;
-import org.eclipse.jgit.treewalk.AbstractTreeIterator;
-import org.eclipse.jgit.treewalk.FileTreeIterator;
-import org.eclipse.jgit.treewalk.TreeWalk;
-import org.eclipse.jgit.treewalk.filter.AndTreeFilter;
-import org.eclipse.jgit.treewalk.filter.NotIgnoredFilter;
-import org.eclipse.jgit.treewalk.filter.OrTreeFilter;
-import org.eclipse.jgit.treewalk.filter.PathFilter;
-import org.eclipse.jgit.treewalk.filter.TreeFilter;
-import org.eclipse.jgit.util.IO;
-import org.eclipse.jgit.util.RawParseUtils;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.diff.IDiff;
-import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
import org.eclipse.team.core.subscribers.Subscriber;
@@ -101,10 +56,6 @@ import org.eclipse.team.core.subscribers.SubscriberMergeContext;
import org.eclipse.team.core.subscribers.SubscriberResourceMappingContext;
import org.eclipse.team.core.subscribers.SubscriberScopeManager;
import org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter;
-import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE.SharedImages;
/**
* A Git-specific {@link CompareEditorInput}. This class is a copy from
@@ -113,107 +64,16 @@ import org.eclipse.ui.ide.IDE.SharedImages;
* @author <a href="mailto:mathias.kinzler@sap.com">Mathias Kinzler</a>
*/
@SuppressWarnings("restriction")
-public class ModelGitMergeEditorInput extends CompareEditorInput {
- private static final String LABELPATTERN = "{0} - {1}"; //$NON-NLS-1$
+public class ModelGitMergeEditorInput extends GitMergeEditorInput {
- private static final Image FOLDER_IMAGE = PlatformUI.getWorkbench().getSharedImages()
- .getImage(ISharedImages.IMG_OBJ_FOLDER);
+ private final boolean useWS;
- private static final Image PROJECT_IMAGE = PlatformUI.getWorkbench().getSharedImages()
- .getImage(SharedImages.IMG_OBJ_PROJECT);
+ private final IPath[] paths;
- private final boolean useWorkspace;
-
- private final IPath[] locations;
-
- /**
- * @param useWorkspace
- * if <code>true</code>, use the workspace content (i.e. the Git-merged version) as "left"
- * content, otherwise use HEAD (i.e. the previous, non-merged version)
- * @param locations
- * as selected by the user
- */
- public ModelGitMergeEditorInput(boolean useWorkspace, IPath... locations) {
- super(new CompareConfiguration());
- this.useWorkspace = useWorkspace;
- this.locations = locations;
- CompareConfiguration config = getCompareConfiguration();
- config.setLeftEditable(true);
- }
-
- @Override
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if ((adapter == IFile.class || adapter == IResource.class) && isUIThread()) {
- Object selectedEdition = getSelectedEdition();
- if (selectedEdition instanceof DiffNode) {
- DiffNode diffNode = (DiffNode)selectedEdition;
- ITypedElement element = diffNode.getLeft();
- if (element instanceof IResourceProvider) {
- IResource resource = ((IResourceProvider)element).getResource();
- return resource;
- }
- }
- }
- return super.getAdapter(adapter);
- }
-
- private static boolean isUIThread() {
- return Display.getCurrent() != null;
- }
-
- @Override
- protected Object prepareInput(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- monitor.beginTask(UIText.GitMergeEditorInput_CheckingResourcesTaskName, IProgressMonitor.UNKNOWN);
-
- // Make sure all resources belong to the same repository
- final Map<Repository, Collection<String>> pathsByRepository = ResourceUtil
- .splitPathsByRepository(Arrays.asList(locations));
- if (pathsByRepository.size() != 1) {
- throw new InvocationTargetException(
- new IllegalStateException(UIText.RepositoryAction_multiRepoSelection));
- }
-
- checkCanceled(monitor);
-
- // The merge drivers have done their job of putting the necessary
- // information in the index
- // Read that info and provide it to the file-specific comparators
- try (final Repository repository = pathsByRepository.keySet().iterator().next();
- RevWalk rw = new RevWalk(repository)) {
- final List<String> filterPaths = new ArrayList<String>(pathsByRepository.get(repository));
- // get the "right" side (MERGE_HEAD for merge, ORIG_HEAD for rebase)
- final RevCommit rightCommit = getRightCommit(rw, repository);
-
- // we need the HEAD, also to determine the common ancestor
- final RevCommit headCommit = getLeftCommit(rw, repository);
-
- // try to obtain the common ancestor
- RevCommit ancestorCommit = getCommonAncestor(rw, rightCommit, headCommit);
-
- checkCanceled(monitor);
-
- // set the labels
- setLabels(repository, rightCommit, headCommit, ancestorCommit);
-
- final ICompareInput input = prepareCompareInput(repository, filterPaths, monitor);
- if (input != null) {
- return input;
- }
-
- checkCanceled(monitor);
- return buildDiffContainer(repository, headCommit, ancestorCommit, filterPaths, rw, monitor);
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
-
- private void checkCanceled(IProgressMonitor monitor) throws InterruptedException {
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
+ public ModelGitMergeEditorInput(MergeInputMode mode, IPath... locations) {
+ super(mode, locations);
+ this.useWS = !MergeInputMode.STAGE_2.equals(mode);
+ this.paths = locations;
}
/**
@@ -248,11 +108,12 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
* @throws InvocationTargetException
* @throws InterruptedException
*/
- private ICompareInput prepareCompareInput(Repository repository, List<String> filterPaths,
+ @Override
+ protected ICompareInput prepareCompareInput(Repository repository, Collection<String> filterPaths,
IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
final GitResourceVariantTreeProvider variantTreeProvider = new DirCacheResourceVariantTreeProvider(
- repository, useWorkspace);
+ repository, useWS);
final Subscriber subscriber = new GitResourceVariantTreeSubscriber(variantTreeProvider);
checkCanceled(monitor);
@@ -266,7 +127,7 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
// in the workspace and at least one resource is not.
final Set<IResource> resourcesInOperation = new LinkedHashSet<IResource>();
boolean outOfWS = false;
- for (IPath path : locations) {
+ for (IPath path : paths) {
boolean foundMatchInWS = false;
final Iterator<IProject> projectIterator = projects.iterator();
while (!foundMatchInWS && projectIterator.hasNext()) {
@@ -368,14 +229,20 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
return null;
}
+ private void checkCanceled(IProgressMonitor monitor) throws InterruptedException {
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ }
+
private Set<IResource> getConflictingFilesFrom(IContainer container) throws IOException {
final Set<IResource> conflictingResources = new LinkedHashSet<IResource>();
final RepositoryMapping mapping = RepositoryMapping.getMapping(container);
if (mapping == null) {
return conflictingResources;
}
- final IndexDiffCacheEntry indexDiffCacheEntry = org.eclipse.egit.core.Activator.getDefault()
- .getIndexDiffCache().getIndexDiffCacheEntry(mapping.getRepository());
+ final IndexDiffCacheEntry indexDiffCacheEntry = IndexDiffCache.INSTANCE
+ .getIndexDiffCacheEntry(mapping.getRepository());
if (indexDiffCacheEntry == null) {
return conflictingResources;
}
@@ -417,303 +284,6 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
return context;
}
- private RevCommit getRightCommit(RevWalk revWalk, Repository repository)
- throws InvocationTargetException {
- try {
- String target;
- if (repository.getRepositoryState().equals(RepositoryState.MERGING)) {
- target = Constants.MERGE_HEAD;
- } else if (repository.getRepositoryState().equals(RepositoryState.CHERRY_PICKING)) {
- target = Constants.CHERRY_PICK_HEAD;
- } else if (repository.getRepositoryState().equals(RepositoryState.REBASING_INTERACTIVE)) {
- target = readFile(repository.getDirectory(),
- RebaseCommand.REBASE_MERGE + File.separatorChar + RebaseCommand.STOPPED_SHA);
- } else {
- target = Constants.ORIG_HEAD;
- }
- ObjectId mergeHead = repository.resolve(target);
- if (mergeHead == null) {
- throw new IOException(NLS.bind(
- EMFCompareEGitUIMessages.getString("ValidationUtils_CanNotResolveRefMessage"), //$NON-NLS-1$
- target));
- }
- return revWalk.parseCommit(mergeHead);
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- private RevCommit getLeftCommit(RevWalk revWalk, Repository repository) throws InvocationTargetException {
- try {
- ObjectId head = repository.resolve(Constants.HEAD);
- if (head == null) {
- throw new IOException(NLS.bind(
- EMFCompareEGitUIMessages.getString("ValidationUtils_CanNotResolveRefMessage"), //$NON-NLS-1$
- Constants.HEAD));
- }
- return revWalk.parseCommit(head);
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- private RevCommit getCommonAncestor(RevWalk revWalk, RevCommit rightCommit, RevCommit leftCommit) {
- List<RevCommit> startPoints = new ArrayList<RevCommit>();
- revWalk.setRevFilter(RevFilter.MERGE_BASE);
- startPoints.add(rightCommit);
- startPoints.add(leftCommit);
- try {
- revWalk.markStart(startPoints);
- return revWalk.next();
- } catch (Exception e) {
- return null;
- }
- }
-
- private void setLabels(Repository repository, RevCommit rightCommit, RevCommit leftCommit,
- RevCommit ancestorCommit) throws InvocationTargetException {
- CompareConfiguration config = getCompareConfiguration();
- config.setRightLabel(NLS.bind(LABELPATTERN, rightCommit.getShortMessage(),
- CompareUtils.truncatedRevision(rightCommit.name())));
-
- if (!useWorkspace) {
- config.setLeftLabel(NLS.bind(LABELPATTERN, leftCommit.getShortMessage(),
- CompareUtils.truncatedRevision(leftCommit.name())));
- } else {
- config.setLeftLabel(UIText.GitMergeEditorInput_WorkspaceHeader);
- }
-
- if (ancestorCommit != null) {
- config.setAncestorLabel(NLS.bind(LABELPATTERN, ancestorCommit.getShortMessage(),
- CompareUtils.truncatedRevision(ancestorCommit.name())));
- }
-
- // set title and icon
- final String fullBranch;
- try {
- fullBranch = repository.getFullBranch();
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- setTitle(NLS.bind(UIText.GitMergeEditorInput_MergeEditorTitle,
- new Object[] {Activator.getDefault().getRepositoryUtil().getRepositoryName(repository),
- rightCommit.getShortMessage(), fullBranch }));
- }
-
- @Override
- protected void contentsCreated() {
- super.contentsCreated();
- // select the first conflict
- getNavigator().selectChange(true);
- }
-
- @Override
- protected void handleDispose() {
- super.handleDispose();
- // we do NOT dispose the images, as these are shared
- }
-
- private IDiffContainer buildDiffContainer(Repository repository, RevCommit headCommit,
- RevCommit ancestorCommit, List<String> filterPaths, RevWalk rw, IProgressMonitor monitor)
- throws IOException, InterruptedException {
-
- monitor.setTaskName(UIText.GitMergeEditorInput_CalculatingDiffTaskName);
- IDiffContainer result = new DiffNode(Differencer.CONFLICTING);
-
- try (TreeWalk tw = new TreeWalk(repository)) {
- int dirCacheIndex = tw.addTree(new DirCacheIterator(repository.readDirCache()));
- int fileTreeIndex = tw.addTree(new FileTreeIterator(repository));
- int repositoryTreeIndex = tw.addTree(rw.parseTree(repository.resolve(Constants.HEAD)));
-
- // skip ignored resources
- NotIgnoredFilter notIgnoredFilter = new NotIgnoredFilter(fileTreeIndex);
- // filter by selected resources
- if (filterPaths.size() > 1) {
- List<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();
- for (String filterPath : filterPaths) {
- suffixFilters.add(PathFilter.create(filterPath));
- }
- TreeFilter otf = OrTreeFilter.create(suffixFilters);
- tw.setFilter(AndTreeFilter.create(otf, notIgnoredFilter));
- } else if (filterPaths.size() > 0) {
- String path = filterPaths.get(0);
- if (path.length() == 0) {
- tw.setFilter(notIgnoredFilter);
- } else {
- tw.setFilter(AndTreeFilter.create(PathFilter.create(path), notIgnoredFilter));
- }
- } else {
- tw.setFilter(notIgnoredFilter);
- }
-
- tw.setRecursive(true);
-
- while (tw.next()) {
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
- String gitPath = tw.getPathString();
- monitor.setTaskName(gitPath);
-
- FileTreeIterator fit = tw.getTree(fileTreeIndex, FileTreeIterator.class);
- if (fit == null) {
- continue;
- }
-
- DirCacheIterator dit = tw.getTree(dirCacheIndex, DirCacheIterator.class);
-
- final DirCacheEntry dirCacheEntry = dit == null ? null : dit.getDirCacheEntry();
-
- boolean conflicting = dirCacheEntry != null && dirCacheEntry.getStage() > 0;
-
- AbstractTreeIterator rt = tw.getTree(repositoryTreeIndex, AbstractTreeIterator.class);
-
- // compare local file against HEAD to see if it was modified
- boolean modified = rt != null && !fit.getEntryObjectId().equals(rt.getEntryObjectId());
-
- // if this is neither conflicting nor changed, we skip it
- if (!conflicting && !modified) {
- continue;
- }
-
- ITypedElement right;
- if (conflicting) {
- GitFileRevision revision = GitFileRevision.inIndex(repository, gitPath,
- DirCacheEntry.STAGE_3);
- String encoding = CompareCoreUtils.getResourceEncoding(repository, gitPath);
- right = new FileRevisionTypedElement(revision, encoding);
- } else {
- right = CompareUtils.getFileRevisionTypedElement(gitPath, headCommit, repository);
- }
-
- // can this really happen?
- if (right instanceof EmptyTypedElement) {
- continue;
- }
-
- ITypedElement left;
- IFileRevision rev;
- // if the file is not conflicting (as it was auto-merged)
- // we will show the auto-merged (local) version
-
- Path repositoryPath = new Path(repository.getWorkTree().getAbsolutePath());
- IPath location = repositoryPath.append(fit.getEntryPathString());
- assert location != null;
-
- IFile file = ResourceUtil.getFileForLocation(location, false);
- if (!conflicting || useWorkspace) {
- if (file != null) {
- left = SaveableCompareEditorInput.createFileElement(file);
- } else {
- left = new LocalNonWorkspaceTypedElement(repository, location);
- }
- } else {
- rev = GitFileRevision.inIndex(repository, gitPath, DirCacheEntry.STAGE_2);
-
- IRunnableContext runnableContext = getContainer();
- if (runnableContext == null) {
- runnableContext = PlatformUI.getWorkbench().getProgressService();
- assert runnableContext != null;
- }
- if (file != null) {
- left = new ResourceEditableRevision(rev, file, runnableContext);
- } else {
- left = new LocationEditableRevision(rev, location, runnableContext);
- }
- // make sure we don't need a round trip later
- try {
- ((EditableRevision)left).cacheContents(monitor);
- } catch (CoreException e) {
- throw new IOException(e.getMessage());
- }
- }
-
- int kind = Differencer.NO_CHANGE;
- if (conflicting) {
- kind = Differencer.CONFLICTING;
- } else if (modified) {
- kind = Differencer.PSEUDO_CONFLICT;
- }
-
- IDiffContainer fileParent = getFileParent(result, repositoryPath, file, location);
-
- ITypedElement ancestor = null;
- if (ancestorCommit != null) {
- ancestor = CompareUtils.getFileRevisionTypedElement(gitPath, ancestorCommit, repository);
- }
- // we get an ugly black icon if we have an EmptyTypedElement
- // instead of null
- if (ancestor instanceof EmptyTypedElement) {
- ancestor = null;
- }
- // create the node as child
- new DiffNode(fileParent, kind, ancestor, left, right);
- }
- return result;
- }
- }
-
- private IDiffContainer getFileParent(IDiffContainer root, IPath repositoryPath, IFile file,
- IPath location) {
- int projectSegment = -1;
- String projectName = null;
- if (file != null) {
- IProject project = file.getProject();
- IPath projectLocation = project.getLocation();
- if (projectLocation != null) {
- IPath projectPath = project.getLocation().makeRelativeTo(repositoryPath);
- projectSegment = projectPath.segmentCount() - 1;
- projectName = project.getName();
- }
- }
-
- IPath path = location.makeRelativeTo(repositoryPath);
- IDiffContainer child = root;
- for (int i = 0; i < path.segmentCount() - 1; i++) {
- if (i == projectSegment) {
- child = getOrCreateChild(child, projectName, true);
- } else {
- child = getOrCreateChild(child, path.segment(i), false);
- }
- }
- return child;
- }
-
- private DiffNode getOrCreateChild(IDiffContainer parent, final String name, final boolean projectMode) {
- for (IDiffElement child : parent.getChildren()) {
- if (child.getName().equals(name)) {
- return ((DiffNode)child);
- }
- }
- DiffNode child = new DiffNode(parent, Differencer.NO_CHANGE) {
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public Image getImage() {
- if (projectMode) {
- return PROJECT_IMAGE;
- } else {
- return FOLDER_IMAGE;
- }
- }
- };
- return child;
- }
-
- private String readFile(File directory, String fileName) throws IOException {
- byte[] content = IO.readFully(new File(directory, fileName));
- // strip off the last LF
- int end = content.length;
- while (0 < end && content[end - 1] == '\n') {
- end--;
- }
- return RawParseUtils.decode(content, 0, end);
- }
-
private static class GitSynchronizationContext extends SubscriberMergeContext {
public GitSynchronizationContext(Subscriber subscriber, ISynchronizationScopeManager scopeManager) {
super(subscriber, scopeManager);
@@ -755,5 +325,6 @@ public class ModelGitMergeEditorInput extends CompareEditorInput {
return RuleUtil.getRule(repository);
}
}
+
}
// CHECKSTYLE:ON
diff --git a/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInputLegacy.java b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInputLegacy.java
new file mode 100644
index 000000000..4b7cab835
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.egit.ui/src/org/eclipse/emf/compare/egit/ui/internal/merge/ModelGitMergeEditorInputLegacy.java
@@ -0,0 +1,786 @@
+/*******************************************************************************
+ * Copyright (C) 2010, 2014 Mathias Kinzler <mathias.kinzler@sap.com> and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Borkowski - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.egit.ui.internal.merge;
+
+//CHECKSTYLE:OFF
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.IResourceProvider;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
+import org.eclipse.core.resources.mapping.ResourceMapping;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.egit.core.internal.CompareCoreUtils;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffData;
+import org.eclipse.egit.core.internal.job.RuleUtil;
+import org.eclipse.egit.core.internal.storage.GitFileRevision;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
+import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.egit.ui.internal.CompareUtils;
+import org.eclipse.egit.ui.internal.UIText;
+import org.eclipse.egit.ui.internal.revision.EditableRevision;
+import org.eclipse.egit.ui.internal.revision.FileRevisionTypedElement;
+import org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput.EmptyTypedElement;
+import org.eclipse.egit.ui.internal.revision.ResourceEditableRevision;
+import org.eclipse.egit.ui.internal.synchronize.compare.LocalNonWorkspaceTypedElement;
+import org.eclipse.emf.compare.egit.internal.EGitCompatibilityUtil;
+import org.eclipse.emf.compare.egit.internal.merge.DirCacheResourceVariantTreeProvider;
+import org.eclipse.emf.compare.egit.internal.merge.GitResourceVariantTreeProvider;
+import org.eclipse.emf.compare.egit.internal.merge.GitResourceVariantTreeSubscriber;
+import org.eclipse.emf.compare.egit.internal.merge.LogicalModels;
+import org.eclipse.emf.compare.egit.ui.internal.EMFCompareEGitUIMessages;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jgit.api.RebaseCommand;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.dircache.DirCacheIterator;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.RepositoryState;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.revwalk.filter.RevFilter;
+import org.eclipse.jgit.treewalk.AbstractTreeIterator;
+import org.eclipse.jgit.treewalk.FileTreeIterator;
+import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.treewalk.filter.AndTreeFilter;
+import org.eclipse.jgit.treewalk.filter.NotIgnoredFilter;
+import org.eclipse.jgit.treewalk.filter.OrTreeFilter;
+import org.eclipse.jgit.treewalk.filter.PathFilter;
+import org.eclipse.jgit.treewalk.filter.TreeFilter;
+import org.eclipse.jgit.util.IO;
+import org.eclipse.jgit.util.RawParseUtils;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.core.diff.IDiff;
+import org.eclipse.team.core.history.IFileRevision;
+import org.eclipse.team.core.mapping.ISynchronizationContext;
+import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
+import org.eclipse.team.core.subscribers.Subscriber;
+import org.eclipse.team.core.subscribers.SubscriberMergeContext;
+import org.eclipse.team.core.subscribers.SubscriberResourceMappingContext;
+import org.eclipse.team.core.subscribers.SubscriberScopeManager;
+import org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter;
+import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE.SharedImages;
+
+/**
+ * A Git-specific {@link CompareEditorInput}. This class is a copy from
+ * org.eclipse.egit.ui.internal.merge.GitMergeEditorInput.
+ *
+ * @author <a href="mailto:mathias.kinzler@sap.com">Mathias Kinzler</a>
+ */
+@SuppressWarnings("restriction")
+public class ModelGitMergeEditorInputLegacy extends CompareEditorInput {
+ private static final String LABELPATTERN = "{0} - {1}"; //$NON-NLS-1$
+
+ private static final Image FOLDER_IMAGE = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FOLDER);
+
+ private static final Image PROJECT_IMAGE = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(SharedImages.IMG_OBJ_PROJECT);
+
+ private final boolean useWorkspace;
+
+ private final IPath[] locations;
+
+ /**
+ * @param useWorkspace
+ * if <code>true</code>, use the workspace content (i.e. the Git-merged version) as "left"
+ * content, otherwise use HEAD (i.e. the previous, non-merged version)
+ * @param locations
+ * as selected by the user
+ */
+ public ModelGitMergeEditorInputLegacy(boolean useWorkspace, IPath... locations) {
+ super(new CompareConfiguration());
+ this.useWorkspace = useWorkspace;
+ this.locations = locations;
+ CompareConfiguration config = getCompareConfiguration();
+ config.setLeftEditable(true);
+ }
+
+ @Override
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+ if ((adapter == IFile.class || adapter == IResource.class) && isUIThread()) {
+ Object selectedEdition = getSelectedEdition();
+ if (selectedEdition instanceof DiffNode) {
+ DiffNode diffNode = (DiffNode)selectedEdition;
+ ITypedElement element = diffNode.getLeft();
+ if (element instanceof IResourceProvider) {
+ IResource resource = ((IResourceProvider)element).getResource();
+ return resource;
+ }
+ }
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private static boolean isUIThread() {
+ return Display.getCurrent() != null;
+ }
+
+ @Override
+ protected Object prepareInput(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(UIText.GitMergeEditorInput_CheckingResourcesTaskName, IProgressMonitor.UNKNOWN);
+
+ // Make sure all resources belong to the same repository
+ final Map<Repository, Collection<String>> pathsByRepository = ResourceUtil
+ .splitPathsByRepository(Arrays.asList(locations));
+ if (pathsByRepository.size() != 1) {
+ throw new InvocationTargetException(
+ new IllegalStateException(UIText.RepositoryAction_multiRepoSelection));
+ }
+
+ checkCanceled(monitor);
+
+ // The merge drivers have done their job of putting the necessary
+ // information in the index
+ // Read that info and provide it to the file-specific comparators
+ final Repository repository = pathsByRepository.keySet().iterator().next();
+ RevWalk rw = new RevWalk(repository);
+ try {
+ final List<String> filterPaths = new ArrayList<String>(pathsByRepository.get(repository));
+ // get the "right" side (MERGE_HEAD for merge, ORIG_HEAD for rebase)
+ final RevCommit rightCommit = getRightCommit(rw, repository);
+
+ // we need the HEAD, also to determine the common ancestor
+ final RevCommit headCommit = getLeftCommit(rw, repository);
+
+ // try to obtain the common ancestor
+ RevCommit ancestorCommit = getCommonAncestor(rw, rightCommit, headCommit);
+
+ checkCanceled(monitor);
+
+ // set the labels
+ setLabels(repository, rightCommit, headCommit, ancestorCommit);
+
+ final ICompareInput input = prepareCompareInput(repository, filterPaths, monitor);
+ if (input != null) {
+ return input;
+ }
+
+ checkCanceled(monitor);
+ return buildDiffContainer(repository, headCommit, ancestorCommit, filterPaths, rw, monitor);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ rw.dispose();
+ monitor.done();
+ }
+ }
+
+ private void checkCanceled(IProgressMonitor monitor) throws InterruptedException {
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ }
+
+ /**
+ * Even if there is a single file involved in this operation, it may have a custom comparator or merger
+ * defined. This will be found through its specific ISynchronizationCompareAdapter.
+ * <p>
+ * If there are multiple files involved, we need them all to be part of the same logical model. Otherwise,
+ * we can't be sure that multiple ISynchronizationCompareAdapter aren't interested in the different files,
+ * and thus cannot show a valid 'aggregate' compare editor.
+ * </p>
+ * <p>
+ * Then again, even if the multiple files involved are all part of single-file models (i.e. none of them
+ * is a part of a larger logical model, and we have as many models involved as there are files), we cannot
+ * show them all within the same compare editor input. Comparing the files and determining conflicts is
+ * the job of the ISynchronizationCompareAdapter(s), <u>not</u> ours. If we cannot reliably find the
+ * appropriate compare adapter, we should not try and compare the files ourselves. The user will have to
+ * manually open the merge tool on each individual logical model.
+ * </p>
+ * <p>
+ * Since we cannot determine the logical model of a file that is not in the workspace, this will fall back
+ * to the 'old' merge tool (we compute the diffs ourselves without consideration for the file type) iff
+ * there are <u>only</u> such files in the locations set.
+ * </p>
+ *
+ * @param repository
+ * Repository within which the compared files are located.
+ * @param filterPaths
+ * repository-relative paths of the resources we are comparing.
+ * @param monitor
+ * Monitor on which to report progress to the user.
+ * @return The useable compare input.
+ * @throws InvocationTargetException
+ * @throws InterruptedException
+ */
+ private ICompareInput prepareCompareInput(Repository repository, List<String> filterPaths,
+ IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ final GitResourceVariantTreeProvider variantTreeProvider = new DirCacheResourceVariantTreeProvider(
+ repository, useWorkspace);
+ final Subscriber subscriber = new GitResourceVariantTreeSubscriber(variantTreeProvider);
+ checkCanceled(monitor);
+
+ final Set<IProject> projects = new LinkedHashSet<IProject>();
+ for (IResource root : subscriber.roots()) {
+ projects.add(root.getProject());
+ }
+
+ // Compute the set of IResources involved in this operation.
+ // This will be cut short if we find that at least one resource is
+ // in the workspace and at least one resource is not.
+ final Set<IResource> resourcesInOperation = new LinkedHashSet<IResource>();
+ boolean outOfWS = false;
+ for (IPath path : locations) {
+ boolean foundMatchInWS = false;
+ final Iterator<IProject> projectIterator = projects.iterator();
+ while (!foundMatchInWS && projectIterator.hasNext()) {
+ final IProject project = projectIterator.next();
+ final IPath projectLocation = project.getLocation();
+ if (projectLocation.equals(path)) {
+ resourcesInOperation.addAll(getConflictingFilesFrom(project));
+ foundMatchInWS = true;
+ } else if (project.getLocation().isPrefixOf(path)) {
+ final IResource resource = ResourceUtil.getResourceForLocation(path, false);
+ if (resource instanceof IContainer) {
+ resourcesInOperation.addAll(getConflictingFilesFrom((IContainer)resource));
+ } else {
+ resourcesInOperation.add(resource);
+ }
+ foundMatchInWS = true;
+ }
+ }
+ if (!foundMatchInWS) {
+ if (!resourcesInOperation.isEmpty()) {
+ // no need to go any further : we have both files in the
+ // workspace and files outside of it
+ break;
+ } else {
+ // for now, all paths are out of the ws
+ outOfWS = true;
+ }
+ } else if (outOfWS) {
+ // There was a match in the workspace for this one
+ // yet at least one path before that was out of the ws
+ break;
+ }
+ }
+
+ checkCanceled(monitor);
+
+ if (!resourcesInOperation.isEmpty() && outOfWS) {
+ // At least one resource is in the workspace while at least one
+ // is out of it.
+ // We cannot reliably tell whether they are related enough to be
+ // in the same compare editor.
+ throw new InvocationTargetException(new IllegalStateException(
+ EMFCompareEGitUIMessages.getString("GitMergeEditorInput_OutOfWSResources"))); //$NON-NLS-1$
+ } else if (resourcesInOperation.isEmpty()) {
+ // All resources are out of the workspace.
+ // Fall back to the workspace-unaware "prepareDiffInput"
+ } else {
+ final RemoteResourceMappingContext remoteMappingContext = new SubscriberResourceMappingContext(
+ subscriber, true);
+ // Make sure that all of the compared resources are either
+ // - all part of the same model, or
+ // - not part of any model.
+ Set<IResource> model = null;
+ for (IResource comparedResource : resourcesInOperation) {
+ model = LogicalModels.discoverModel(comparedResource, remoteMappingContext);
+ if (model.isEmpty()) {
+ // not part of any model... carry on
+ } else {
+ if (!model.containsAll(resourcesInOperation)) {
+ // These resources belong to multiple different
+ // models.
+ // The merge tool needs to be launched manually on
+ // each distinct logical model.
+ throw new RuntimeException(
+ EMFCompareEGitUIMessages.getString("GitMergeEditorInput_MultipleModels")); //$NON-NLS-1$
+ } else {
+ // No use going further : we know these resource all
+ // belong to the same model.
+ break;
+ }
+ }
+ }
+
+ final ISynchronizationCompareAdapter compareAdapter = LogicalModels.findAdapter(model,
+ ISynchronizationCompareAdapter.class);
+ if (compareAdapter != null) {
+ final Set<ResourceMapping> allMappings = LogicalModels.getResourceMappings(model,
+ remoteMappingContext);
+
+ checkCanceled(monitor);
+
+ final ISynchronizationContext synchronizationContext = prepareSynchronizationContext(
+ repository, subscriber, allMappings, remoteMappingContext);
+ final Object modelObject = allMappings.iterator().next().getModelObject();
+ if (compareAdapter.hasCompareInput(synchronizationContext, modelObject)) {
+ return compareAdapter.asCompareInput(synchronizationContext, modelObject);
+ } else {
+ // This compare adapter does not know about our model
+ // object
+ }
+ } else {
+ // There isn't a specific compare adapter for this logical
+ // model. Fall back to default.
+ }
+ }
+ } catch (IOException | CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ return null;
+ }
+
+ private Set<IResource> getConflictingFilesFrom(IContainer container) throws IOException {
+ final Set<IResource> conflictingResources = new LinkedHashSet<IResource>();
+ final RepositoryMapping mapping = RepositoryMapping.getMapping(container);
+ if (mapping == null) {
+ return conflictingResources;
+ }
+ final IndexDiffCacheEntry indexDiffCacheEntry = EGitCompatibilityUtil.getIndexDiffCache()
+ .getIndexDiffCacheEntry(mapping.getRepository());
+ if (indexDiffCacheEntry == null) {
+ return conflictingResources;
+ }
+ final IndexDiffData indexDiffData = indexDiffCacheEntry.getIndexDiff();
+ if (indexDiffData != null) {
+ final IPath containerPath = container.getLocation();
+ final File workTree = mapping.getWorkTree();
+ if (workTree != null) {
+ final IPath workDirPrefix = new Path(workTree.getCanonicalPath());
+ for (String conflicting : indexDiffData.getConflicting()) {
+ final IPath resourcePath = workDirPrefix.append(conflicting);
+ if (containerPath.isPrefixOf(resourcePath)) {
+ final IPath containerRelativePath = resourcePath
+ .removeFirstSegments(containerPath.segmentCount());
+ conflictingResources.add(container.getFile(containerRelativePath));
+ }
+ }
+ }
+ }
+ return conflictingResources;
+ }
+
+ private ISynchronizationContext prepareSynchronizationContext(final Repository repository,
+ Subscriber subscriber, Set<ResourceMapping> allModelMappings,
+ RemoteResourceMappingContext mappingContext)
+ throws CoreException, OperationCanceledException, InterruptedException {
+ final ResourceMapping[] mappings = allModelMappings
+ .toArray(new ResourceMapping[allModelMappings.size()]);
+
+ final ISynchronizationScopeManager manager = new InternalSubscriberScopeManager(subscriber.getName(),
+ mappings, subscriber, mappingContext, true, repository);
+ manager.initialize(new NullProgressMonitor());
+
+ final ISynchronizationContext context = new GitSynchronizationContext(subscriber, manager);
+ // Wait for the asynchronous scope expanding to end (started from the
+ // initialization of our synchronization context)
+ Job.getJobManager().join(context, new NullProgressMonitor());
+
+ return context;
+ }
+
+ private RevCommit getRightCommit(RevWalk revWalk, Repository repository)
+ throws InvocationTargetException {
+ try {
+ String target;
+ if (repository.getRepositoryState().equals(RepositoryState.MERGING)) {
+ target = Constants.MERGE_HEAD;
+ } else if (repository.getRepositoryState().equals(RepositoryState.CHERRY_PICKING)) {
+ target = Constants.CHERRY_PICK_HEAD;
+ } else if (repository.getRepositoryState().equals(RepositoryState.REBASING_INTERACTIVE)) {
+ target = readFile(repository.getDirectory(),
+ RebaseCommand.REBASE_MERGE + File.separatorChar + RebaseCommand.STOPPED_SHA);
+ } else {
+ target = Constants.ORIG_HEAD;
+ }
+ ObjectId mergeHead = repository.resolve(target);
+ if (mergeHead == null) {
+ throw new IOException(NLS.bind(
+ EMFCompareEGitUIMessages.getString("ValidationUtils_CanNotResolveRefMessage"), //$NON-NLS-1$
+ target));
+ }
+ return revWalk.parseCommit(mergeHead);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+
+ private RevCommit getLeftCommit(RevWalk revWalk, Repository repository) throws InvocationTargetException {
+ try {
+ ObjectId head = repository.resolve(Constants.HEAD);
+ if (head == null) {
+ throw new IOException(NLS.bind(
+ EMFCompareEGitUIMessages.getString("ValidationUtils_CanNotResolveRefMessage"), //$NON-NLS-1$
+ Constants.HEAD));
+ }
+ return revWalk.parseCommit(head);
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+
+ private RevCommit getCommonAncestor(RevWalk revWalk, RevCommit rightCommit, RevCommit leftCommit) {
+ List<RevCommit> startPoints = new ArrayList<RevCommit>();
+ revWalk.setRevFilter(RevFilter.MERGE_BASE);
+ startPoints.add(rightCommit);
+ startPoints.add(leftCommit);
+ try {
+ revWalk.markStart(startPoints);
+ return revWalk.next();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private void setLabels(Repository repository, RevCommit rightCommit, RevCommit leftCommit,
+ RevCommit ancestorCommit) throws InvocationTargetException {
+ CompareConfiguration config = getCompareConfiguration();
+ config.setRightLabel(NLS.bind(LABELPATTERN, rightCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(rightCommit.name())));
+
+ if (!useWorkspace) {
+ config.setLeftLabel(NLS.bind(LABELPATTERN, leftCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(leftCommit.name())));
+ } else {
+ config.setLeftLabel(UIText.GitMergeEditorInput_WorkspaceHeader);
+ }
+
+ if (ancestorCommit != null) {
+ config.setAncestorLabel(NLS.bind(LABELPATTERN, ancestorCommit.getShortMessage(),
+ CompareUtils.truncatedRevision(ancestorCommit.name())));
+ }
+
+ // set title and icon
+ final String fullBranch;
+ try {
+ fullBranch = repository.getFullBranch();
+ } catch (IOException e) {
+ throw new InvocationTargetException(e);
+ }
+ setTitle(NLS.bind(UIText.GitMergeEditorInput_MergeEditorTitle,
+ new Object[] {EGitCompatibilityUtil.getRepositoryUtil().getRepositoryName(repository),
+ rightCommit.getShortMessage(), fullBranch }));
+ }
+
+ @Override
+ protected void contentsCreated() {
+ super.contentsCreated();
+ // select the first conflict
+ getNavigator().selectChange(true);
+ }
+
+ @Override
+ protected void handleDispose() {
+ super.handleDispose();
+ // we do NOT dispose the images, as these are shared
+ }
+
+ private IDiffContainer buildDiffContainer(Repository repository, RevCommit headCommit,
+ RevCommit ancestorCommit, List<String> filterPaths, RevWalk rw, IProgressMonitor monitor)
+ throws IOException, InterruptedException {
+
+ monitor.setTaskName(UIText.GitMergeEditorInput_CalculatingDiffTaskName);
+ IDiffContainer result = new DiffNode(Differencer.CONFLICTING);
+
+ try (TreeWalk tw = new TreeWalk(repository)) {
+ int dirCacheIndex = tw.addTree(new DirCacheIterator(repository.readDirCache()));
+ int fileTreeIndex = tw.addTree(new FileTreeIterator(repository));
+ int repositoryTreeIndex = tw.addTree(rw.parseTree(repository.resolve(Constants.HEAD)));
+
+ // skip ignored resources
+ NotIgnoredFilter notIgnoredFilter = new NotIgnoredFilter(fileTreeIndex);
+ // filter by selected resources
+ if (filterPaths.size() > 1) {
+ List<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();
+ for (String filterPath : filterPaths) {
+ suffixFilters.add(PathFilter.create(filterPath));
+ }
+ TreeFilter otf = OrTreeFilter.create(suffixFilters);
+ tw.setFilter(AndTreeFilter.create(otf, notIgnoredFilter));
+ } else if (filterPaths.size() > 0) {
+ String path = filterPaths.get(0);
+ if (path.length() == 0) {
+ tw.setFilter(notIgnoredFilter);
+ } else {
+ tw.setFilter(AndTreeFilter.create(PathFilter.create(path), notIgnoredFilter));
+ }
+ } else {
+ tw.setFilter(notIgnoredFilter);
+ }
+
+ tw.setRecursive(true);
+
+ while (tw.next()) {
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ String gitPath = tw.getPathString();
+ monitor.setTaskName(gitPath);
+
+ FileTreeIterator fit = tw.getTree(fileTreeIndex, FileTreeIterator.class);
+ if (fit == null) {
+ continue;
+ }
+
+ DirCacheIterator dit = tw.getTree(dirCacheIndex, DirCacheIterator.class);
+
+ final DirCacheEntry dirCacheEntry = dit == null ? null : dit.getDirCacheEntry();
+
+ boolean conflicting = dirCacheEntry != null && dirCacheEntry.getStage() > 0;
+
+ AbstractTreeIterator rt = tw.getTree(repositoryTreeIndex, AbstractTreeIterator.class);
+
+ // compare local file against HEAD to see if it was modified
+ boolean modified = rt != null && !fit.getEntryObjectId().equals(rt.getEntryObjectId());
+
+ // if this is neither conflicting nor changed, we skip it
+ if (!conflicting && !modified) {
+ continue;
+ }
+
+ ITypedElement right;
+ if (conflicting) {
+ GitFileRevision revision = GitFileRevision.inIndex(repository, gitPath,
+ DirCacheEntry.STAGE_3);
+ String encoding = CompareCoreUtils.getResourceEncoding(repository, gitPath);
+ right = new FileRevisionTypedElement(revision, encoding);
+ } else {
+ right = CompareUtils.getFileRevisionTypedElement(gitPath, headCommit, repository);
+ }
+
+ // can this really happen?
+ if (right instanceof EmptyTypedElement) {
+ continue;
+ }
+
+ ITypedElement left;
+ IFileRevision rev;
+ // if the file is not conflicting (as it was auto-merged)
+ // we will show the auto-merged (local) version
+
+ Path repositoryPath = new Path(repository.getWorkTree().getAbsolutePath());
+ IPath location = repositoryPath.append(fit.getEntryPathString());
+ assert location != null;
+
+ IFile file = ResourceUtil.getFileForLocation(location, false);
+ if (!conflicting || useWorkspace) {
+ if (file != null) {
+ left = SaveableCompareEditorInput.createFileElement(file);
+ } else {
+ left = new LocalNonWorkspaceTypedElement(repository, location);
+ }
+ } else {
+ rev = GitFileRevision.inIndex(repository, gitPath, DirCacheEntry.STAGE_2);
+
+ IRunnableContext runnableContext = getContainer();
+ if (runnableContext == null) {
+ runnableContext = PlatformUI.getWorkbench().getProgressService();
+ assert runnableContext != null;
+ }
+ if (file != null) {
+ left = new ResourceEditableRevision(rev, file, runnableContext);
+ } else {
+ left = createLocationEditableRevision(rev, location, runnableContext);
+ }
+ // make sure we don't need a round trip later
+ try {
+ ((EditableRevision)left).cacheContents(monitor);
+ } catch (CoreException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ int kind = Differencer.NO_CHANGE;
+ if (conflicting) {
+ kind = Differencer.CONFLICTING;
+ } else if (modified) {
+ kind = Differencer.PSEUDO_CONFLICT;
+ }
+
+ IDiffContainer fileParent = getFileParent(result, repositoryPath, file, location);
+
+ ITypedElement ancestor = null;
+ if (ancestorCommit != null) {
+ ancestor = CompareUtils.getFileRevisionTypedElement(gitPath, ancestorCommit, repository);
+ }
+ // we get an ugly black icon if we have an EmptyTypedElement
+ // instead of null
+ if (ancestor instanceof EmptyTypedElement) {
+ ancestor = null;
+ }
+ // create the node as child
+ new DiffNode(fileParent, kind, ancestor, left, right);
+ }
+ return result;
+ }
+ }
+
+ private IDiffContainer getFileParent(IDiffContainer root, IPath repositoryPath, IFile file,
+ IPath location) {
+ int projectSegment = -1;
+ String projectName = null;
+ if (file != null) {
+ IProject project = file.getProject();
+ IPath projectLocation = project.getLocation();
+ if (projectLocation != null) {
+ IPath projectPath = project.getLocation().makeRelativeTo(repositoryPath);
+ projectSegment = projectPath.segmentCount() - 1;
+ projectName = project.getName();
+ }
+ }
+
+ IPath path = location.makeRelativeTo(repositoryPath);
+ IDiffContainer child = root;
+ for (int i = 0; i < path.segmentCount() - 1; i++) {
+ if (i == projectSegment) {
+ child = getOrCreateChild(child, projectName, true);
+ } else {
+ child = getOrCreateChild(child, path.segment(i), false);
+ }
+ }
+ return child;
+ }
+
+ private DiffNode getOrCreateChild(IDiffContainer parent, final String name, final boolean projectMode) {
+ for (IDiffElement child : parent.getChildren()) {
+ if (child.getName().equals(name)) {
+ return ((DiffNode)child);
+ }
+ }
+ DiffNode child = new DiffNode(parent, Differencer.NO_CHANGE) {
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public Image getImage() {
+ if (projectMode) {
+ return PROJECT_IMAGE;
+ } else {
+ return FOLDER_IMAGE;
+ }
+ }
+ };
+ return child;
+ }
+
+ private String readFile(File directory, String fileName) throws IOException {
+ byte[] content = IO.readFully(new File(directory, fileName));
+ // strip off the last LF
+ int end = content.length;
+ while (0 < end && content[end - 1] == '\n') {
+ end--;
+ }
+ return RawParseUtils.decode(content, 0, end);
+ }
+
+ private static class GitSynchronizationContext extends SubscriberMergeContext {
+ public GitSynchronizationContext(Subscriber subscriber, ISynchronizationScopeManager scopeManager) {
+ super(subscriber, scopeManager);
+ initialize();
+ }
+
+ public void markAsMerged(IDiff node, boolean inSyncHint, IProgressMonitor monitor)
+ throws CoreException {
+ // Won't be used as a merging context
+ }
+
+ public void reject(IDiff diff, IProgressMonitor monitor) throws CoreException {
+ // Won't be used as a merging context
+ }
+
+ @Override
+ protected void makeInSync(IDiff diff, IProgressMonitor monitor) throws CoreException {
+ // Won't be used as a merging context
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+ }
+
+ private static final class InternalSubscriberScopeManager extends SubscriberScopeManager {
+ private final Repository repository;
+
+ public InternalSubscriberScopeManager(String name, ResourceMapping[] inputMappings,
+ Subscriber subscriber, RemoteResourceMappingContext context, boolean consultModels,
+ Repository repository) {
+ super(name, inputMappings, subscriber, context, consultModels);
+ this.repository = repository;
+ }
+
+ @Override
+ public ISchedulingRule getSchedulingRule() {
+ return RuleUtil.getRule(repository);
+ }
+ }
+
+ /**
+ * Should never be used in any EGit version higher than 5.12 included as LocationEditableRevision has been
+ * deleted.
+ *
+ * @return The created revision in EGit lower than 5.12, <code>null</code> otherwise.
+ */
+ public static ITypedElement createLocationEditableRevision(IFileRevision rev, IPath location,
+ IRunnableContext runnableContext) {
+ if (EGitCompatibilityUtil.getEGitVersion().compareTo(EGitCompatibilityUtil.EGIT_5_12) >= 0) {
+ return null;
+ } else {
+ try {
+ Class<?> revClass = Class
+ .forName("org.eclipse.egit.ui.internal.revision.LocationEditableRevision"); //$NON-NLS-1$
+ Constructor<?> constructor = revClass.getConstructor(IFileRevision.class, IPath.class,
+ IRunnableContext.class);
+ return (ITypedElement)constructor.newInstance(rev, location, runnableContext);
+ } catch (ClassNotFoundException | NoSuchMethodException | InstantiationException
+ | IllegalAccessException | InvocationTargetException e) {
+ // We know the class and constructor exist in that version.
+ return null;
+ }
+ }
+ }
+}
+// CHECKSTYLE:ON
diff --git a/plugins/org.eclipse.emf.compare.egit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.egit/META-INF/MANIFEST.MF
index 0bbdf3da3..bf02f915f 100644
--- a/plugins/org.eclipse.emf.compare.egit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.egit/META-INF/MANIFEST.MF
@@ -5,15 +5,15 @@ Bundle-SymbolicName: org.eclipse.emf.compare.egit;singleton:=true
Bundle-Version: 1.2.4.qualifier
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
- org.eclipse.jgit;bundle-version="[4.9.0,6.0.0)",
+ org.eclipse.jgit;bundle-version="5.0.0",
org.eclipse.team.core;bundle-version="3.7.0",
- org.eclipse.egit.core;bundle-version="4.2.0",
+ org.eclipse.egit.core;bundle-version="5.0.0",
org.eclipse.emf.compare.ide;bundle-version="3.2.0",
org.eclipse.emf.compare.rcp,
org.eclipse.emf.compare,
- org.eclipse.egit.ui;bundle-version="4.2.0"
-Import-Package: com.google.common.collect;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="[1.2.15,2.0.0)"
+ org.eclipse.egit.ui;bundle-version="5.0.0",
+ org.eclipse.compare
+Import-Package: com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/EGitCompatibilityUtil.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/EGitCompatibilityUtil.java
new file mode 100644
index 000000000..6db10be23
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/EGitCompatibilityUtil.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (C) 2021, Obeo.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.emf.compare.egit.internal;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
+import org.eclipse.egit.core.internal.storage.WorkspaceFileRevision;
+import org.eclipse.jgit.lib.Repository;
+import org.osgi.framework.Version;
+
+/**
+ * This will act as a facade between EGit and EMF Compare so as to bypass the breaks that happen in EGit in
+ * the restricted interfaces we need.
+ *
+ * @author lgoubet
+ */
+@SuppressWarnings("restriction")
+public class EGitCompatibilityUtil {
+
+ /** Version 5.11.0. */
+ public static final Version EGIT_5_11 = new Version(5, 11, 0);
+
+ /** Version 5.12.0 */
+ public static final Version EGIT_5_12 = new Version(5, 12, 0);
+
+ /** Version 6.0.0 */
+ public static final Version EGIT_6_0 = new Version(6, 0, 0);
+
+ public static RepositoryUtil getRepositoryUtil() {
+ if (getEGitVersion().compareTo(EGIT_6_0) >= 0) {
+ return RepositoryUtil.INSTANCE;
+ } else if (getEGitVersion().compareTo(EGIT_5_11) >= 0) {
+ return (RepositoryUtil)invoke(RepositoryUtil.class, null, "getInstance"); //$NON-NLS-1$
+ } else {
+ Activator activator = Activator.getDefault();
+ return (RepositoryUtil)invoke(Activator.class, activator, "getRepositoryUtil"); //$NON-NLS-1$
+ }
+ }
+
+ public static IndexDiffCache getIndexDiffCache() {
+ if (getEGitVersion().compareTo(EGIT_6_0) >= 0) {
+ return IndexDiffCache.INSTANCE;
+ } else if (getEGitVersion().compareTo(EGIT_5_11) >= 0) {
+ return (IndexDiffCache)invoke(IndexDiffCache.class, null, "getInstance"); //$NON-NLS-1$
+ } else {
+ Activator activator = Activator.getDefault();
+ return (IndexDiffCache)invoke(Activator.class, activator, "getIndexDiffCache"); //$NON-NLS-1$
+ }
+ }
+
+ public static WorkspaceFileRevision createWorkspaceFileRevision(Repository repo, IResource local) {
+ if (getEGitVersion().compareTo(EGIT_6_0) >= 0) {
+ return WorkspaceFileRevision.forFile(repo, local);
+ } else {
+ try {
+ Constructor<WorkspaceFileRevision> constructor = WorkspaceFileRevision.class
+ .getConstructor(IResource.class);
+ return constructor.newInstance(local);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException
+ | InstantiationException e) {
+ // Will not happen as we're targeting specific methods we know of
+ }
+ }
+ return null;
+ }
+
+ public static Version getEGitVersion() {
+ return Platform.getBundle("org.eclipse.egit.ui").getVersion(); //$NON-NLS-1$
+ }
+
+ public static Object invoke(Class<?> targetClass, Object target, String methodName) {
+ try {
+ Method method = targetClass.getDeclaredMethod(methodName);
+ return method.invoke(target);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
+ // Will not happen as we're targeting specific methods we know of
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/DirCacheResourceVariantTreeProvider.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/DirCacheResourceVariantTreeProvider.java
index 70823c87f..c93b6ec8a 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/DirCacheResourceVariantTreeProvider.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/DirCacheResourceVariantTreeProvider.java
@@ -44,6 +44,8 @@ public class DirCacheResourceVariantTreeProvider implements GitResourceVariantTr
private final Set<IResource> knownResources;
+ private final Repository repository;
+
/**
* Constructs the resource variant trees by iterating over the given repository's DirCache entries.
*
@@ -56,6 +58,7 @@ public class DirCacheResourceVariantTreeProvider implements GitResourceVariantTr
*/
public DirCacheResourceVariantTreeProvider(Repository repository, boolean useWorkspace)
throws IOException {
+ this.repository = repository;
final DirCache cache = repository.readDirCache();
final GitResourceVariantCache baseCache = new GitResourceVariantCache();
final GitResourceVariantCache sourceCache = new GitResourceVariantCache();
@@ -102,12 +105,12 @@ public class DirCacheResourceVariantTreeProvider implements GitResourceVariantTr
sourceTree = new GitCachedResourceVariantTree(sourceCache);
remoteTree = new GitCachedResourceVariantTree(remoteCache);
- roots = new LinkedHashSet<IResource>();
+ roots = new LinkedHashSet<>();
roots.addAll(baseCache.getRoots());
roots.addAll(sourceCache.getRoots());
roots.addAll(remoteCache.getRoots());
- knownResources = new LinkedHashSet<IResource>();
+ knownResources = new LinkedHashSet<>();
knownResources.addAll(baseCache.getKnownResources());
knownResources.addAll(sourceCache.getKnownResources());
knownResources.addAll(remoteCache.getKnownResources());
@@ -132,5 +135,9 @@ public class DirCacheResourceVariantTreeProvider implements GitResourceVariantTr
public Set<IResource> getRoots() {
return roots;
}
+
+ public Repository getRepository() {
+ return repository;
+ }
}
// CHECKSTYLE:ON
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitResourceVariantTreeProvider.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitResourceVariantTreeProvider.java
index f81e37cdf..974322c31 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitResourceVariantTreeProvider.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitResourceVariantTreeProvider.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.egit.internal.merge;
import java.util.Set;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.team.core.variants.IResourceVariantTree;
/**
@@ -58,5 +59,12 @@ public interface GitResourceVariantTreeProvider {
* @return The whole set of resources for which this provider's trees hold variants.
*/
Set<IResource> getKnownResources();
+
+ /**
+ * The underlying repository.
+ *
+ * @return The underlying repository for this variant tree provider.
+ */
+ Repository getRepository();
}
// CHECKSTYLE:ON
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitSyncInfoToDiffConverter.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitSyncInfoToDiffConverter.java
index fcb0fd672..5ea0f470d 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitSyncInfoToDiffConverter.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/GitSyncInfoToDiffConverter.java
@@ -13,8 +13,8 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.internal.CoreText;
-import org.eclipse.egit.core.internal.storage.WorkspaceFileRevision;
import org.eclipse.egit.core.synchronize.GitRemoteResource;
+import org.eclipse.emf.compare.egit.internal.EGitCompatibilityUtil;
import org.eclipse.emf.compare.egit.internal.storage.GitLocalResourceVariant;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
@@ -133,7 +133,8 @@ public class GitSyncInfoToDiffConverter extends SyncInfoToDiffConverter {
local.getName());
Activator.logError(error, e);
// fall back to the working tree version
- return new WorkspaceFileRevision(local);
+ return EGitCompatibilityUtil.createWorkspaceFileRevision(variantTreeProvider.getRepository(),
+ local);
}
}
@@ -174,7 +175,8 @@ public class GitSyncInfoToDiffConverter extends SyncInfoToDiffConverter {
if (variant == null) {
return null;
} else if (variant instanceof GitLocalResourceVariant) {
- return new WorkspaceFileRevision(((GitLocalResourceVariant)variant).getResource());
+ return EGitCompatibilityUtil.createWorkspaceFileRevision(variantTreeProvider.getRepository(),
+ ((GitLocalResourceVariant)variant).getResource());
}
return asFileRevision(variant);
}
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
index 76017d522..dff663b41 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
@@ -19,7 +19,6 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceMapping;
@@ -37,6 +36,7 @@ import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.emf.compare.egit.internal.storage.AbstractGitResourceVariant;
import org.eclipse.emf.compare.egit.internal.storage.TreeParserResourceVariant;
import org.eclipse.emf.compare.egit.internal.wrapper.JGitProgressMonitorWrapper;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
import org.eclipse.jgit.attributes.Attributes;
import org.eclipse.jgit.diff.RawText;
import org.eclipse.jgit.dircache.DirCacheBuildIterator;
@@ -92,7 +92,7 @@ import org.eclipse.team.core.variants.IResourceVariant;
@SuppressWarnings("restriction")
public class RecursiveModelMerger extends RecursiveMerger {
- private static final Logger LOGGER = Logger.getLogger(RecursiveModelMerger.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(RecursiveModelMerger.class);
/**
* This will be populated during the course of the RecursiveMappingMergers' executions. These files have
@@ -290,12 +290,18 @@ public class RecursiveModelMerger extends RecursiveMerger {
throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException {
boolean hasWorkingTreeIterator = tw.getTreeCount() > T_FILE;
boolean hasAttributeNodeProvider = treeWalk.getAttributesNodeProvider() != null;
+ Attributes[] attributes = {new Attributes(), new Attributes(), new Attributes() };
+ if (hasAttributeNodeProvider) {
+ attributes[T_BASE] = treeWalk.getAttributes(T_BASE);
+ attributes[T_OURS] = treeWalk.getAttributes(T_OURS);
+ attributes[T_THEIRS] = treeWalk.getAttributes(T_THEIRS);
+ }
return processEntry(treeWalk.getTree(T_BASE, CanonicalTreeParser.class),
treeWalk.getTree(T_OURS, CanonicalTreeParser.class),
treeWalk.getTree(T_THEIRS, CanonicalTreeParser.class),
treeWalk.getTree(T_INDEX, DirCacheBuildIterator.class),
hasWorkingTreeIterator ? treeWalk.getTree(T_FILE, WorkingTreeIterator.class) : null,
- ignoreConflicts, hasAttributeNodeProvider ? treeWalk.getAttributes() : new Attributes());
+ ignoreConflicts, attributes);
}
/**
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/TreeWalkResourceVariantTreeProvider.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/TreeWalkResourceVariantTreeProvider.java
index f6a220406..dccb68aa7 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/TreeWalkResourceVariantTreeProvider.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/TreeWalkResourceVariantTreeProvider.java
@@ -67,8 +67,10 @@ public class TreeWalkResourceVariantTreeProvider implements GitResourceVariantTr
private final LinkedHashMap<IPath, IProject> map;
- private TreeWalkResourceVariantTreeProvider(Builder builder) {
+ private final Repository repository;
+ private TreeWalkResourceVariantTreeProvider(Builder builder) {
+ this.repository = builder.repository;
this.map = builder.map;
this.baseTree = builder.baseTree;
this.theirsTree = builder.theirsTree;
@@ -112,7 +114,10 @@ public class TreeWalkResourceVariantTreeProvider implements GitResourceVariantTr
public IResource getResourceHandleForLocation(Repository repository, String repoRelativePath,
boolean isFolder) {
return getResourceHandleForLocation(repository, repoRelativePath, isFolder, map);
+ }
+ public Repository getRepository() {
+ return repository;
}
/**
@@ -157,7 +162,7 @@ public class TreeWalkResourceVariantTreeProvider implements GitResourceVariantTr
// It may be a file that only exists on remote side. We need to
// create an IResource for it.
// If it is a project file, then create an IProject.
- final List<IPath> list = new ArrayList<IPath>(map.keySet());
+ final List<IPath> list = new ArrayList<>(map.keySet());
for (int i = list.size() - 1; i >= 0; i--) {
IPath projectPath = list.get(i);
if (projectPath.isPrefixOf(path) && !projectPath.equals(path)) {
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/storage/IndexBlobStorage.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/storage/IndexBlobStorage.java
index 3962eb3c6..b30ca7104 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/storage/IndexBlobStorage.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/storage/IndexBlobStorage.java
@@ -11,10 +11,10 @@ package org.eclipse.emf.compare.egit.internal.storage;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.internal.storage.CommitBlobStorage;
import org.eclipse.egit.core.storage.GitBlobStorage;
+import org.eclipse.emf.compare.egit.internal.EGitCompatibilityUtil;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
@@ -36,7 +36,7 @@ public class IndexBlobStorage extends GitBlobStorage {
@Override
public IPath getFullPath() {
- final RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil();
+ final RepositoryUtil repositoryUtil = EGitCompatibilityUtil.getRepositoryUtil();
IPath repoPath = new Path(repositoryUtil.getRepositoryName(db));
String pathString = super.getFullPath().toPortableString() + " index"; //$NON-NLS-1$
return repoPath.append(Path.fromPortableString(pathString));
diff --git a/plugins/org.eclipse.emf.compare.ide.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.tests/META-INF/MANIFEST.MF
index feb5011ec..b260a99e5 100644
--- a/plugins/org.eclipse.emf.compare.ide.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.tests/META-INF/MANIFEST.MF
@@ -17,4 +17,4 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Import-Package: com.google.common.io;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.io;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/META-INF/MANIFEST.MF
index 20f1b27d5..5a2c85bc1 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.framework/META-INF/MANIFEST.MF
@@ -20,5 +20,5 @@ Bundle-Vendor: %providerName
Export-Package: org.eclipse.emf.compare.ide.ui.tests.framework,
org.eclipse.emf.compare.ide.ui.tests.framework.annotations,
org.eclipse.emf.compare.ide.ui.tests.framework.internal
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.classpath b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.classpath
index 098194ca4..3e5654f17 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.classpath
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.classpath
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.settings/org.eclipse.jdt.core.prefs
index 79ea86fdb..cfb6a753b 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/.settings/org.eclipse.jdt.core.prefs
@@ -8,9 +8,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -101,8 +101,9 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -110,17 +111,20 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
@@ -206,11 +210,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -241,6 +246,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -265,13 +272,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -319,6 +330,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -355,9 +368,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -383,7 +399,11 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/META-INF/MANIFEST.MF
index f45eb14f7..b8ae62df1 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/META-INF/MANIFEST.MF
@@ -10,9 +10,9 @@ Require-Bundle: org.eclipse.core.runtime,
org.junit;bundle-version="4.8.0",
org.eclipse.emf.compare,
org.eclipse.emf.compare.ide.ui.tests,
- org.eclipse.jgit;bundle-version="4.2.0",
+ org.eclipse.jgit;bundle-version="6.0.0",
org.eclipse.core.resources,
- org.eclipse.egit.core;bundle-version="4.2.0",
+ org.eclipse.egit.core;bundle-version="6.0.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.team.core;bundle-version="3.5.0",
org.eclipse.emf.compare.ide.ui;bundle-version="3.1.0",
@@ -22,11 +22,11 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface,
org.eclipse.emf.compare.egit,
org.eclipse.team.ui;bundle-version="3.5.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.eclipse.emf.compare.ide.ui.tests.git.framework,
org.eclipse.emf.compare.ide.ui.tests.git.framework.annotations,
org.eclipse.emf.compare.ide.ui.tests.git.framework.internal,
org.eclipse.emf.compare.ide.ui.tests.git.framework.internal.statements
-Import-Package: com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/AbstractGitOperationStatement.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/AbstractGitOperationStatement.java
index 1f54db079..ccbce0fb6 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/AbstractGitOperationStatement.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/AbstractGitOperationStatement.java
@@ -65,7 +65,7 @@ public abstract class AbstractGitOperationStatement extends AbstractGitStatement
GitMergeStrategyID mergeStrategy, String path) {
super(testObject, test, resolutionStrategy, configuration);
this.mergeStrategy = mergeStrategy;
- this.eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.getPluginId());
+ this.eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
this.path = normalizePath(path);
}
@@ -86,7 +86,9 @@ public abstract class AbstractGitOperationStatement extends AbstractGitStatement
if (expected != None.class) {
fail("Expected exception : " + expected.getName()); //$NON-NLS-1$
}
+ // CHECKSTYLE:OFF We want to catch every throwable here
} catch (Throwable e) {
+ // CHECKSTYLE:ON
if (expected.isAssignableFrom(e.getClass())) {
// success
} else {
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/InternalGitTestSupport.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/InternalGitTestSupport.java
index 6a383c4fa..3d817607b 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/InternalGitTestSupport.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git.framework/src/org/eclipse/emf/compare/ide/ui/tests/git/framework/internal/statements/InternalGitTestSupport.java
@@ -16,24 +16,31 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
+import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.core.op.DisconnectProviderOperation;
+import org.eclipse.egit.core.project.RepositoryFinder;
+import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.util.FileUtils;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
@@ -53,6 +60,9 @@ public class InternalGitTestSupport {
/** Name of the Eclipse metadata folder. */
private static final String METADATA_FOLDER = ".metadata"; //$NON-NLS-1$
+ /** Name of the git metadata folder. */
+ private static final String GIT_FOLDER = ".git"; //$NON-NLS-1$
+
/** Size of the buffer to read/write data. */
private static final int BUFFER_SIZE = 4096;
@@ -105,13 +115,30 @@ public class InternalGitTestSupport {
// other tests
root.delete(true, new NullProgressMonitor());
IPath location = root.getLocation();
- extractArchive(clazz, path, root);
- importProjects(new File(location.toString()));
+ List<String> extractedPaths = extractArchive(clazz, path, root);
+ for (String extractedPath : extractedPaths) {
+ File extractedFile = new File(extractedPath);
+ if (!extractedFile.getPath().contains(File.separatorChar + METADATA_FOLDER + File.separatorChar)
+ && !extractedFile.getPath()
+ .contains(File.separatorChar + GIT_FOLDER + File.separatorChar)) {
+ if (".project".equals(extractedFile.getName())) { //$NON-NLS-1$
+ importProject(extractedFile);
+ }
+ }
+ }
connectRepository(new File(location.toString()));
- projects = root.getProjects();
- for (IProject project : projects) {
- connect(project);
+ List<IProject> existingProjects = Arrays.asList(root.getProjects());
+ List<IProject> connectedProjects = new ArrayList<>();
+ for (IProject project : existingProjects) {
+ RepositoryFinder finder = new RepositoryFinder(project);
+ finder.setFindInChildren(false);
+ Collection<RepositoryMapping> repos = finder.find(new NullProgressMonitor());
+ if (!repos.isEmpty()) {
+ connect(project);
+ connectedProjects.add(project);
+ }
}
+ projects = connectedProjects.toArray(new IProject[connectedProjects.size()]);
}
/**
@@ -139,7 +166,7 @@ public class InternalGitTestSupport {
*/
private void connectRepository(File file) throws IOException {
File gitDir = findGitDir(file);
- this.repository = Activator.getDefault().getRepositoryCache().lookupRepository(gitDir);
+ this.repository = RepositoryCache.INSTANCE.lookupRepository(gitDir);
this.disposers = new ArrayList<Runnable>();
}
@@ -168,33 +195,6 @@ public class InternalGitTestSupport {
}
/**
- * Import the Eclipse projects contained in the given file.
- *
- * @param file
- * The folder to look inside
- * @throws InvocationTargetException
- * Thrown if an error happen during the import of the project
- * @throws InterruptedException
- * Thrown if the import operation is interrupted
- * @throws CoreException
- * Thrown if the project cannot be created in the workspace
- */
- private void importProjects(File file)
- throws InvocationTargetException, InterruptedException, CoreException {
- File[] listFiles = file.listFiles();
- if (listFiles != null) {
- for (File child : listFiles) {
- if (child.isDirectory() && !child.getName().equals(METADATA_FOLDER)
- && !child.getName().equals(".git")) { //$NON-NLS-1$
- importProjects(child);
- } else if (child.getName().equals(".project")) { //$NON-NLS-1$
- importProject(child);
- }
- }
- }
- }
-
- /**
* Import the project located in the given path into the test workspace.
*
* @param file
@@ -229,24 +229,28 @@ public class InternalGitTestSupport {
* The path to the archive (relative to the test class)
* @param root
* The root of the test workspace
+ * @return The list of files extracted from this archive. Does not include folders.
* @throws IOException
* Thrown if the zip extraction goes wrong
*/
- private void extractArchive(Class<?> clazz, String path, IWorkspaceRoot root) throws IOException {
- InputStream resourceAsStream = clazz.getResourceAsStream(path);
- ZipInputStream zipIn = new ZipInputStream(resourceAsStream);
- ZipEntry entry = null;
- while ((entry = zipIn.getNextEntry()) != null) {
- String filePath = root.getLocation() + File.separator + entry.getName();
- if (!entry.isDirectory()) {
- extractFile(zipIn, filePath);
- } else {
- File dir = new File(filePath);
- dir.mkdir();
+ private List<String> extractArchive(Class<?> clazz, String path, IWorkspaceRoot root) throws IOException {
+ List<String> extractedPaths = new ArrayList<>();
+ try (InputStream resourceAsStream = clazz.getResourceAsStream(path);
+ ZipInputStream zipIn = new ZipInputStream(resourceAsStream);) {
+ ZipEntry entry = null;
+ while ((entry = zipIn.getNextEntry()) != null) {
+ String filePath = root.getLocation() + File.separator + entry.getName();
+ if (!entry.isDirectory()) {
+ extractFile(zipIn, filePath);
+ extractedPaths.add(filePath);
+ } else {
+ File dir = new File(filePath);
+ dir.mkdir();
+ }
+ zipIn.closeEntry();
}
- zipIn.closeEntry();
}
- zipIn.close();
+ return extractedPaths;
}
/**
@@ -260,13 +264,15 @@ public class InternalGitTestSupport {
* Thrown if something happen during the extraction
*/
private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
- BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
- byte[] bytesIn = new byte[BUFFER_SIZE];
- int read = 0;
- while ((read = zipIn.read(bytesIn)) != -1) {
- bos.write(bytesIn, 0, read);
+ File file = new File(filePath);
+ file.getParentFile().mkdirs();
+ try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));) {
+ byte[] bytesIn = new byte[BUFFER_SIZE];
+ int read = 0;
+ while ((read = zipIn.read(bytesIn)) != -1) {
+ bos.write(bytesIn, 0, read);
+ }
}
- bos.close();
}
/**
@@ -285,14 +291,17 @@ public class InternalGitTestSupport {
iProject.delete(true, new NullProgressMonitor());
}
}
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
File file = new File(workspaceRoot.getLocation().toOSString());
File[] listFiles = file.listFiles();
if (listFiles != null) {
for (File child : listFiles) {
if (!child.getName().equals(METADATA_FOLDER)) {
- FileUtils.delete(child, FileUtils.RECURSIVE | FileUtils.RETRY);
+ try (Stream<java.nio.file.Path> walk = Files.walk(child.toPath())) {
+ walk.sorted(Comparator.reverseOrder()).map(java.nio.file.Path::toFile)
+ .forEach(File::delete);
+ }
}
}
}
@@ -307,10 +316,6 @@ public class InternalGitTestSupport {
* Thrown if a file cannot be deleted
*/
protected void tearDown() throws CoreException, IOException {
- if (repository != null) {
- repository.close();
- repository = null;
- }
if (disposers != null) {
for (Runnable disposer : disposers) {
disposer.run();
@@ -318,13 +323,27 @@ public class InternalGitTestSupport {
disposers.clear();
}
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
if (projects != null) {
- new DisconnectProviderOperation(Arrays.asList(projects)).execute(null);
+ List<IProject> disconnectMe = new ArrayList<>();
for (IProject iProject : projects) {
- iProject.delete(true, new NullProgressMonitor());
+ disconnectMe.add(iProject);
+ }
+ new DisconnectProviderOperation(disconnectMe).execute(null);
+
+ // Delete sub-projects first
+ List<IProject> allProjects = new ArrayList<>(
+ Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects()));
+ allProjects.sort((p1, p2) -> p2.getLocation().toString().compareTo(p1.getLocation().toString()));
+
+ for (IProject iProject : allProjects) {
+ if (iProject.isAccessible()) {
+ iProject.delete(true, new NullProgressMonitor());
+ }
}
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,
+ new NullProgressMonitor());
}
File file = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
@@ -332,7 +351,10 @@ public class InternalGitTestSupport {
if (listFiles != null) {
for (File child : listFiles) {
if (!child.getName().equals(METADATA_FOLDER)) {
- FileUtils.delete(child, FileUtils.RECURSIVE | FileUtils.RETRY);
+ try (Stream<java.nio.file.Path> walk = Files.walk(child.toPath())) {
+ walk.sorted(Comparator.reverseOrder()).map(java.nio.file.Path::toFile)
+ .forEach(File::delete);
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.classpath b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.classpath
index eca7bdba8..3e5654f17 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.classpath
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.classpath
@@ -2,6 +2,10 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src">
+ <attributes>
+ <attribute name="test" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.settings/org.eclipse.jdt.core.prefs
index 75adc0ebb..cfb6a753b 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/.settings/org.eclipse.jdt.core.prefs
@@ -103,6 +103,7 @@ org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -110,17 +111,20 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
@@ -206,11 +210,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -241,6 +246,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -265,13 +272,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -319,6 +330,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -355,9 +368,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -383,7 +399,11 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/META-INF/MANIFEST.MF
index a677d57fa..d5ed7e7b1 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/META-INF/MANIFEST.MF
@@ -7,8 +7,8 @@ Bundle-Localization: plugin
Bundle-Vendor: %providerName
Fragment-Host: org.eclipse.emf.compare.ide.ui.tests
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.egit.core;bundle-version="4.2.0",
- org.eclipse.jgit;bundle-version="4.2.0",
+Require-Bundle: org.eclipse.egit.core;bundle-version="6.0.0",
+ org.eclipse.jgit;bundle-version="6.0.0",
org.eclipse.emf.compare.egit;bundle-version="1.1.0",
org.eclipse.emf.compare.ide.ui.tests.git.framework;bundle-version="1.0.0",
org.eclipse.emf.compare.ide.ui.tests.framework;bundle-version="1.0.0"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/CompareGitTestCase.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/CompareGitTestCase.java
index ef48827c3..f67d68656 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/CompareGitTestCase.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/CompareGitTestCase.java
@@ -21,7 +21,9 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
+import java.util.stream.Stream;
import org.eclipse.compare.ITypedElement;
import org.eclipse.core.resources.IFile;
@@ -37,6 +39,7 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.GitCorePreferences;
+import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.Comparison;
@@ -59,7 +62,6 @@ import org.eclipse.emf.compare.rcp.internal.extension.impl.EMFCompareBuilderConf
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.SystemReader;
import org.eclipse.team.core.subscribers.Subscriber;
import org.junit.After;
@@ -85,7 +87,7 @@ public class CompareGitTestCase extends CompareTestCase {
@BeforeClass
public static void setUpClass() {
// suppress auto-ignoring and auto-sharing to avoid interference
- IEclipsePreferences eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.getPluginId());
+ IEclipsePreferences eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
eGitPreferences.put(GitCorePreferences.core_preferredMergeStrategy, "model recursive");
eGitPreferences.putBoolean(GitCorePreferences.core_autoShareProjects, false);
// This is actually the value of "GitCorePreferences.core_autoIgnoreDerivedResources"... but it was
@@ -99,7 +101,7 @@ public class CompareGitTestCase extends CompareTestCase {
super.setUp();
// ensure there are no shared Repository instances left
// when starting a new test
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
final MockSystemReader mockSystemReader = new MockSystemReader();
SystemReader.setInstance(mockSystemReader);
mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY, ResourcesPlugin.getWorkspace()
@@ -118,9 +120,11 @@ public class CompareGitTestCase extends CompareTestCase {
@After
public void tearDown() throws Exception {
repository.dispose();
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
if (gitDir.exists()) {
- FileUtils.delete(gitDir, FileUtils.RECURSIVE | FileUtils.RETRY);
+ try (Stream<java.nio.file.Path> walk = Files.walk(gitDir.toPath())) {
+ walk.sorted(Comparator.reverseOrder()).map(java.nio.file.Path::toFile).forEach(File::delete);
+ }
}
super.tearDown();
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/GitTestRepository.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/GitTestRepository.java
index 8ff325726..dd1772972 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/GitTestRepository.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/GitTestRepository.java
@@ -37,6 +37,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
+import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.egit.core.op.BranchOperation;
import org.eclipse.egit.core.op.ConnectProviderOperation;
import org.eclipse.egit.core.op.DisconnectProviderOperation;
@@ -56,6 +57,7 @@ import org.eclipse.jgit.api.ResetCommand.ResetType;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.NoFilepatternException;
+import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
@@ -88,8 +90,10 @@ public class GitTestRepository {
* Thrown if we cannot write at the given location.
*/
public GitTestRepository(File gitDir) throws IOException {
- repository = Activator.getDefault().getRepositoryCache().lookupRepository(gitDir);
- repository.create();
+ FileRepository tmpRepository = new FileRepository(gitDir);
+ tmpRepository.create();
+ tmpRepository.close();
+ repository = RepositoryCache.INSTANCE.lookupRepository(gitDir);
try {
workdirPrefix = repository.getWorkTree().getCanonicalPath();
@@ -203,12 +207,9 @@ public class GitTestRepository {
}
public RevCommit addAllAndCommit(String commitMessage) throws Exception {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
git.add().addFilepattern(".").call();
return commit(commitMessage);
- } finally {
- git.close();
}
}
@@ -222,12 +223,9 @@ public class GitTestRepository {
* if anything goes wrong.
*/
public RevCommit addAllAndAmend(String message) throws Exception {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
git.add().addFilepattern(".").call();
return git.commit().setAmend(true).setMessage(message).call();
- } finally {
- git.close();
}
}
@@ -289,8 +287,7 @@ public class GitTestRepository {
public void addToIndex(IResource resource)
throws CoreException, IOException, NoFilepatternException, GitAPIException {
String repoPath = getRepoRelativePath(resource.getLocation().toString());
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
git.add().addFilepattern(repoPath).call();
// removed files cannot be added to the index through this add command.
// see bug 494323 for more details on this limitation, but
@@ -300,8 +297,6 @@ public class GitTestRepository {
// Will add all of the files from the repository to the index, excepted untracked files (new files
// added to the repository)
git.add().addFilepattern(repoPath).setUpdate(true).call();
- } finally {
- git.close();
}
}
@@ -383,14 +378,11 @@ public class GitTestRepository {
*/
public void addToIndex(IResource... resources)
throws CoreException, IOException, NoFilepatternException, GitAPIException {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
for (IResource resource : resources) {
String repoPath = getRepoRelativePath(resource.getLocation().toString());
git.add().addFilepattern(repoPath).call();
}
- } finally {
- git.close();
}
}
@@ -402,14 +394,11 @@ public class GitTestRepository {
*/
public void removeFromIndex(IResource... resources)
throws CoreException, IOException, NoFilepatternException, GitAPIException {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
for (IResource resource : resources) {
String repoPath = getRepoRelativePath(resource.getLocation().toString());
git.rm().addFilepattern(repoPath).call();
}
- } finally {
- git.close();
}
}
@@ -421,15 +410,12 @@ public class GitTestRepository {
* @return commit object
*/
public RevCommit commit(String message) throws Exception {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
CommitCommand commitCommand = git.commit();
commitCommand.setAuthor("J. Git", "j.git@egit.org");
commitCommand.setCommitter(commitCommand.getAuthor());
commitCommand.setMessage(message);
return commitCommand.call();
- } finally {
- git.close();
}
}
@@ -580,11 +566,8 @@ public class GitTestRepository {
* @throws Exception
*/
public Status status() throws Exception {
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
return git.status().call();
- } finally {
- git.close();
}
}
@@ -598,11 +581,8 @@ public class GitTestRepository {
*/
public void track(File file) throws IOException, NoFilepatternException, GitAPIException {
String repoPath = getRepoRelativePath(new Path(file.getPath()).toString());
- Git git = new Git(repository);
- try {
+ try (Git git = new Git(repository)) {
git.add().addFilepattern(repoPath).call();
- } finally {
- git.close();
}
}
@@ -630,10 +610,6 @@ public class GitTestRepository {
* Dispose of this wrapper along with its underlying repository.
*/
public void dispose() {
- if (repository != null) {
- repository.close();
- repository = null;
- }
for (Runnable disposer : disposers) {
disposer.run();
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/MockSystemReader.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/MockSystemReader.java
index 0dfe88b70..ed4a42d1b 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/MockSystemReader.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/egit/fixture/MockSystemReader.java
@@ -104,6 +104,8 @@ public class MockSystemReader extends SystemReader {
private FileBasedConfig userGitConfig;
+ private FileBasedConfig jgitConfig;
+
FileBasedConfig systemGitConfig;
/**
@@ -120,6 +122,16 @@ public class MockSystemReader extends SystemReader {
}
/**
+ * Set the jgit config stored at $XDG_CONFIG_HOME/jgit/config
+ *
+ * @param jgitConfig
+ * set the jgit configuration
+ */
+ public void setJGitConfig(FileBasedConfig jgitConfig) {
+ this.jgitConfig = jgitConfig;
+ }
+
+ /**
* Set the system-level git config
*
* @param systemGitConfig
@@ -143,6 +155,7 @@ public class MockSystemReader extends SystemReader {
init(Constants.GIT_COMMITTER_EMAIL_KEY);
setProperty(Constants.OS_USER_DIR, ".");
userGitConfig = new MockConfig(null, null);
+ jgitConfig = new MockConfig(null, null);
systemGitConfig = new MockConfig(null, null);
setCurrentPlatform();
}
@@ -194,10 +207,17 @@ public class MockSystemReader extends SystemReader {
return systemGitConfig;
}
+ @Override
public StoredConfig getUserConfig() throws IOException, ConfigInvalidException {
return userGitConfig;
}
+ @Override
+ public FileBasedConfig getJGitConfig() {
+ return jgitConfig;
+ }
+
+ @Override
public StoredConfig getSystemConfig() throws IOException, ConfigInvalidException {
return systemGitConfig;
}
@@ -329,4 +349,9 @@ public class MockSystemReader extends SystemReader {
return "MockSystemReader";
}
+ @Override
+ public FileBasedConfig openJGitConfig(Config parent, FS fs) {
+ return jgitConfig;
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/merge/RemoteNewProjectTests.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/merge/RemoteNewProjectTests.java
index 5f39f29c3..eb5b16be4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/merge/RemoteNewProjectTests.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/merge/RemoteNewProjectTests.java
@@ -14,6 +14,9 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.nio.file.Files;
+import java.util.Comparator;
+import java.util.stream.Stream;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -24,6 +27,7 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.GitCorePreferences;
+import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
import org.eclipse.emf.compare.ide.ui.internal.logical.EMFModelProvider;
@@ -43,7 +47,6 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jgit.api.ResetCommand.ResetType;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.SystemReader;
import org.junit.After;
import org.junit.AfterClass;
@@ -77,7 +80,7 @@ public class RemoteNewProjectTests extends CompareTestCase {
@BeforeClass
public static void setUpClass() {
// suppress auto-ignoring and auto-sharing to avoid interference
- IEclipsePreferences eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.getPluginId());
+ IEclipsePreferences eGitPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
eGitPreferences.put(GitCorePreferences.core_preferredMergeStrategy, "model recursive");
eGitPreferences.putBoolean(GitCorePreferences.core_autoShareProjects, false);
// This is actually the value of "GitCorePreferences.core_autoIgnoreDerivedResources"... but it was
@@ -100,7 +103,7 @@ public class RemoteNewProjectTests extends CompareTestCase {
public void setUp() throws Exception {
// ensure there are no shared Repository instances left
// when starting a new test
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
final MockSystemReader mockSystemReader = new MockSystemReader();
SystemReader.setInstance(mockSystemReader);
final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
@@ -119,11 +122,14 @@ public class RemoteNewProjectTests extends CompareTestCase {
.getModelProviderDescriptor(EMFModelProvider.PROVIDER_ID).getModelProvider();
emfModelProvider.clear();
repository.dispose();
- Activator.getDefault().getRepositoryCache().clear();
+ RepositoryCache.INSTANCE.clear();
if (gitDir.exists()) {
File gitRoot = gitDir.getParentFile();
if (gitRoot.exists()) {
- FileUtils.delete(gitRoot, FileUtils.RECURSIVE | FileUtils.RETRY);
+ try (Stream<java.nio.file.Path> walk = Files.walk(gitRoot.toPath())) {
+ walk.sorted(Comparator.reverseOrder()).map(java.nio.file.Path::toFile)
+ .forEach(File::delete);
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/suite/GitTests.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/suite/GitTests.java
index 4146a46e2..a851ce371 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/suite/GitTests.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/suite/GitTests.java
@@ -12,6 +12,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.tests.suite;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.egit.core.GitCorePreferences;
import org.eclipse.emf.compare.ComparePackage;
import org.eclipse.emf.compare.ide.ui.tests.merge.AdditiveMergeTests;
import org.eclipse.emf.compare.ide.ui.tests.merge.DirCacheResourceVariantTreeProviderTest;
@@ -62,6 +65,15 @@ import org.junit.runners.Suite.SuiteClasses;
public class GitTests {
@BeforeClass
+ public static void disableEGitAutomaticBehavior() {
+ // suppress auto-ignoring and auto-sharing to avoid interference
+ IEclipsePreferences eGitPreferences = InstanceScope.INSTANCE
+ .getNode(org.eclipse.egit.core.Activator.PLUGIN_ID);
+ eGitPreferences.put(GitCorePreferences.core_preferredMergeStrategy, "model recursive");
+ eGitPreferences.putBoolean(GitCorePreferences.core_autoShareProjects, false);
+ }
+
+ @BeforeClass
public static void fillEMFRegistries() {
EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(NodesPackage.eNS_URI, NodesPackage.eINSTANCE);
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui.tests/META-INF/MANIFEST.MF
index 421b161e8..81a809e9f 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/META-INF/MANIFEST.MF
@@ -22,16 +22,17 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.emf.compare.rcp.ui.tests,
org.eclipse.emf.compare.rcp.ui,
- org.mockito;bundle-version="[1.9.0,2.0.0)",
+ org.mockito;bundle-version="[1.9.0,3.0.0)",
org.hamcrest;bundle-version="[1.1.0,2.0.0)",
org.eclipse.core.filesystem,
org.eclipse.emf.compare.ide.ui.tests.framework;bundle-version="[1.0.0,2.0.0)"
Bundle-Activator: org.eclipse.emf.compare.ide.ui.tests.Activator
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)",
- com.google.common.util.concurrent;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)",
+ com.google.common.util.concurrent;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.ide.ui.tests,
+ org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util,
org.eclipse.emf.compare.ide.ui.tests.structuremergeviewer.actions,
org.eclipse.emf.compare.ide.ui.tests.workspace
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/AbstractReverseActionTest.java b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/AbstractReverseActionTest.java
new file mode 100644
index 000000000..cbe26adf3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/AbstractReverseActionTest.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.command.ICompareCopyCommand;
+import org.eclipse.emf.compare.domain.ICompareEditingDomain;
+import org.eclipse.emf.compare.domain.IMergeRunnable;
+import org.eclipse.emf.compare.domain.impl.EMFCompareEditingDomain;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction;
+import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.actions.MergeRunnableImpl;
+import org.eclipse.emf.compare.internal.merge.MergeMode;
+import org.eclipse.emf.compare.merge.CachingDiffRelationshipComputer;
+import org.eclipse.emf.compare.merge.IDiffRelationshipComputer;
+import org.eclipse.emf.compare.merge.IMerger;
+import org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.compare.tests.nodes.Node;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Before;
+
+/**
+ * Abstract class for undo and redo tests. This class provides methods to initialize a command stack to merge
+ * differences and undo/redo the last executed command.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractReverseActionTest {
+
+ /**
+ * Used to initialize a default merger registry for merge action.
+ */
+ private IMerger.Registry mergerRegistry;
+
+ /**
+ * Used to merge differences.
+ */
+ private IMergeRunnable mergeRunnable;
+
+ /**
+ * Used to initialize a command stack.
+ */
+ private ICompareEditingDomain editingDomain;
+
+ /**
+ * Getter for the scope.
+ *
+ * @return scope.
+ */
+ public abstract DefaultComparisonScope getScope();
+
+ /**
+ * Getter for the editingDomain.
+ *
+ * @return editingDomain.
+ */
+ public ICompareEditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * Getter for the merger registry.
+ *
+ * @return mergerRegistry.
+ */
+ public IMerger.Registry getMergerRegistry() {
+ return mergerRegistry;
+ }
+
+ /**
+ * Getter for the merge runnable.
+ *
+ * @return mergeRunnable.
+ */
+ public IMergeRunnable getMergeRunnable() {
+ return mergeRunnable;
+ }
+
+ /**
+ * Initializes attributes for tests.
+ */
+ @Before
+ public void setUp() throws IOException {
+ mergerRegistry = EMFCompareRCPPlugin.getDefault().getMergerRegistry();
+ editingDomain = null;
+ }
+
+ /**
+ * Provides access to the list of Nodes of a NodesResource.
+ *
+ * @param resource
+ * the resource that contains the nodes.
+ * @return the list of nodes.
+ */
+ protected EList<Node> getNodes(Resource resource) {
+ EObject container = resource.getContents().get(0);
+ if (container instanceof Node) {
+ return ((Node)container).getContainmentRef1();
+ }
+ return null;
+ }
+
+ /**
+ * Executes a right to left merge of a list of differences.
+ *
+ * @param differences
+ * the list of differences.
+ */
+ protected void mergeDiffsRightToLeft(List<? extends Diff> differences) {
+ mergeDiffs(differences, false);
+ }
+
+ /**
+ * Executes a left to right merge of a list of differences.
+ *
+ * @param differences
+ * the list of differences.
+ */
+ protected void mergeDiffsLeftToRight(List<? extends Diff> differences) {
+ mergeDiffs(differences, true);
+ }
+
+ /**
+ * Executes a right to left or left to right merge of a list of differences. The command is necessary to
+ * perform the execute(), undo, and redo() actions. The merge command is executed and stacked on the
+ * command stack for a potential undo or redo action.
+ *
+ * @param differences
+ * the list of differences.
+ * @param leftToRight
+ * the merge direction.
+ */
+ protected void mergeDiffs(List<? extends Diff> differences, boolean leftToRight) {
+ if (editingDomain == null) {
+ editingDomain = EMFCompareEditingDomain.create(getScope().getLeft(), getScope().getRight(),
+ getScope().getOrigin());
+ }
+
+ initMergeRunnable(leftToRight);
+
+ ICompareCopyCommand command = getEditingDomain().createCopyCommand(differences, leftToRight,
+ getMergerRegistry(), getMergeRunnable());
+
+ getEditingDomain().getCommandStack().execute(command);
+ }
+
+ /**
+ * Initialize the merge runnable used to merge differences.
+ *
+ * @param leftToRight
+ * the merge direction.
+ */
+ protected void initMergeRunnable(boolean leftToRight) {
+ IDiffRelationshipComputer computer = new CachingDiffRelationshipComputer(getMergerRegistry());
+ final MergeMode mergeMode;
+ if (leftToRight) {
+ mergeMode = MergeMode.LEFT_TO_RIGHT;
+ } else {
+ mergeMode = MergeMode.RIGHT_TO_LEFT;
+ }
+ mergeRunnable = new MergeRunnableImpl(true, true, mergeMode, computer);
+ }
+
+ /**
+ * Restores the previous state after a merge, using an UndoAction object.
+ */
+ protected void undo() {
+ UndoAction undoAction = new UndoAction(getEditingDomain());
+ undoAction.run();
+ }
+
+ /**
+ * Restores the previous state after an undo, using an RedoAction object.
+ */
+ protected void redo() {
+ RedoAction redoAction = new RedoAction(getEditingDomain());
+ redoAction.run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/RedoActionTest.java b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/RedoActionTest.java
new file mode 100644
index 000000000..0198b538d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/RedoActionTest.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util;
+
+import static org.eclipse.emf.compare.tests.utils.EMFCompareTestsUtils.assertEqualContents;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction;
+import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.data.UtilInputData;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Test;
+
+/**
+ * Tests the {@link RedoAction}.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class RedoActionTest extends AbstractReverseActionTest {
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ /**
+ * The input data.
+ */
+ private UtilInputData utilInput = new UtilInputData();
+
+ /**
+ * Tests that the redo action restores the state of the model after merging from left to right, and undo,
+ * on the "nodes1" model.
+ *
+ * @throws IOException
+ * Thrown if we could not access either the resource.
+ */
+ @Test
+ public void testRedoMergeL2RNodes1() throws IOException {
+ Resource leftResource = utilInput.getNodes1Left();
+ Resource rightResource = utilInput.getNodes1Right();
+
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+
+ undo();
+ redo();
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+ }
+
+ /**
+ * Tests that the redo action restores the state of the model after merging from right to left, and undo,
+ * on the "nodes1" model.
+ *
+ * @throws IOException
+ * Thrown if we could not access either the resource.
+ */
+ @Test
+ public void testRedoMergeR2LNodes1() throws IOException {
+ Resource leftResource = utilInput.getNodes1Left();
+ Resource rightResource = utilInput.getNodes1Right();
+
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+
+ undo();
+ redo();
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/UndoActionTest.java b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/UndoActionTest.java
new file mode 100644
index 000000000..83292e6bf
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/UndoActionTest.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util;
+
+import static org.eclipse.emf.compare.tests.utils.EMFCompareTestsUtils.assertEqualContents;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction;
+import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.data.UtilInputData;
+import org.eclipse.emf.compare.scope.DefaultComparisonScope;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.junit.Test;
+
+/**
+ * Tests the {@link UndoAction}.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("restriction")
+public class UndoActionTest extends AbstractReverseActionTest {
+
+ /**
+ * The main comparison.
+ */
+ private Comparison comparison;
+
+ /**
+ * The scope of the comparison.
+ */
+ private DefaultComparisonScope scope;
+
+ /**
+ * The input data.
+ */
+ private UtilInputData utilInput = new UtilInputData();
+
+ /**
+ * Tests that the undo action restores the previous state of the model, after merging from left to right,
+ * on the "nodes1" model.
+ *
+ * @throws IOException
+ * Thrown if we could not access either the resource.
+ */
+ @Test
+ public void testUndoMergeL2RNodes1() throws IOException {
+ Resource leftResource = utilInput.getNodes1Left();
+ Resource rightResource = utilInput.getNodes1Right();
+ Resource unchangedRight = utilInput.getNodes1Right();
+
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+
+ mergeDiffsLeftToRight(comparison.getDifferences());
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+
+ undo();
+ scope = new DefaultComparisonScope(rightResource, unchangedRight, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+ assertTrue(comparison.getDifferences().isEmpty());
+ assertEqualContents(comparison, getNodes(rightResource), getNodes(unchangedRight));
+ }
+
+ /**
+ * Tests that the undo action restores the previous state of the model, after merging from right to left,
+ * on the "nodes1" model.
+ *
+ * @throws IOException
+ * Thrown if we could not access either the resource.
+ */
+ @Test
+ public void testUndoMergeR2LNodes1() throws IOException {
+ Resource leftResource = utilInput.getNodes1Left();
+ Resource rightResource = utilInput.getNodes1Right();
+ Resource unchangedLeft = utilInput.getNodes1Left();
+
+ scope = new DefaultComparisonScope(leftResource, rightResource, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+
+ mergeDiffsRightToLeft(comparison.getDifferences());
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(rightResource));
+
+ undo();
+ scope = new DefaultComparisonScope(leftResource, unchangedLeft, null);
+ comparison = EMFCompare.builder().build().compare(getScope());
+ assertTrue(comparison.getDifferences().isEmpty());
+ assertEqualContents(comparison, getNodes(leftResource), getNodes(unchangedLeft));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DefaultComparisonScope getScope() {
+ return scope;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/UtilInputData.java b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/UtilInputData.java
new file mode 100644
index 000000000..bd22c405d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/UtilInputData.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.data;
+
+import java.io.IOException;
+
+import org.eclipse.emf.compare.tests.framework.AbstractInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * This will provide the input model for undo and redo tests.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+@SuppressWarnings("nls")
+public class UtilInputData extends AbstractInputData {
+ /**
+ * The left model of "nodes1".
+ *
+ * @return The loaded left model.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1Left() throws IOException {
+ return loadFromClassLoader("nodes1/left.nodes");
+ }
+
+ /**
+ * The right model of "nodes1".
+ *
+ * @return The loaded right model.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1Origin() throws IOException {
+ return loadFromClassLoader("nodes1/origin.nodes");
+ }
+
+ /**
+ * The origin model of "nodes1".
+ *
+ * @return The loaded origin model.
+ * @throws IOException
+ * Thrown if we could not access either this class's resource, or the file towards which
+ * <code>string</code> points.
+ */
+ public Resource getNodes1Right() throws IOException {
+ return loadFromClassLoader("nodes1/right.nodes");
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/left.nodes b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/left.nodes
new file mode 100644
index 000000000..b133be061
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/left.nodes
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_KUSB0IR_EeqXVMi-NXD3_g" name="A">
+ <containmentRef1 xmi:id="_SXK6MIR_EeqXVMi-NXD3_g" name="B"/>
+ <containmentRef1 xmi:id="_UiKLEIR_EeqXVMi-NXD3_g" name="C">
+ <containmentRef1 xmi:id="_oB79gIR_EeqXVMi-NXD3_g" name="D"/>
+ </containmentRef1>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/origin.nodes b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/origin.nodes
new file mode 100644
index 000000000..35ad9371e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/origin.nodes
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_KUSB0IR_EeqXVMi-NXD3_g" name="A">
+ <containmentRef1 xmi:id="_SXK6MIR_EeqXVMi-NXD3_g" name="B"/>
+ <containmentRef1 xmi:id="_UiKLEIR_EeqXVMi-NXD3_g" name="C"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/right.nodes b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/right.nodes
new file mode 100644
index 000000000..42479a1a3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/contentmergeviewer/util/data/nodes1/right.nodes
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nodes:Node xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nodes="http://www.eclipse.org/emf/compare/tests/nodes" xmi:id="_KUSB0IR_EeqXVMi-NXD3_g" name="A">
+ <containmentRef1 xmi:id="_UiKLEIR_EeqXVMi-NXD3_g" name="C"/>
+</nodes:Node>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/suite/AllTests.java
index 64be4170e..6748af5ba 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui.tests/src/org/eclipse/emf/compare/ide/ui/tests/suite/AllTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2017 Obeo and others.
+ * Copyright (c) 2012, 2020 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,8 @@ import org.eclipse.emf.compare.ComparePackage;
import org.eclipse.emf.compare.ide.ui.tests.command.MergeAllCommandTests;
import org.eclipse.emf.compare.ide.ui.tests.compareconfiguration.EMFCompareConfigurationTest;
import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.notloadedfragment.NotLoadedFragmentItemTest;
+import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.RedoActionTest;
+import org.eclipse.emf.compare.ide.ui.tests.contentmergeviewer.util.UndoActionTest;
import org.eclipse.emf.compare.ide.ui.tests.logical.modelprovider.EMFModelProviderRegistrationTest;
import org.eclipse.emf.compare.ide.ui.tests.logical.modelprovider.EMFModelProviderTest;
import org.eclipse.emf.compare.ide.ui.tests.logical.resolver.CachingImplicitDependenciesTest;
@@ -68,7 +70,7 @@ import org.junit.runners.Suite.SuiteClasses;
SynchronizationModelDiagnosticTest.class, CascadingFilterRefinementTest.class,
MergeNonConflictingRunnableRefinementTest.class, CachingImplicitDependenciesTest.class,
MirroredMergeActionTest.class, EMFModelProviderRegistrationTest.class,
- MergeConflictingRunnableTest.class })
+ MergeConflictingRunnableTest.class, UndoActionTest.class, RedoActionTest.class })
public class AllTests {
@BeforeClass
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
index f39334b0c..7c69a9399 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
@@ -30,6 +30,7 @@ Export-Package: org.eclipse.emf.compare.ide.ui.dependency,
org.eclipse.emf.compare.ide.ui.internal.configuration;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor;x-internal:=true,
+ org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.fallback;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.label;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.property,
org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.provider;x-internal:=true,
@@ -51,16 +52,17 @@ Export-Package: org.eclipse.emf.compare.ide.ui.dependency,
org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;x-friends:="org.eclipse.emf.compare.ide.ui.tests",
org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.actions;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider;x-internal:=true,
+ org.eclipse.emf.compare.ide.ui.internal.subscriber;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.treecontentmanager;x-friends:="org.eclipse.emf.compare.ide.ui.e4",
org.eclipse.emf.compare.ide.ui.internal.util;x-internal:=true,
org.eclipse.emf.compare.ide.ui.logical,
org.eclipse.emf.compare.ide.ui.mergeresolution,
- org.eclipse.emf.compare.ide.ui.source
-Import-Package: com.google.common.annotations;version="[27.0.0,28.0.0)",
- com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)",
- com.google.common.io;version="[27.0.0,28.0.0)",
- com.google.common.util.concurrent;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="[1.2.15,2.0.0)"
+ org.eclipse.emf.compare.ide.ui.source,
+ org.eclipse.emf.compare.ide.ui.subscriber
+Import-Package: com.google.common.annotations;version="[27.0.0,30.2.0)",
+ com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)",
+ com.google.common.io;version="[27.0.0,30.2.0)",
+ com.google.common.util.concurrent;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
index 9b26a007a..64dab1647 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
@@ -23,6 +23,7 @@
<extension-point id="modelMinimizers" name="Logical Model Minimizers" schema="schema/modelMinimizers.exsd"/>
<extension-point id="modelDependencyProvider" name="Model Dependency Provider" schema="schema/modelDependencyProvider.exsd"/>
<extension-point id="mergeResolutionListener" name="Merge Resolution Listener" schema="schema/mergeResolutionListener.exsd"/>
+ <extension-point id="subscriberProvider" name="Subscriber Provider" schema="schema/subscriberProvider.exsd"/>
<extension
point="org.eclipse.compare.structureMergeViewers">
@@ -602,4 +603,11 @@
contextId="org.eclipse.compare.compareEditorScope">
</key>
</extension>
+ <extension
+ point="org.eclipse.emf.compare.ide.ui.subscriberProvider">
+ <provider
+ class="org.eclipse.emf.compare.ide.ui.subscriber.TeamSubscriberProvider"
+ ranking="0">
+ </provider>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/schema/subscriberProvider.exsd b/plugins/org.eclipse.emf.compare.ide.ui/schema/subscriberProvider.exsd
new file mode 100644
index 000000000..04abfc3d5
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/schema/subscriberProvider.exsd
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.emf.compare.ide.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.emf.compare.ide.ui" id="subscriberProvider" name="Subscriber Provider"/>
+ </appinfo>
+ <documentation>
+ The extension point can be used to support the mapping from a comparison input to a Team Subscriber that manages the mapping between local resources and a remote resources.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="provider">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The fully qualified name of a class that implements org.eclipse.emf.compare.ide.ui.subscriber.ISubscriberProvider
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.ide.ui.subscriber.ISubscriberProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="ranking" type="string" use="default" value="0">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 4.4.3
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ &lt;extension
+ point=&quot;org.eclipse.emf.compare.ide.ui.subscriberProvider&quot;&gt;
+ &lt;provider
+ class=&quot;org.eclipse.emf.compare.ide.ui.subscriber.TeamSubscriberProvider&quot;
+ ranking=&quot;0&quot;&gt;
+ &lt;/provider&gt;
+&lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ See org.eclipse.emf.compare.ide.ui/plugin.xml for existing contributions.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2022 EclipseSource and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Martin Fleck - initial API and implementation
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
index 504b6067b..3ef311410 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2017 Obeo and others.
+ * Copyright (c) 2012, 2022 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Stefan Dirix - Bug 456699
* Michael Borkowski - Bug 462863
* Martin Fleck - Bug 512562
+ * Martin Fleck - Bug 578422
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal;
@@ -33,7 +34,9 @@ import org.eclipse.emf.compare.ide.ui.internal.logical.view.registry.LogicalMode
import org.eclipse.emf.compare.ide.ui.internal.logical.view.registry.LogicalModelViewHandlerRegistryListener;
import org.eclipse.emf.compare.ide.ui.internal.mergeresolution.MergeResolutionListenerRegistry;
import org.eclipse.emf.compare.ide.ui.internal.mergeresolution.MergeResolutionListenerRegistryListener;
+import org.eclipse.emf.compare.ide.ui.internal.subscriber.SubscriberProviderRegistryListener;
import org.eclipse.emf.compare.ide.ui.logical.IModelMinimizer;
+import org.eclipse.emf.compare.ide.ui.subscriber.SubscriberProviderRegistry;
import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
@@ -45,6 +48,7 @@ import org.osgi.framework.BundleContext;
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
+@SuppressWarnings("restriction")
public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
/** The plugin ID. */
public static final String PLUGIN_ID = "org.eclipse.emf.compare.ide.ui"; //$NON-NLS-1$
@@ -67,6 +71,9 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
/** Merge resolution listener extension point. */
private static final String MERGE_RESOLUTION_PPID = "mergeResolutionListener"; //$NON-NLS-1$
+ /** Subscriber provider extension point. */
+ private static final String SUBSCRIBER_PROVIDER_PPID = "subscriberProvider"; //$NON-NLS-1$
+
/** keep track of resources that should be freed when exiting. */
private static Map<String, Image> resourcesMapper = new HashMap<String, Image>();
@@ -100,6 +107,12 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
/** Registry for the merge resolution listener extension point. */
private MergeResolutionListenerRegistry mergeResolutionListenerRegistry;
+ /** Registry for the subscriber provider extension point. */
+ private SubscriberProviderRegistry subscriberProviderRegistry;
+
+ /** Listener for the subscriber provider extension point. */
+ private SubscriberProviderRegistryListener subscriberProviderRegistryListener;
+
/** Default constructor. */
public EMFCompareIDEUIPlugin() {
// Empty constructor
@@ -120,6 +133,7 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
logicalModelViewHandlerRegistry = new LogicalModelViewHandlerRegistry();
modelMinimizerRegistry = new ModelMinimizerRegistry();
mergeResolutionListenerRegistry = new MergeResolutionListenerRegistry();
+ subscriberProviderRegistry = new SubscriberProviderRegistry();
final IExtensionRegistry globalRegistry = Platform.getExtensionRegistry();
@@ -148,6 +162,11 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
globalRegistry.addListener(modelMinimizerRegistryListener);
modelMinimizerRegistryListener.readRegistry(globalRegistry);
+ subscriberProviderRegistryListener = new SubscriberProviderRegistryListener(PLUGIN_ID,
+ SUBSCRIBER_PROVIDER_PPID, getLog(), subscriberProviderRegistry);
+ globalRegistry.addListener(subscriberProviderRegistryListener);
+ subscriberProviderRegistryListener.readRegistry(globalRegistry);
+
Platform.getAdapterManager().registerAdapters(new PropertySheetAdapterFactory(), CompareEditor.class);
}
@@ -165,6 +184,8 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
modelResolverRegistry.clear();
globalRegistry.removeListener(modelDependencyProviderRegistryListener);
modelDependencyProviderRegistry.clear();
+ globalRegistry.removeListener(subscriberProviderRegistryListener);
+ subscriberProviderRegistry.clear();
plugin = null;
super.stop(context);
}
@@ -280,6 +301,15 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
}
/**
+ * Returns the registry containing all known subscriber providers.
+ *
+ * @return The registry containing all known subscriber providers.
+ */
+ public SubscriberProviderRegistry getSubscriberProviderRegistry() {
+ return subscriberProviderRegistry;
+ }
+
+ /**
* Log an {@link Exception} in the {@link #getLog() current logger}.
*
* @param e
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
index 427fd8b42..33f67458c 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
@@ -202,7 +202,9 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl
// EVENT_BUS must not be set to null
Comparison comparison = getComparison();
disposeComparison();
- comparison.eAdapters().clear();
+ if (comparison != null) {
+ comparison.eAdapters().clear();
+ }
}
/**
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
index 49f99b553..bed8e34d4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
@@ -107,11 +107,20 @@ abstract class PropertyItem extends ItemProvider implements ITableItemLabelProvi
*/
public static PropertyItem createPropertyItem(final EMFCompareConfiguration configuration,
final Object object, final MergeViewerSide side) {
- final AdapterFactoryItemDelegator itemDelegator = new AdapterFactoryItemDelegator(
- configuration.getAdapterFactory());
+ PropertyItem rootItem;
+ List<IItemPropertyDescriptor> propertyDescriptors;
+ if (configuration.getAdapterFactory() != null) {
+ final AdapterFactoryItemDelegator itemDelegator = new AdapterFactoryItemDelegator(
+ configuration.getAdapterFactory());
- PropertyItem rootItem = new RootPropertyItem(configuration, itemDelegator, object, side);
- List<IItemPropertyDescriptor> propertyDescriptors = getPropertyDescriptors(object, itemDelegator);
+ rootItem = new RootPropertyItem(configuration, itemDelegator.getImage(object),
+ itemDelegator.getText(object), object, side);
+ propertyDescriptors = getPropertyDescriptors(object, itemDelegator);
+ } else {
+ // We're currently disposing of the property content merge viewer
+ rootItem = new RootPropertyItem(configuration, null, "", object, side); //$NON-NLS-1$
+ propertyDescriptors = null;
+ }
populateRootPropertyItem(rootItem, propertyDescriptors, object, configuration, side);
return rootItem;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
index fc30618b3..ebd078044 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
@@ -12,15 +12,14 @@ package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.property;
import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
class RootPropertyItem extends PropertyItem {
private Object object;
- RootPropertyItem(EMFCompareConfiguration configuration, IItemLabelProvider itemLabelProvider,
+ RootPropertyItem(EMFCompareConfiguration configuration, Object objectImage, String objectText,
Object object, MergeViewerSide side) {
- super(configuration, itemLabelProvider.getImage(object), itemLabelProvider.getText(object), side);
+ super(configuration, objectImage, objectText, side);
this.object = object;
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
index 41c75d5a4..c2f8ff9a1 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/ComparisonScopeBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2017 Obeo and others.
+ * Copyright (c) 2013, 2022 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Stefan Dirix - bug 466607
* Philip Langer - add support for setting initial file URIs to scope
* Martin Fleck - bug 512562
+ * Martin Fleck - bug 578422
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.logical;
@@ -22,15 +23,11 @@ import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Sets;
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.compare.ICompareContainer;
import org.eclipse.compare.IStreamContentAccessor;
import org.eclipse.compare.ITypedElement;
@@ -57,6 +54,7 @@ import org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor;
import org.eclipse.emf.compare.ide.ui.logical.SynchronizationModel;
import org.eclipse.emf.compare.ide.utils.ResourceUtil;
import org.eclipse.emf.compare.ide.utils.StorageTraversal;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
import org.eclipse.emf.compare.scope.DefaultComparisonScope;
import org.eclipse.emf.compare.scope.FilterComparisonScope;
import org.eclipse.emf.compare.scope.IComparisonScope;
@@ -66,9 +64,6 @@ import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.team.core.subscribers.Subscriber;
-import org.eclipse.team.core.subscribers.SubscriberMergeContext;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant;
/**
* This will be used by EMF Compare in order to construct its comparison scope given a "starting point".
@@ -91,7 +86,7 @@ public final class ComparisonScopeBuilder {
private final IStorageProviderAccessor storageAccessor;
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(ComparisonScopeBuilder.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(ComparisonScopeBuilder.class);
/** Function transforming an IResource into its URI. */
private static final Function<IResource, URI> TO_FILE_URIS = new Function<IResource, URI>() {
@@ -188,31 +183,29 @@ public final class ComparisonScopeBuilder {
}
}
- /**
- * Resolves and minimizes the logical model for the given three typed element as would be done by
- * {@link #build(ITypedElement, ITypedElement, ITypedElement, IProgressMonitor)}, but returns
- * directly the SynchronizationModel DTO instead of the actual IComparisonScope.
- * <p>
- * This internal API is only intended for use by the resource mapping mergers.
- * </p>
- *
- * @param left
- * The element that will be used as the starting point to resolve the left logical
- * model.
- * @param right
- * Element that will be used as the starting point to resolve the left logical model.
- * @param origin
- * The origin resource, starting point of the logical model we are to resolve as the
- * origin one. Can be <code>null</code>.
- * @param monitor
- * The monitor on which to report progress information to the user.
- * @return The newly created SynchronizationModel.
- * @throws InterruptedException
- * In case of user interruption.
- */
- /* package */SynchronizationModel buildSynchronizationModel(ITypedElement left,
- ITypedElement right, ITypedElement origin, IProgressMonitor monitor)
- throws InterruptedException {
+ /**
+ * Resolves and minimizes the logical model for the given three typed element as would be done by
+ * {@link #build(ITypedElement, ITypedElement, ITypedElement, IProgressMonitor)}, but returns directly the
+ * SynchronizationModel DTO instead of the actual IComparisonScope.
+ * <p>
+ * This internal API is only intended for use by the resource mapping mergers.
+ * </p>
+ *
+ * @param left
+ * The element that will be used as the starting point to resolve the left logical model.
+ * @param right
+ * Element that will be used as the starting point to resolve the left logical model.
+ * @param origin
+ * The origin resource, starting point of the logical model we are to resolve as the origin
+ * one. Can be <code>null</code>.
+ * @param monitor
+ * The monitor on which to report progress information to the user.
+ * @return The newly created SynchronizationModel.
+ * @throws InterruptedException
+ * In case of user interruption.
+ */
+ /* package */SynchronizationModel buildSynchronizationModel(ITypedElement left, ITypedElement right,
+ ITypedElement origin, IProgressMonitor monitor) throws InterruptedException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("buildSynchronizationModel - START"); //$NON-NLS-1$
}
@@ -254,8 +247,10 @@ public final class ComparisonScopeBuilder {
*/
public static IComparisonScope create(ICompareContainer container, ITypedElement left,
ITypedElement right, ITypedElement origin, IProgressMonitor monitor) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
+ Subscriber subscriber = EMFCompareIDEUIPlugin.getDefault().getSubscriberProviderRegistry()
+ .getSubscriber(container, left, right, origin, subMonitor.split(10));
IStorageProviderAccessor storageAccessor = null;
- Subscriber subscriber = getSubscriber(container);
if (subscriber != null) {
storageAccessor = new SubscriberStorageAccessor(subscriber);
}
@@ -268,7 +263,7 @@ public final class ComparisonScopeBuilder {
final ComparisonScopeBuilder scopeBuilder = new ComparisonScopeBuilder(resolver,
EMFCompareIDEUIPlugin.getDefault().getModelMinimizerRegistry().getCompoundMinimizer(),
storageAccessor);
- return scopeBuilder.build(left, right, origin, monitor);
+ return scopeBuilder.build(left, right, origin, subMonitor.split(90));
}
/**
@@ -299,53 +294,6 @@ public final class ComparisonScopeBuilder {
}
/**
- * Team left us with absolutely no way to determine whether our supplied input is the result of a
- * synchronization or not.
- * <p>
- * In order to properly resolve the logical model of the resource currently being compared we need to know
- * what "other" resources were part of its logical model, and we need to know the revisions of these
- * resources we are to load. All of this has already been computed by Team, but it would not let us know.
- * This method uses discouraged means to get around this "black box" locking from Team.
- * </p>
- * <p>
- * The basic need here is to retrieve the Subscriber from this point. We have a lot of accessible
- * variables, the two most important being the CompareConfiguration and ICompareInput... I could find no
- * way around the privileged access to the private ModelCompareEditorInput.participant field. There does
- * not seem to be any adapter (or Platform.getAdapterManager().getAdapter(...)) that would allow for this,
- * so I'm taking the long way 'round.
- * </p>
- *
- * @return The subscriber used for this comparison if any could be found, <code>null</code> otherwise.
- */
- @SuppressWarnings("restriction")
- private static Subscriber getSubscriber(ICompareContainer container) {
- if (container instanceof org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput) {
- final org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput modelInput = (org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput)container;
- ISynchronizeParticipant participant = null;
- try {
- final Field field = org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput.class
- .getDeclaredField("participant"); //$NON-NLS-1$
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true);
- return null;
- }
- });
- participant = (ISynchronizeParticipant)field.get(modelInput);
- } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
- // Swallow this, this private field was there at least from 3.5 to 4.3
- }
- if (participant instanceof ModelSynchronizeParticipant
- && ((ModelSynchronizeParticipant)participant)
- .getContext() instanceof SubscriberMergeContext) {
- return ((SubscriberMergeContext)((ModelSynchronizeParticipant)participant).getContext())
- .getSubscriber();
- }
- }
- return null;
- }
-
- /**
* Creates the synchronization model for the given three elements (left, right, and the common ancestor of
* the two). Since this comparison may concern either local or remote resources, all I/O operations should
* go through the given storage accessor.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/EMFModelProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/EMFModelProvider.java
index 624a44203..5bad0aa2d 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/EMFModelProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/EMFModelProvider.java
@@ -32,7 +32,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import org.apache.log4j.Logger;
import org.eclipse.compare.ITypedElement;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -48,6 +47,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
+import org.eclipse.emf.compare.ide.ui.internal.preferences.EMFCompareUIPreferences;
import org.eclipse.emf.compare.ide.ui.logical.IModelResolver;
import org.eclipse.emf.compare.ide.ui.logical.IStorageProvider;
import org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor;
@@ -55,6 +55,7 @@ import org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor.DiffSide;
import org.eclipse.emf.compare.ide.ui.logical.SynchronizationModel;
import org.eclipse.emf.compare.ide.utils.ResourceUtil;
import org.eclipse.emf.compare.ide.utils.StorageTraversal;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* This implementation of a {@link ModelProvider} will be used to provide the logical model associated with
@@ -84,10 +85,11 @@ public class EMFModelProvider extends ModelProvider {
* place and hasten the whole process.
* </p>
*/
- public static final long CACHE_EXPIRATION = 120L;
+ public static final long CACHE_EXPIRATION = EMFCompareIDEUIPlugin.getDefault().getPreferenceStore()
+ .getLong(EMFCompareUIPreferences.MODEL_PROVIDER_CACHE_TIMEOUT);
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(EMFModelProvider.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(EMFModelProvider.class);
/**
* Cache the logical model computed for a given file through this provider. Note that the sub-cache
@@ -358,17 +360,24 @@ public class EMFModelProvider extends ModelProvider {
if (context instanceof RemoteResourceMappingContext) {
final IStorageProviderAccessor accessor = new RemoteMappingContextStorageAccessor(
(RemoteResourceMappingContext)context);
+ // An empty local traversal doesn't necessarily means empty remote and origin sides!
+ // If the local file no longer exists, remote and ancestor need to use a "dummy" containing only
+ // the local file to start their resolution.
+ StorageTraversal startingPoint = localTraversal;
+ if (startingPoint.getStorages().isEmpty()) {
+ startingPoint = new StorageTraversal(Collections.singleton(file));
+ }
ITypedElement left = null;
ITypedElement right = null;
ITypedElement origin = null;
if (((RemoteResourceMappingContext)context).isThreeWay()) {
- left = findTypedElement(localTraversal, accessor, actualMonitor, DiffSide.SOURCE);
- right = findTypedElement(localTraversal, accessor, actualMonitor, DiffSide.REMOTE);
- origin = findTypedElement(localTraversal, accessor, actualMonitor, DiffSide.ORIGIN);
+ left = findTypedElement(startingPoint, accessor, actualMonitor, DiffSide.SOURCE);
+ right = findTypedElement(startingPoint, accessor, actualMonitor, DiffSide.REMOTE);
+ origin = findTypedElement(startingPoint, accessor, actualMonitor, DiffSide.ORIGIN);
} else {
- left = findTypedElement(localTraversal, accessor, actualMonitor, DiffSide.SOURCE);
- right = findTypedElement(localTraversal, accessor, actualMonitor, DiffSide.REMOTE);
+ left = findTypedElement(startingPoint, accessor, actualMonitor, DiffSide.SOURCE);
+ right = findTypedElement(startingPoint, accessor, actualMonitor, DiffSide.REMOTE);
}
IStorage leftStorage = null;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
index 3043bf0f6..7e5142edd 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/AbstractResolution.java
@@ -21,7 +21,6 @@ import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.Callable;
-import org.apache.log4j.Logger;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -30,6 +29,7 @@ import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.ide.utils.ResourceUtil;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
import org.eclipse.emf.ecore.resource.URIConverter;
/**
@@ -49,7 +49,7 @@ public abstract class AbstractResolution {
protected DiagnosticSupport diagnostic;
/** The logger */
- protected final Logger logger = Logger.getLogger(getClass());
+ protected final EMFCompareLogger logger = new EMFCompareLogger(getClass());
/** The implicit dependencies. */
protected IImplicitDependencies implicitDependencies;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DependencyGraphUpdater.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DependencyGraphUpdater.java
index 965d14803..665dfa2c0 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DependencyGraphUpdater.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DependencyGraphUpdater.java
@@ -18,8 +18,8 @@ import com.google.common.eventbus.Subscribe;
import java.util.Collections;
-import org.apache.log4j.Logger;
import org.eclipse.emf.compare.graph.IGraph;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* This class's responsibility is to maintain the state of its graph when notified that a new model resource
@@ -33,7 +33,7 @@ public class DependencyGraphUpdater<T> {
private final IGraph<T> dependencyGraph;
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DependencyGraphUpdater.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(DependencyGraphUpdater.class);
/**
* Constructor.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DiagnosticSupport.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DiagnosticSupport.java
index 43d2b015d..3ff507ee4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DiagnosticSupport.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/DiagnosticSupport.java
@@ -12,10 +12,10 @@ package org.eclipse.emf.compare.ide.ui.internal.logical.resolver;
import static com.google.common.base.Preconditions.checkNotNull;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* Encapsulated a diagnostic to hide multi-threaded details.
@@ -27,7 +27,7 @@ public class DiagnosticSupport {
/** The wrapped diagnostic, never {@code null}. */
private final BasicDiagnostic diagnostic;
- private static final Logger LOGGER = Logger.getLogger(DiagnosticSupport.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(DiagnosticSupport.class);
/**
* Constructor.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyLocalResolver.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyLocalResolver.java
index 65e60311f..d71279d41 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyLocalResolver.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyLocalResolver.java
@@ -25,7 +25,6 @@ import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -36,6 +35,7 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.graph.IGraph;
import org.eclipse.emf.compare.ide.ui.internal.util.ThreadSafeProgressMonitor;
import org.eclipse.emf.compare.ide.utils.ResourceUtil;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* The default implementation of the {@link IResourceDependencyProvider}.
@@ -44,7 +44,7 @@ import org.eclipse.emf.compare.ide.utils.ResourceUtil;
*/
public class ResourceDependencyLocalResolver implements IResourceDependencyLocalResolver {
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(ResourceDependencyLocalResolver.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(ResourceDependencyLocalResolver.class);
/** The event bus */
private final EventBus eventBus;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyRemoteResolver.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyRemoteResolver.java
index 70e6680c1..cf37f94dd 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyRemoteResolver.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ResourceDependencyRemoteResolver.java
@@ -12,9 +12,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.logical.resolver;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.ide.ui.internal.util.ThreadSafeProgressMonitor;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* The default implementation of the {@link IResourceDependencyRemoteResolver}.
@@ -23,7 +23,7 @@ import org.eclipse.emf.compare.ide.ui.internal.util.ThreadSafeProgressMonitor;
*/
public class ResourceDependencyRemoteResolver implements IResourceDependencyRemoteResolver {
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(ResourceDependencyLocalResolver.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(ResourceDependencyRemoteResolver.class);
/** The resolution context. */
private final IResolutionContext context;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/SynchronizedResourceSet.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/SynchronizedResourceSet.java
index 1d5c103bc..244930695 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/SynchronizedResourceSet.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/SynchronizedResourceSet.java
@@ -25,7 +25,6 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -36,6 +35,7 @@ import org.eclipse.emf.compare.ide.internal.utils.DisposableResourceSet;
import org.eclipse.emf.compare.ide.internal.utils.INamespaceDeclarationListener;
import org.eclipse.emf.compare.ide.internal.utils.IProxyCreationListener;
import org.eclipse.emf.compare.ide.internal.utils.NoNotificationParserPool;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.ContentHandler;
import org.eclipse.emf.ecore.resource.Resource;
@@ -52,7 +52,7 @@ import org.eclipse.emf.ecore.xmi.XMLResource;
// Visible for testing
public class SynchronizedResourceSet extends ResourceSetImpl implements DisposableResourceSet {
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(SynchronizedResourceSet.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(SynchronizedResourceSet.class);
/** Associates URIs with their resources. */
private final ConcurrentHashMap<URI, Resource> uriCache;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ThreadedModelResolver.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ThreadedModelResolver.java
index 5ebdb5097..7db09ddfe 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ThreadedModelResolver.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/logical/resolver/ThreadedModelResolver.java
@@ -56,7 +56,7 @@ import org.eclipse.emf.compare.rcp.ui.internal.util.ResourceUIUtil;
*/
public class ThreadedModelResolver extends AbstractModelResolver implements IGraphConsumer {
- private IResolutionContext context;
+ protected IResolutionContext context;
/**
* The URI Graph instance.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferences.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferences.java
index a348cc6c7..19d2bf219 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferences.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferences.java
@@ -90,4 +90,11 @@ public interface EMFCompareUIPreferences {
*/
String SELECT_NEXT_UNRESOLVED_DIFF = EMFCompareIDEUIPlugin.PLUGIN_ID
+ ".preference.selectNextUnresolvedDiff"; //$NON-NLS-1$
+
+ /**
+ * Preference key holding the value for the EMFModelProvider's internal cache expiration time. This can
+ * only be changed at startup.
+ */
+ String MODEL_PROVIDER_CACHE_TIMEOUT = EMFCompareIDEUIPlugin.PLUGIN_ID
+ + ".preference.model.provider.cache.timeout"; //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferencesInitializer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferencesInitializer.java
index 785870613..48925c399 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferencesInitializer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/preferences/EMFCompareUIPreferencesInitializer.java
@@ -38,5 +38,6 @@ public class EMFCompareUIPreferencesInitializer extends AbstractPreferenceInitia
store.setDefault(EMFCompareUIPreferences.EDITOR_TREE_AUTO_SELECT_FIRST_CHANGE, true);
store.setDefault(EMFCompareUIPreferences.EDITOR_TREE_HIGHLIGHT_RELATED_CHANGES, true);
store.setDefault(EMFCompareUIPreferences.SELECT_NEXT_UNRESOLVED_DIFF, true);
+ store.setDefault(EMFCompareUIPreferences.MODEL_PROVIDER_CACHE_TIMEOUT, 120L);
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index 544d9fc6e..44ba6b5de 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2018 Obeo and others.
+ * Copyright (c) 2013, 2022 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* Stefan Dirix - bugs 473985, 474030
* Martin Fleck - bug 497066, 483798, 514767, 514415
* Alexandra Buzila - bug 513931
+ * Martin Fleck - bug 580408
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
@@ -22,7 +23,6 @@ import static org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCo
import com.google.common.base.Function;
import com.google.common.base.Objects;
-import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
@@ -242,15 +242,18 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
@Override
protected IStatus run(IProgressMonitor monitor) {
- final String title = new TitleBuilder(getCompareConfiguration()).toString();
- getContentProvider().runWhenReady(IN_UI_ASYNC, new Runnable() {
- public void run() {
- CTabFolder control = getControl();
- if (!control.isDisposed()) {
- ((CompareViewerSwitchingPane)control.getParent()).setTitleArgument(title);
+ EMFCompareStructureMergeViewerContentProvider contentProvider = getContentProvider();
+ if (contentProvider != null) {
+ contentProvider.runWhenReady(IN_UI_ASYNC, new Runnable() {
+ public void run() {
+ CTabFolder control = getControl();
+ if (!control.isDisposed()) {
+ final String title = new TitleBuilder(getCompareConfiguration()).toString();
+ ((CompareViewerSwitchingPane)control.getParent()).setTitleArgument(title);
+ }
}
- }
- });
+ });
+ }
return Status.OK_STATUS;
}
}
@@ -1877,21 +1880,36 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
}
}
- private void compareInputChangedToNull() {
- if (!inputChangedTask.cancel()) {
+ protected void compareInputChangedToNull() {
+ stopJob(inputChangedTask);
+ stopJob(titleBuilderJob);
+
+ if (getCompareConfiguration() != null) {
+ if (resourceSetShouldBeDisposed) {
+ disposeResourceSets(getCompareConfiguration().getComparison());
+ }
+ editingDomainChange(getCompareConfiguration().getEditingDomain(), null);
+ getCompareConfiguration().disposeComparison();
+ }
+ getViewer().setInput(null);
+ }
+
+ protected void stopJob(Job job) {
+ if (!job.cancel()) {
try {
- inputChangedTask.join();
+ job.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- Throwables.propagate(e);
+ throw new RuntimeException(e);
}
}
+ }
+ protected void disposeResourceSets(Comparison comparison) {
ResourceSet leftResourceSet = null;
ResourceSet rightResourceSet = null;
ResourceSet originResourceSet = null;
- final Comparison comparison = getCompareConfiguration().getComparison();
if (comparison != null) {
Iterator<Match> matchIt = comparison.getMatches().iterator();
if (comparison.isThreeWay()) {
@@ -1920,28 +1938,18 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
}
}
}
-
- editingDomainChange(getCompareConfiguration().getEditingDomain(), null);
-
- if (resourceSetShouldBeDisposed) {
- final ResourceSet finalLeftResourceSet = leftResourceSet;
- final ResourceSet finalRightResourceSet = rightResourceSet;
- final ResourceSet finalOriginResourceSet = originResourceSet;
- new Job("Resource Disposer") { //$NON-NLS-1$
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- disposeResourceSet(finalLeftResourceSet);
- disposeResourceSet(finalRightResourceSet);
- disposeResourceSet(finalOriginResourceSet);
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- if (getCompareConfiguration() != null) {
- getCompareConfiguration().disposeComparison();
- }
- getViewer().setInput(null);
+ final ResourceSet finalLeftResourceSet = leftResourceSet;
+ final ResourceSet finalRightResourceSet = rightResourceSet;
+ final ResourceSet finalOriginResourceSet = originResourceSet;
+ new Job("Resource Disposer") { //$NON-NLS-1$
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ disposeResourceSet(finalLeftResourceSet);
+ disposeResourceSet(finalRightResourceSet);
+ disposeResourceSet(finalOriginResourceSet);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
/**
@@ -2257,9 +2265,11 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
public TitleBuilder(EMFCompareConfiguration configuration) {
comparison = configuration.getComparison();
- groupProvider = configuration.getStructureMergeViewerGrouper().getProvider();
- filterPredicate = EMFComparePredicates
- .guavaToJava(configuration.getStructureMergeViewerFilter().getAggregatedPredicate());
+ StructureMergeViewerGrouper grouper = configuration.getStructureMergeViewerGrouper();
+ groupProvider = grouper == null ? null : grouper.getProvider();
+ StructureMergeViewerFilter filter = configuration.getStructureMergeViewerFilter();
+ filterPredicate = filter == null ? null
+ : EMFComparePredicates.guavaToJava(filter.getAggregatedPredicate());
}
void visit(TreeNode node, boolean parentApplies) {
@@ -2300,6 +2310,9 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
@Override
public String toString() {
+ if (groupProvider == null || filterPredicate == null) {
+ return EMFCompareIDEUIMessages.getString("EMFCompareStructureMergeViewer.title"); //$NON-NLS-1$
+ }
for (IDifferenceGroup group : groupProvider.getGroups(comparison)) {
for (TreeNode node : group.getChildren()) {
visit(node, true);
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeConflictingRunnable.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeConflictingRunnable.java
index a486a903f..d6737105d 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeConflictingRunnable.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeConflictingRunnable.java
@@ -26,7 +26,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
@@ -41,6 +40,7 @@ import org.eclipse.emf.compare.merge.IDiffRelationshipComputer;
import org.eclipse.emf.compare.merge.IMerger;
import org.eclipse.emf.compare.merge.IMerger.Registry;
import org.eclipse.emf.compare.merge.IMerger.Registry2;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* Implements the "merge all contained conflicting" action.
@@ -50,7 +50,7 @@ import org.eclipse.emf.compare.merge.IMerger.Registry2;
public class MergeConflictingRunnable extends AbstractMergeRunnable implements IMergeRunnable {
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(MergeConflictingRunnable.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(MergeConflictingRunnable.class);
/**
* Default constructor.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeNonConflictingRunnable.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeNonConflictingRunnable.java
index 20250650c..c83ffcfcc 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeNonConflictingRunnable.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/MergeNonConflictingRunnable.java
@@ -37,7 +37,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
@@ -55,6 +54,7 @@ import org.eclipse.emf.compare.merge.IBatchMerger;
import org.eclipse.emf.compare.merge.IDiffRelationshipComputer;
import org.eclipse.emf.compare.merge.IMerger;
import org.eclipse.emf.compare.merge.IMerger.Registry;
+import org.eclipse.emf.compare.rcp.EMFCompareLogger;
/**
* Implements the "merge non-conflicting" and "merge all non-conflicting" action.
@@ -64,7 +64,7 @@ import org.eclipse.emf.compare.merge.IMerger.Registry;
public class MergeNonConflictingRunnable extends AbstractMergeRunnable implements IMergeAllNonConflictingRunnable, IMergeRunnable {
/** The logger. */
- private static final Logger LOGGER = Logger.getLogger(MergeNonConflictingRunnable.class);
+ private static final EMFCompareLogger LOGGER = new EMFCompareLogger(MergeNonConflictingRunnable.class);
/**
* Default constructor.
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/SelectDiffAction.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/SelectDiffAction.java
index 4238ad2c5..cc2b52325 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/SelectDiffAction.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/actions/SelectDiffAction.java
@@ -17,6 +17,10 @@ import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.Navigatable;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;
@@ -113,9 +117,21 @@ public class SelectDiffAction extends Action {
@SuppressWarnings("cast")
protected IHandlerService getHandlerService() {
- // explicit cast necessary for Luna
- return (IHandlerService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .getActivePart().getSite().getService(IHandlerService.class);
+ if (PlatformUI.isWorkbenchRunning()) {
+ IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
+ if (activePage != null) {
+ IWorkbenchPart activePart = activePage.getActivePart();
+ if (activePart != null) {
+ IWorkbenchPartSite site = activePart.getSite();
+ if (site != null) {
+ // explicit cast necessary for Luna
+ return (IHandlerService)site.getService(IHandlerService.class);
+ }
+ }
+ }
+ }
+ return null;
}
/**
@@ -129,9 +145,11 @@ public class SelectDiffAction extends Action {
}
public void dispose() {
- final IHandlerService handlerService = getHandlerService();
- if (handlerService != null && activatedHandler != null) {
- handlerService.deactivateHandler(activatedHandler);
+ if (PlatformUI.isWorkbenchRunning()) {
+ final IHandlerService handlerService = getHandlerService();
+ if (handlerService != null && activatedHandler != null) {
+ handlerService.deactivateHandler(activatedHandler);
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderDescriptor.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderDescriptor.java
new file mode 100644
index 000000000..e414c34e3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderDescriptor.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2022 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fleck - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.internal.subscriber;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.compare.ide.ui.dependency.IDependencyProvider;
+import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIMessages;
+import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin;
+import org.eclipse.emf.compare.ide.ui.subscriber.ISubscriberProvider;
+import org.eclipse.emf.compare.ide.ui.subscriber.SubscriberProviderRegistry;
+
+/**
+ * This class is used for information flow between {@link SubscriberProviderRegistryListener} and
+ * {@link SubscriberProviderRegistry} and managing the creation of {@link ISubscriberProvider} instances.
+ *
+ * @author Martin Fleck <mfleck@eclipsesource.com>
+ */
+public class SubscriberProviderDescriptor {
+
+ /** Underlying {@link IConfigurationElement} describing this subscriber provider. */
+ private final IConfigurationElement configurationElement;
+
+ /**
+ * Name of the configuration property that can be used to retrieve the qualified class name of this
+ * dependency provider.
+ */
+ private final String attributeClassName;
+
+ /** Don't log the same error multiple times. */
+ private boolean logOnce;
+
+ /**
+ * The cached provider demand created the first time {@link #getSubscriberProvider()} is called.
+ */
+ private ISubscriberProvider provider;
+
+ private int ranking;
+
+ /**
+ * Default constructor.
+ *
+ * @param attributeName
+ * The name of the configuration attribute responsible for the registered
+ * {@link IDependencyProvider}.
+ * @param configurationElement
+ * The {@link IConfigurationElement} containing all relevant extension information.
+ */
+ public SubscriberProviderDescriptor(String attributeName, IConfigurationElement configurationElement,
+ int ranking) {
+ this.attributeClassName = attributeName;
+ this.configurationElement = configurationElement;
+ this.ranking = ranking;
+ }
+
+ public int getRanking() {
+ return ranking;
+ }
+
+ /**
+ * Returns the {@link IDependencyProvider}.
+ *
+ * @return The newly created {@link IDependencyProvider}.
+ */
+ public ISubscriberProvider getSubscriberProvider() {
+ if (provider == null && !logOnce) {
+ try {
+ provider = (ISubscriberProvider)configurationElement
+ .createExecutableExtension(attributeClassName);
+ } catch (CoreException e) {
+ if (!logOnce) {
+ logOnce = true;
+ final String className = configurationElement.getAttribute(attributeClassName);
+ final String message = EMFCompareIDEUIMessages
+ .getString("SubscriberProviderRegistry.invalidSubscriber", className); //$NON-NLS-1$
+ final IStatus status = new Status(IStatus.ERROR,
+ configurationElement.getDeclaringExtension().getContributor().getName(), message,
+ e);
+ EMFCompareIDEUIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ }
+ return provider;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderRegistryListener.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderRegistryListener.java
new file mode 100644
index 000000000..350a2c25d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/subscriber/SubscriberProviderRegistryListener.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2022 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fleck - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.internal.subscriber;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIMessages;
+import org.eclipse.emf.compare.ide.ui.subscriber.SubscriberProviderRegistry;
+import org.eclipse.emf.compare.rcp.extension.AbstractRegistryEventListener;
+
+/**
+ * This listener will react to changes against the subscriber provider extension point, allowing us to be in
+ * sync with plugin activation and deactivation.
+ *
+ * @author Martin Fleck <mfleck@eclipsesource.com>
+ */
+public class SubscriberProviderRegistryListener extends AbstractRegistryEventListener {
+
+ /**
+ * The name of the provider element.
+ */
+ private static final String PROVIDER_ELEMENT_NAME = "provider"; //$NON-NLS-1$
+
+ /**
+ * The name of the class attribute of the provider element.
+ */
+ private static final String ATTRIBUTE_CLASS = "class"; //$NON-NLS-1$
+
+ /**
+ * The name of the class attribute of the provider element.
+ */
+ private static final String ATTRIBUTE_RANKING = "ranking"; //$NON-NLS-1$
+
+ /**
+ * The registry which will actually hold all information.
+ */
+ private final SubscriberProviderRegistry registry;
+
+ /**
+ * Initialize a registry event listener for our handlers.
+ *
+ * @param pluginID
+ * ID of the plugin contributing the extension point to monitor.
+ * @param extensionPointID
+ * Actual id of the extension point to monitor.
+ * @param log
+ * Log in which errors/warning should be logged.
+ * @param registry
+ * The actual store of handlers this registry will alter.
+ */
+ public SubscriberProviderRegistryListener(String pluginID, String extensionPointID, ILog log,
+ SubscriberProviderRegistry registry) {
+ super(pluginID, extensionPointID, log);
+ this.registry = registry;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean validateExtensionElement(IConfigurationElement element) {
+ if (PROVIDER_ELEMENT_NAME.equals(element.getName())) {
+ final String className = element.getAttribute(ATTRIBUTE_CLASS);
+ return className != null && className.trim().length() > 0;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean addedValid(IConfigurationElement element) {
+ final String className = element.getAttribute(ATTRIBUTE_CLASS);
+ final String rankingStr = element.getAttribute(ATTRIBUTE_RANKING);
+ int ranking = -1;
+ try {
+ ranking = Integer.parseInt(rankingStr);
+ } catch (NumberFormatException e) {
+ log(IStatus.ERROR, element, EMFCompareIDEUIMessages
+ .getString("ModelResolverRegistry.invalidRanking", className, rankingStr)); //$NON-NLS-1$
+ }
+
+ final SubscriberProviderDescriptor descriptor = new SubscriberProviderDescriptor(ATTRIBUTE_CLASS,
+ element, ranking);
+ registry.addProvider(className, descriptor);
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean removedValid(IConfigurationElement element) {
+ final String className = element.getAttribute(ATTRIBUTE_CLASS);
+ registry.removeProvider(className);
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/ISubscriberProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/ISubscriberProvider.java
new file mode 100644
index 000000000..287ebef80
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/ISubscriberProvider.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2022 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fleck - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.subscriber;
+
+import org.eclipse.compare.ICompareContainer;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.core.subscribers.Subscriber;
+
+/**
+ * Contract for clients of the org.eclipse.emf.ecompare.ide.ui.subscriberProvider extension point.
+ *
+ * @author Martin Fleck <mfleck@eclipsesource.com>
+ * @since 4.4.3
+ */
+public interface ISubscriberProvider {
+ /**
+ * Returns the subscriber that provides the synchronization between local resources and remote resources
+ * based on the given comparison input.
+ *
+ * @param container
+ * The compare container input.
+ * @param left
+ * Left of the compared elements.
+ * @param right
+ * Right of the compared elements.
+ * @param origin
+ * Common ancestor of the <code>left</code> and <code>right</code> compared elements.
+ * @param monitor
+ * Monitor to report progress on.
+ * @return The subscriber used for the comparison of the container or <code>null</code> if no subscriber
+ * could be determined.
+ */
+ Subscriber getSubscriber(ICompareContainer container, ITypedElement left, ITypedElement right,
+ ITypedElement origin, IProgressMonitor monitor);
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/SubscriberProviderRegistry.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/SubscriberProviderRegistry.java
new file mode 100644
index 000000000..3545d7894
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/SubscriberProviderRegistry.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2022 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fleck - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.subscriber;
+
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.eclipse.compare.ICompareContainer;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.compare.ide.ui.internal.subscriber.SubscriberProviderDescriptor;
+import org.eclipse.team.core.subscribers.Subscriber;
+
+/**
+ * The registry managing the registered subscriber provider extension point information.
+ *
+ * @author Martin Fleck <mfleck@eclipsesource.com>
+ * @since 4.4.3
+ */
+public class SubscriberProviderRegistry {
+
+ /** Keeps track of the extensions providing subscriber providers. */
+ private final Map<String, SubscriberProviderDescriptor> registeredDescriptors;
+
+ /**
+ * Constructs and initialized this registry.
+ */
+ public SubscriberProviderRegistry() {
+ registeredDescriptors = new LinkedHashMap<>();
+ }
+
+ /**
+ * Adds the given {@link SubscriberProviderDescriptor} to this registry, using the given {@code className}
+ * as the identifier.
+ *
+ * @param className
+ * The identifier for the given {@link SubscriberProviderDescriptor}.
+ * @param descriptor
+ * The {@link SubscriberProviderDescriptor} which is to be added to this registry.
+ */
+ public void addProvider(String className, SubscriberProviderDescriptor descriptor) {
+ registeredDescriptors.put(className, descriptor);
+ }
+
+ /**
+ * Removes the {@link SubscriberProviderDescriptor} and its managed {@link ISubscriberProvider} identified
+ * by the given {@code className} from this registry.
+ *
+ * @param className
+ * Identifier of the provider we are to remove from this registry.
+ * @return The removed {@link SubscriberProviderDescriptor}, if any.
+ */
+ public SubscriberProviderDescriptor removeProvider(String className) {
+ return registeredDescriptors.remove(className);
+ }
+
+ /** Clears out all registered providers from this registry. */
+ public void clear() {
+ registeredDescriptors.clear();
+ }
+
+ /**
+ * Returns the subscriber that provides the synchronization between local resources and remote resources
+ * based on the given comparison input.
+ *
+ * @param container
+ * The compare container input.
+ * @param left
+ * Left of the compared elements.
+ * @param right
+ * Right of the compared elements.
+ * @param origin
+ * Common ancestor of the <code>left</code> and <code>right</code> compared elements.
+ * @param monitor
+ * Monitor to report progress on.
+ * @return The subscriber used for the comparison of the container or <code>null</code> if no subscriber
+ * could be determined.
+ */
+ public Subscriber getSubscriber(ICompareContainer container, ITypedElement left, ITypedElement right,
+ ITypedElement origin, IProgressMonitor monitor) {
+ List<SubscriberProviderDescriptor> rankedDescriptors = registeredDescriptors.values().stream()
+ .sorted(Comparator.comparingInt(SubscriberProviderDescriptor::getRanking).reversed())
+ .collect(Collectors.toList());
+ for (SubscriberProviderDescriptor descriptor : rankedDescriptors) {
+ ISubscriberProvider provider = descriptor.getSubscriberProvider();
+ if (provider != null) {
+ Subscriber subscriber = provider.getSubscriber(container, left, right, origin, monitor);
+ if (subscriber != null) {
+ return subscriber;
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/TeamSubscriberProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/TeamSubscriberProvider.java
new file mode 100644
index 000000000..c001238dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/subscriber/TeamSubscriberProvider.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2022 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fleck - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.subscriber;
+
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.eclipse.compare.ICompareContainer;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.core.subscribers.Subscriber;
+import org.eclipse.team.core.subscribers.SubscriberMergeContext;
+import org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput;
+import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant;
+
+@SuppressWarnings("restriction")
+public class TeamSubscriberProvider implements ISubscriberProvider {
+
+ public Subscriber getSubscriber(ICompareContainer container, ITypedElement left, ITypedElement right,
+ ITypedElement origin, IProgressMonitor monitor) {
+ if (container instanceof ModelCompareEditorInput) {
+ return getSubscriber((ModelCompareEditorInput)container);
+ }
+ return null;
+ }
+
+ /**
+ * Team left us with absolutely no way to determine whether our supplied input is the result of a
+ * synchronization or not.
+ * <p>
+ * In order to properly resolve the logical model of the resource currently being compared we need to know
+ * what "other" resources were part of its logical model, and we need to know the revisions of these
+ * resources we are to load. All of this has already been computed by Team, but it would not let us know.
+ * This method uses discouraged means to get around this "black box" locking from Team.
+ * </p>
+ * <p>
+ * The basic need here is to retrieve the Subscriber from this point. We have a lot of accessible
+ * variables, the two most important being the CompareConfiguration and ICompareInput... I could find no
+ * way around the privileged access to the private ModelCompareEditorInput.participant field. There does
+ * not seem to be any adapter (or Platform.getAdapterManager().getAdapter(...)) that would allow for this,
+ * so I'm taking the long way 'round.
+ * </p>
+ *
+ * @return The subscriber used for this comparison if any could be found, <code>null</code> otherwise.
+ */
+ private Subscriber getSubscriber(ModelCompareEditorInput input) {
+ ModelSynchronizeParticipant participant = getModelSynchronizeParticipant(input);
+ return participant != null && participant.getContext() instanceof SubscriberMergeContext
+ ? ((SubscriberMergeContext)participant.getContext()).getSubscriber()
+ : null;
+ }
+
+ private ModelSynchronizeParticipant getModelSynchronizeParticipant(ModelCompareEditorInput modelInput) {
+ try {
+ final Field field = ModelCompareEditorInput.class.getDeclaredField("participant"); //$NON-NLS-1$
+ AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
+ field.setAccessible(true);
+ return null;
+ });
+ Object participant = field.get(modelInput);
+ return participant instanceof ModelSynchronizeParticipant
+ ? (ModelSynchronizeParticipant)participant
+ : null;
+ } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
+ // Swallow this, this private field was there at least from 3.5 to 4.3
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
index f78a2cb3d..c798ebed1 100644
--- a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
@@ -14,12 +14,12 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Localization: plugin
-Import-Package: com.google.common.annotations;version="[27.0.0,28.0.0)",
- com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.io;version="[27.0.0,28.0.0)",
- com.google.common.util.concurrent;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.annotations;version="[27.0.0,30.2.0)",
+ com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.io;version="[27.0.0,30.2.0)",
+ com.google.common.util.concurrent;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.ide,
org.eclipse.emf.compare.ide.hook,
org.eclipse.emf.compare.ide.internal.hook;x-friends:="org.eclipse.emf.compare.ide.ui",
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
index 8686823ca..fd54f2b7d 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotLoadingResourceSet.java
@@ -561,6 +561,15 @@ public final class NotLoadingResourceSet extends ResourceSetImpl implements Disp
}
/**
+ * Returns the map from URI to IStorage used internally by this resource set to load its content.
+ *
+ * @return The internal URI to IStorage map.
+ */
+ public Map<URI, IStorage> getStorageToURI() {
+ return storageToURI;
+ }
+
+ /**
* Helper class to encapsulate pairs of {@link EObject}s and {@link EStructuralFeature}s pointing to proxy
* objects.
*/
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java
index 54f3b5545..38d4fe2bf 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/NotifyingParserPool.java
@@ -23,6 +23,7 @@ import java.util.StringTokenizer;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.internal.utils.DiffUtil;
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -306,6 +307,9 @@ public class NotifyingParserPool extends XMLParserPoolImpl {
potentialProxies.add(entry);
}
}
+ } else if (feature instanceof EAttribute && ((EAttribute)feature).isID()) {
+ // We cannot ignore id attributes as these are required for the reference resolution
+ super.setValue(eObject, feature, value, position);
} else if (!containmentOnly) {
super.setValue(eObject, feature, value, position);
}
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.log4j.fragment/META-INF/MANIFEST.MF
deleted file mode 100644
index a28df4223..000000000
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: EMF Compare Logging Support
-Bundle-Vendor: Eclipse Modeling Project
-Bundle-SymbolicName: org.eclipse.emf.compare.log4j.fragment
-Bundle-Version: 1.1.0.qualifier
-Fragment-Host: org.apache.log4j
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/build.properties b/plugins/org.eclipse.emf.compare.log4j.fragment/build.properties
deleted file mode 100644
index b107977f4..000000000
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-source.. = src/
-bin.includes = META-INF/,\
- .
diff --git a/plugins/org.eclipse.emf.compare.log4j.fragment/src/log4j.properties b/plugins/org.eclipse.emf.compare.log4j.fragment/src/log4j.properties
deleted file mode 100644
index 58b639266..000000000
--- a/plugins/org.eclipse.emf.compare.log4j.fragment/src/log4j.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file defines the log4j configuration for EMFCompare plug-ins.
-# It is installed as a fragment of org.apache.log4j,
-# and defines an appender for logs written from EMFCompare to
-# a rolling file.
-# ___________________________________________________________________
-# Set root logger level to debug and its only appender to default.
-log4j.rootLogger=error, default
-# default is set to be a ConsoleAppender.
-log4j.appender.default=org.apache.log4j.ConsoleAppender
-# default uses PatternLayout.
-log4j.appender.default.layout=org.apache.log4j.PatternLayout
-log4j.appender.default.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
-
-# ___________________________________________________________________
-# EMFCompare-specific configuration
-#
-log4j.logger.org.eclipse.emf.compare=OFF, default
-# We don't want these logs to be routed to other parent loggers
-log4j.additivity.org.eclipse.emf.compare = false
-log4j.appender.EMFCFile=org.apache.log4j.RollingFileAppender
-log4j.appender.EMFCFile.File=emfcompare.log
-# Keep 10 back-up files of at most 2MB
-log4j.appender.EMFCFile.MaxFileSize=2MB
-log4j.appender.EMFCFile.MaxBackupIndex=10
-# We would like to use EnhancedPatternLayout but it requires log4j 1.2.16+
-# which is not in orbit
-log4j.appender.EMFCFile.layout=org.apache.log4j.PatternLayout
-# Date [Thread name] LEVEL 3.last.segments.of.logger.name <NDC Tag> - message\n
-log4j.appender.EMFCFile.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{3} %x - %m%n
diff --git a/plugins/org.eclipse.emf.compare.rcp.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp.tests/META-INF/MANIFEST.MF
index 583b7fa01..837149c03 100644
--- a/plugins/org.eclipse.emf.compare.rcp.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp.tests/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare;bundle-version="3.3.0",
org.eclipse.emf.compare.rcp;bundle-version="2.4.0",
org.eclipse.emf.compare.tests;bundle-version="3.3.0"
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp.ui.tests/META-INF/MANIFEST.MF
index 7b0fb4879..5ebc561e1 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp.ui.tests/META-INF/MANIFEST.MF
@@ -18,9 +18,9 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.workbench
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: %providerName
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.rcp.ui.tests,
org.eclipse.emf.compare.rcp.ui.tests.mergeviewer.item,
org.eclipse.emf.compare.rcp.ui.tests.structuremergeviewer.groups.provider,
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
index aa955c2c8..4c6ceb010 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
@@ -56,9 +56,8 @@ Export-Package: org.eclipse.emf.compare.rcp.ui,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.extender
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)",
- com.google.common.io;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="[1.2.15,2.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)",
+ com.google.common.io;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/preferences/LoggingPreferencePage.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/preferences/LoggingPreferencePage.java
index 853edc375..8cac716a3 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/preferences/LoggingPreferencePage.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/preferences/LoggingPreferencePage.java
@@ -13,16 +13,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.rcp.ui.internal.preferences;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_BACKUP_COUNT_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_BACKUP_DEFAULT;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILENAME_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILE_DEFAULT;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILE_MAX_SIZE_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILE_SIZE_DEFAULT;
import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_LEVEL_DEFAULT;
import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_LEVEL_KEY;
-import java.io.File;
import java.io.IOException;
import java.util.Arrays;
@@ -37,18 +30,11 @@ import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
@@ -63,13 +49,7 @@ public class LoggingPreferencePage extends PreferencePage implements IWorkbenchP
private Combo levelCombo;
- private Text fileField;
-
- private Text maxSizeField;
-
- private Text maxBackupField;
-
- private final String[] LOG_LEVELS = new String[] {"OFF", "ERROR", "INFO", "DEBUG" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ private final String[] LOG_LEVELS = new String[] {"OFF", "INFO", "DEBUG" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
/**
* Constructor.
@@ -121,46 +101,6 @@ public class LoggingPreferencePage extends PreferencePage implements IWorkbenchP
levelCombo.setItems(LOG_LEVELS);
levelCombo.setLayoutData(getDefaultFieldGridData(100));
- Label fileLabel = new Label(loggingComposite, SWT.LEAD);
- fileLabel.setText(EMFCompareRCPUIMessages.getString("LoggingPreferencePage.log.file")); //$NON-NLS-1$
- fileField = new Text(loggingComposite, SWT.BORDER | SWT.SINGLE);
- fileField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- Button fileButton = new Button(loggingComposite, SWT.PUSH);
- fileButton.setText(EMFCompareRCPUIMessages.getString("LoggingPreferencePage.filebutton.label")); //$NON-NLS-1$
- fileButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- FileDialog dlg = new FileDialog(getShell(), SWT.SAVE);
- File file = new File(fileField.getText());
- dlg.setFileName(file.getName());
- dlg.setFilterPath(file.getParent());
- String fileName = dlg.open();
- if (fileName != null) {
- fileField.setText(fileName);
- }
- }
- });
-
- Label maxSizeLabel = new Label(loggingComposite, SWT.LEAD);
- maxSizeLabel.setText(EMFCompareRCPUIMessages.getString("LoggingPreferencePage.log.file.size")); //$NON-NLS-1$
- maxSizeField = new Text(loggingComposite, SWT.BORDER | SWT.SINGLE);
- maxSizeField.setLayoutData(getDefaultFieldGridData(80));
- maxSizeField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- verifyIntegerFields();
- }
- });
-
- Label maxBackupLabel = new Label(loggingComposite, SWT.LEAD);
- maxBackupLabel.setText(EMFCompareRCPUIMessages.getString("LoggingPreferencePage.log.backup.count")); //$NON-NLS-1$
- maxBackupField = new Text(loggingComposite, SWT.BORDER | SWT.SINGLE);
- maxBackupField.setLayoutData(getDefaultFieldGridData(80));
- maxBackupField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- verifyIntegerFields();
- }
- });
-
refreshWidgets();
return loggingComposite;
@@ -173,35 +113,20 @@ public class LoggingPreferencePage extends PreferencePage implements IWorkbenchP
}
protected void savePreferences() throws BackingStoreException, IOException {
- getPreferenceStore().setValue(LOG_FILENAME_KEY, fileField.getText());
String item = levelCombo.getItem(levelCombo.getSelectionIndex());
getPreferenceStore().setValue(LOG_LEVEL_KEY, item);
- getPreferenceStore().setValue(LOG_BACKUP_COUNT_KEY, maxBackupField.getText());
- getPreferenceStore().setValue(LOG_FILE_MAX_SIZE_KEY, maxSizeField.getText());
}
protected void resetPreferences() {
- getPreferenceStore().setToDefault(LOG_FILENAME_KEY);
getPreferenceStore().setToDefault(LOG_LEVEL_KEY);
- getPreferenceStore().setToDefault(LOG_BACKUP_COUNT_KEY);
- getPreferenceStore().setToDefault(LOG_FILE_MAX_SIZE_KEY);
}
protected void refreshWidgets() {
IPreferencesService prefsService = Platform.getPreferencesService();
- String fileName = prefsService.getString(EMFCompareRCPPlugin.PLUGIN_ID, LOG_FILENAME_KEY,
- LOG_FILE_DEFAULT, null);
String level = prefsService.getString(EMFCompareRCPPlugin.PLUGIN_ID, LOG_LEVEL_KEY, LOG_LEVEL_DEFAULT,
null);
- int maxBackupCount = prefsService.getInt(EMFCompareRCPPlugin.PLUGIN_ID, LOG_BACKUP_COUNT_KEY,
- LOG_BACKUP_DEFAULT, null);
- int maxSizeInMB = prefsService.getInt(EMFCompareRCPPlugin.PLUGIN_ID, LOG_FILE_MAX_SIZE_KEY,
- LOG_FILE_SIZE_DEFAULT, null);
levelCombo.select(Arrays.asList(LOG_LEVELS).indexOf(level));
levelCombo.pack();
- fileField.setText(fileName);
- maxBackupField.setText(Integer.toString(maxBackupCount));
- maxSizeField.setText(Integer.toString(maxSizeInMB));
}
@Override
@@ -222,30 +147,4 @@ public class LoggingPreferencePage extends PreferencePage implements IWorkbenchP
super.performDefaults();
}
- /**
- * Verify if max size and max file fields are valid. It checks if the fields are integer and not empty.
- */
- private void verifyIntegerFields() {
- try {
- Integer.parseInt(maxSizeField.getText());
- Integer.parseInt(maxBackupField.getText());
- setPreferencePageError(true, null);
- } catch (Exception e) {
- setPreferencePageError(false,
- EMFCompareRCPUIMessages.getString("LoggingPreferencePage.error.message")); //$NON-NLS-1$
- }
- }
-
- /**
- * Set preference page error message and if this page is valid.
- *
- * @param isValid
- * True if you can apply these preference
- * @param errorMessage
- * Error message to display or null to remove the message
- */
- private void setPreferencePageError(boolean isValid, String errorMessage) {
- setValid(isValid);
- setErrorMessage(errorMessage);
- }
}
diff --git a/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF
index 5f8e1c5cd..572cb9c2e 100644
--- a/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp/META-INF/MANIFEST.MF
@@ -25,6 +25,5 @@ Export-Package: org.eclipse.emf.compare.rcp,
org.eclipse.emf.compare.rcp.internal.preferences;x-friends:="org.eclipse.emf.compare.rcp.ui,org.eclipse.emf.compare.ide.ui",
org.eclipse.emf.compare.rcp.internal.tracer;x-friends:="org.eclipse.emf.compare.rcp.ui,org.eclipse.emf.compare.ide.ui",
org.eclipse.emf.compare.rcp.policy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="[1.2.15,2.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareLogger.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareLogger.java
new file mode 100644
index 000000000..43ce25bbe
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareLogger.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2017 Obeo and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ * Philip Langer - add scope of a comparison to its adapters, progress reporting
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * Mimics the Log4J 1 logger interface but sends all logging to the Eclipse log. This allows us to remove
+ * Log4J 1 with limited impacts.
+ *
+ * @author lgoubet
+ */
+public class EMFCompareLogger {
+
+ private static Level level;
+
+ private Class<?> caller;
+
+ public EMFCompareLogger(Class<?> caller) {
+ this.caller = caller;
+ }
+
+ public boolean isInfoEnabled() {
+ return level.compareTo(Level.INFO) >= 0;
+ }
+
+ public boolean isDebugEnabled() {
+ return level.compareTo(Level.DEBUG) >= 0;
+ }
+
+ public static void setLevel(String newLevel) {
+ if (newLevel == null) {
+ level = Level.OFF;
+ return;
+ }
+ String upper = newLevel.toUpperCase();
+ switch (upper) {
+ case "INFO": //$NON-NLS-1$
+ level = Level.INFO;
+ break;
+ case "DEBUG": //$NON-NLS-1$
+ level = Level.DEBUG;
+ break;
+ case "OFF": //$NON-NLS-1$
+ // Fall-through
+ default:
+ level = Level.OFF;
+ }
+ }
+
+ public void info(String message) {
+ EMFCompareRCPPlugin.getDefault().getLog().log(
+ new Status(IStatus.INFO, EMFCompareRCPPlugin.PLUGIN_ID, caller.getName() + " - " + message)); //$NON-NLS-1$
+ }
+
+ public void debug(String message) {
+ // Eclipse has no "debug" level.
+ info(message);
+ }
+
+ public enum Level {
+ OFF, INFO, DEBUG;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java
index 9f203e0f2..44b1a4a43 100644
--- a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/EMFCompareRCPPlugin.java
@@ -12,15 +12,8 @@
*******************************************************************************/
package org.eclipse.emf.compare.rcp;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.EMFC_APPENDER_NAME;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_BACKUP_COUNT_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_BACKUP_DEFAULT;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILENAME_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILE_MAX_SIZE_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_FILE_SIZE_DEFAULT;
import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_LEVEL_DEFAULT;
import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_LEVEL_KEY;
-import static org.eclipse.emf.compare.rcp.internal.preferences.EMFComparePreferences.LOG_PATTERN;
import com.google.common.base.Predicate;
import com.google.common.collect.ArrayListMultimap;
@@ -29,24 +22,17 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
-import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.RollingFileAppender;
import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.conflict.IConflictDetector;
@@ -129,14 +115,6 @@ public class EMFCompareRCPPlugin extends Plugin {
/** The id of the adapter factory extension point. */
public static final String FACTORY_PPID = "adapterFactory"; //$NON-NLS-1$
- /**
- * Log4j logger to use throughout EMFCompare for logging purposes.
- */
- private static final Logger LOGGER = Logger.getLogger("org.eclipse.emf.compare"); //$NON-NLS-1$
-
- /** Number of bytes in a MiB. */
- private static final int MEGABYTE = 1024 * 1024;
-
/** This plugin is a singleton, so it's quite ok to keep the plugin in a static field. */
private static EMFCompareRCPPlugin plugin;
@@ -768,59 +746,18 @@ public class EMFCompareRCPPlugin extends Plugin {
}
/**
- * Initializes log4j by reading the preferences.
+ * Initializes logging by reading the preferences.
*/
private void initLogging() {
- LOGGER.setLevel(Level.toLevel(Platform.getPreferencesService()
- .getString(EMFCompareRCPPlugin.PLUGIN_ID, LOG_LEVEL_KEY, LOG_LEVEL_DEFAULT, null)));
- if (!Level.OFF.equals(LOGGER.getLevel())) {
- RollingFileAppender appender = (RollingFileAppender)LOGGER.getAppender(EMFC_APPENDER_NAME);
- String logFileName = Platform.getPreferencesService().getString(EMFCompareRCPPlugin.PLUGIN_ID,
- LOG_FILENAME_KEY, "", null); //$NON-NLS-1$
- if (logFileName.length() > 0) {
- if (appender == null) {
- try {
- createLogAppender(logFileName);
- } catch (IOException e) {
- // Invalidate file name
- Platform.getPreferencesService().getString(EMFCompareRCPPlugin.PLUGIN_ID,
- LOG_FILENAME_KEY, "", null); //$NON-NLS-1$
- }
- } else {
- appender.setMaxBackupIndex(Platform.getPreferencesService().getInt(
- EMFCompareRCPPlugin.PLUGIN_ID, LOG_BACKUP_COUNT_KEY, LOG_BACKUP_DEFAULT, null));
- appender.setMaximumFileSize(
- (Platform.getPreferencesService().getInt(EMFCompareRCPPlugin.PLUGIN_ID,
- LOG_FILE_MAX_SIZE_KEY, LOG_FILE_SIZE_DEFAULT, null)) * MEGABYTE);
- }
- }
- }
+ String level = Platform.getPreferencesService().getString(EMFCompareRCPPlugin.PLUGIN_ID,
+ LOG_LEVEL_KEY, LOG_LEVEL_DEFAULT, null);
+ EMFCompareLogger.setLevel(level);
preferenceChangeListener = new LoggingPreferenceChangeListener();
InstanceScope.INSTANCE.getNode(EMFCompareRCPPlugin.PLUGIN_ID)
.addPreferenceChangeListener(preferenceChangeListener);
}
/**
- * Creates the RollingFileAppender used to log with log4j.
- *
- * @param newFileName
- * Path opf the log file
- * @throws IOException
- * If an IO problem occurs, like the given path does not represent a file, or it cannot be
- * written;
- */
- private void createLogAppender(String newFileName) throws IOException {
- RollingFileAppender appender;
- appender = new RollingFileAppender(new PatternLayout(LOG_PATTERN), newFileName, true);
- LOGGER.removeAllAppenders(); // We don't want to log elsewhere
- LOGGER.addAppender(appender);
- appender.setMaxBackupIndex(Platform.getPreferencesService().getInt(EMFCompareRCPPlugin.PLUGIN_ID,
- LOG_BACKUP_COUNT_KEY, LOG_BACKUP_DEFAULT, null));
- appender.setMaximumFileSize((Platform.getPreferencesService().getInt(EMFCompareRCPPlugin.PLUGIN_ID,
- LOG_FILE_MAX_SIZE_KEY, LOG_FILE_SIZE_DEFAULT, null)) * MEGABYTE);
- }
-
- /**
* Listens to logging preference changes to maintain the log4j configuration up-to-date.
*
* @author <a href="mailto:laurent.delaigue@obeo.fr">Laurent Delaigue</a>
@@ -828,63 +765,14 @@ public class EMFCompareRCPPlugin extends Plugin {
private static class LoggingPreferenceChangeListener implements IPreferenceChangeListener {
/**
- * The path of the logging file.
- */
- private String path;
-
- /**
- * The level of the logger.
- */
- private Level loggingLevel;
-
- /**
* Updates the log4j configuration when logging preferences change.
*
* @param event
* the preference change event.
*/
public void preferenceChange(PreferenceChangeEvent event) {
- final IPreferencesService prefs = Platform.getPreferencesService();
-
- path = prefs.getString(EMFCompareRCPPlugin.PLUGIN_ID, LOG_FILENAME_KEY, "", null); //$NON-NLS-1$
if (LOG_LEVEL_KEY.equals(event.getKey())) {
- loggingLevel = Level.toLevel((String)event.getNewValue());
- LOGGER.setLevel(loggingLevel);
- } else if (LOG_FILENAME_KEY.equals(event.getKey())) {
- path = (String)event.getNewValue();
- } else if (LOG_BACKUP_COUNT_KEY.equals(event.getKey())) {
- RollingFileAppender appender = (RollingFileAppender)LOGGER.getAppender(EMFC_APPENDER_NAME);
- if (appender != null) {
- appender.setMaxBackupIndex(Integer.parseInt((String)event.getNewValue()));
- }
- } else if (LOG_FILE_MAX_SIZE_KEY.equals(event.getKey())) {
- RollingFileAppender appender = (RollingFileAppender)LOGGER.getAppender(EMFC_APPENDER_NAME);
- if (appender != null) {
- appender.setMaximumFileSize(Integer.parseInt((String)event.getNewValue()) * MEGABYTE);
- }
- }
- if (loggingLevel != null && !Level.OFF.equals(loggingLevel) && path != null
- && path.length() > 0) {
- initFile();
- }
- }
-
- /**
- * Create the logging file.
- */
- private void initFile() {
- RollingFileAppender appender = (RollingFileAppender)LOGGER.getAppender(EMFC_APPENDER_NAME);
- if (appender == null) {
- try {
- EMFCompareRCPPlugin.getDefault().createLogAppender(path);
- } catch (IOException e) {
- // Force the value to be harmless
- InstanceScope.INSTANCE.getNode(EMFCompareRCPPlugin.PLUGIN_ID).put(LOG_FILENAME_KEY, ""); //$NON-NLS-1$
- getDefault().log(IStatus.ERROR,
- EMFCompareRCPMessages.getString("logging.appender.error", path, e.getMessage())); //$NON-NLS-1$
- }
- } else {
- appender.setFile(path);
+ EMFCompareLogger.setLevel((String)event.getNewValue());
}
}
diff --git a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/preferences/EMFComparePreferences.java b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/preferences/EMFComparePreferences.java
index f3340866f..20cec4db1 100644
--- a/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/preferences/EMFComparePreferences.java
+++ b/plugins/org.eclipse.emf.compare.rcp/src/org/eclipse/emf/compare/rcp/internal/preferences/EMFComparePreferences.java
@@ -46,42 +46,12 @@ public final class EMFComparePreferences {
/** Disabled adapter factories preference. */
public static final String DISABLED_ADAPTER_FACTORY = "org.eclipse.emf.compare.preference.disabled.adapter.factories"; //$NON-NLS-1$
- /** Preference key for log4j file name. */
- public static final String LOG_FILENAME_KEY = "org.eclipse.emf.compare.log.file.name"; //$NON-NLS-1$
-
- /** Preference key for log4j log level. */
+ /** Preference key for log level. */
public static final String LOG_LEVEL_KEY = "org.eclipse.emf.compare.log.level"; //$NON-NLS-1$
- /** Preference key for log4j backup file max number. */
- public static final String LOG_BACKUP_COUNT_KEY = "org.eclipse.emf.compare.log.backup.count"; //$NON-NLS-1$
-
- /** Preference key for log4j maximum file size. */
- public static final String LOG_FILE_MAX_SIZE_KEY = "org.eclipse.emf.compare.log.file.max.size"; //$NON-NLS-1$
-
- /** Log4j appender used by EMFCompare. */
- public static final String EMFC_APPENDER_NAME = "EMFCFile"; //$NON-NLS-1$
-
- /** Default log4j file name. */
- public static final String LOG_FILE_DEFAULT = ""; //$NON-NLS-1$
-
- /** Default log4j level. */
+ /** Default log level. */
public static final String LOG_LEVEL_DEFAULT = "OFF"; //$NON-NLS-1$
- /** Default log4j backup file max number. */
- public static final int LOG_BACKUP_DEFAULT = 10;
-
- /** Default log4j maximum file size. */
- public static final int LOG_FILE_SIZE_DEFAULT = 100;
-
- /**
- * Pattern used for log4j logging.
- *
- * <pre>
- * Date [Thread name] LEVEL 3.last.segments.of.logger.name <NDC Tag> - message\n
- * </pre>
- */
- public static final String LOG_PATTERN = "%d{ISO8601} [%t] %-5p %c{3} %x - %m%n"; //$NON-NLS-1$
-
/**
* Private constructor. Not to be called.
*/
diff --git a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
index 7f8cbfcd3..10ec57e89 100644
--- a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
@@ -54,8 +54,9 @@ Export-Package: org.eclipse.emf.compare.tests,
org.eclipse.emf.compare.tests.req.data,
org.eclipse.emf.compare.tests.scope,
org.eclipse.emf.compare.tests.suite,
- org.eclipse.emf.compare.tests.unit
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+ org.eclipse.emf.compare.tests.unit,
+ org.eclipse.emf.compare.tests.utils
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/utils/EMFCompareTestsUtils.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/utils/EMFCompareTestsUtils.java
new file mode 100644
index 000000000..f2e56f040
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/utils/EMFCompareTestsUtils.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * This utility class provides methods that will be used by test classes.
+ *
+ * @author <a href="mailto:glenn.plouhinec@obeo.fr">Glenn Plouhinec</a>
+ */
+public class EMFCompareTestsUtils {
+ /**
+ * Ensure that the two given lists contain the same elements in the same order. The kind of list does not
+ * matter.
+ *
+ * @param <T>
+ * The type of objects in each list.
+ * @param comparison
+ * The comparison used to compare models.
+ * @param list1
+ * First of the two lists to compare.
+ * @param list2
+ * Second of the two lists to compare.
+ */
+ public static <T extends EObject> void assertEqualContents(Comparison comparison, List<T> list1,
+ List<T> list2) {
+ final int size = list1.size();
+ assertEquals(size, list2.size());
+
+ for (int i = 0; i < size; i++) {
+ final EObject eObject1 = list1.get(i);
+ final EObject eObject2 = list2.get(i);
+ final Match match = comparison.getMatch(eObject1);
+ eObject1.equals(eObject2);
+ if (match.getLeft() == eObject1) {
+ assertEquals(match.getRight(), eObject2);
+ } else {
+ assertEquals(match.getRight(), eObject1);
+ assertEquals(match.getLeft(), eObject2);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
index 5ba04a18e..db2cab1f3 100644
--- a/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
@@ -19,8 +19,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.uml2.types;visibility:=reexport,
org.eclipse.emf.compare.edit;bundle-version="4.2.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
org.eclipse.emf.compare.provider
Export-Package: org.eclipse.emf.compare.uml2.internal,
org.eclipse.emf.compare.uml2.internal.provider;x-internal:=true,
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.ide.tests/META-INF/MANIFEST.MF
index 1e4e7f2b8..ce472e2b2 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.tests/META-INF/MANIFEST.MF
@@ -17,6 +17,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.compare.uml2.rcp
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.uml2.ide.tests.util
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/META-INF/MANIFEST.MF
index c0e3cf9c4..5c3e53010 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui.tests/META-INF/MANIFEST.MF
@@ -24,6 +24,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.compare.ide.ui.tests;bundle-version="4.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
index 12e30e78d..04fe924ed 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
@@ -14,5 +14,5 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare.uml2.rcp.ui.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.rcp.ui.tests/META-INF/MANIFEST.MF
index 16e21ff40..9362cce80 100644
--- a/plugins/org.eclipse.emf.compare.uml2.rcp.ui.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.rcp.ui.tests/META-INF/MANIFEST.MF
@@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.uml2.rcp.ui.tests.groups
diff --git a/plugins/org.eclipse.emf.compare.uml2.rcp.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.rcp.ui/META-INF/MANIFEST.MF
index b40c341fc..389dae95d 100644
--- a/plugins/org.eclipse.emf.compare.uml2.rcp.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.rcp.ui/META-INF/MANIFEST.MF
@@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.uml2.uml;bundle-version="5.0.0",
org.eclipse.emf.compare.edit;bundle-version="3.0.0"
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.eclipse.emf.compare.uml2.rcp.ui.internal.accessor;x-internal:=true,
diff --git a/plugins/org.eclipse.emf.compare.uml2.rcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.rcp/META-INF/MANIFEST.MF
index 7f68010ee..f66662659 100644
--- a/plugins/org.eclipse.emf.compare.uml2.rcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.rcp/META-INF/MANIFEST.MF
@@ -11,6 +11,6 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.uml2.rcp.internal.policy;x-friends:="org.eclipse.emf.compare.uml2.ide"
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
index 7f82d4988..a6e569713 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
@@ -32,7 +32,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare.ide;bundle-version="3.3.0",
org.hamcrest.library;bundle-version="1.3.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
org.eclipse.emf.compare.rcp
Bundle-Activator: org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.provider.UML2CompareTestProfileEditPlugin$Implementation
diff --git a/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
index fd031a843..bd33b1258 100644
--- a/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
@@ -14,10 +14,9 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare;bundle-version="3.4.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.emf.compare.uml2.internal.UMLComparePlugin
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.primitives;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="1.2.15"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.primitives;version="[27.0.0,30.2.0)"
Export-Package: org.eclipse.emf.compare.uml2.internal;
x-friends:="org.eclipse.emf.compare.uml2.edit,
org.eclipse.emf.compare.uml2.rcp,
diff --git a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/internal/merge/OpaqueElementBodyChangeMerger.java b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/internal/merge/OpaqueElementBodyChangeMerger.java
index b1231bc8e..a9558afa3 100644
--- a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/internal/merge/OpaqueElementBodyChangeMerger.java
+++ b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/internal/merge/OpaqueElementBodyChangeMerger.java
@@ -26,7 +26,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
@@ -55,9 +54,6 @@ import org.eclipse.emf.ecore.EObject;
*/
public class OpaqueElementBodyChangeMerger extends AttributeChangeMerger {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(OpaqueElementBodyChangeMerger.class);
-
@Override
public boolean isMergerFor(Diff target) {
return isOrRefinesOpaqueElementBodyChange(target);
@@ -148,12 +144,6 @@ public class OpaqueElementBodyChangeMerger extends AttributeChangeMerger {
return;
}
- if (LOGGER.isDebugEnabled()) {
- int refinedElementCount = bodyChange.getRefinedBy().size();
- LOGGER.debug("accept(Diff, boolean) - " + refinedElementCount //$NON-NLS-1$
- + " refined diffs to merge for diff " + diff.hashCode()); //$NON-NLS-1$
- }
-
switch (bodyChange.getKind()) {
case ADD:
acceptRefiningDiffs(bodyChange, rightToLeft);
@@ -189,12 +179,6 @@ public class OpaqueElementBodyChangeMerger extends AttributeChangeMerger {
return;
}
- if (LOGGER.isDebugEnabled()) {
- int refinedElementCount = bodyChange.getRefinedBy().size();
- LOGGER.debug("Reject(Diff, boolean)" + refinedElementCount //$NON-NLS-1$
- + " refined diffs to merge for diff " + diff.hashCode()); //$NON-NLS-1$
- }
-
switch (bodyChange.getKind()) {
case ADD:
rejectRefiningDiffs(bodyChange, rightToLeft);
diff --git a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
index b83561f6b..87150bc14 100644
--- a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
@@ -40,8 +40,7 @@ Export-Package: org.eclipse.emf.compare,
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="2.5.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[27.0.0,28.0.0)",
- com.google.common.cache;version="[27.0.0,28.0.0)",
- com.google.common.collect;version="[27.0.0,28.0.0)",
- com.google.common.eventbus;version="[27.0.0,28.0.0)",
- org.apache.log4j;version="[1.2.15,2.0.0)"
+Import-Package: com.google.common.base;version="[27.0.0,30.2.0)",
+ com.google.common.cache;version="[27.0.0,30.2.0)",
+ com.google.common.collect;version="[27.0.0,30.2.0)",
+ com.google.common.eventbus;version="[27.0.0,30.2.0)"
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
index d75ffc9f1..8512f6f44 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
@@ -16,14 +16,12 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Iterator;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.conflict.IConflictDetector;
import org.eclipse.emf.compare.conflict.MatchBasedConflictDetector;
@@ -70,15 +68,6 @@ public class EMFCompare {
*/
public static final String DIAGNOSTIC_SOURCE = "org.eclipse.emf.compare"; //$NON-NLS-1$
- /** Constant for logging. */
- private static final String START = " - START"; //$NON-NLS-1$
-
- /** Constant for logging. */
- private static final String FINISH = " - FINISH"; //$NON-NLS-1$
-
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(EMFCompare.class);
-
/** The registry we'll use to create a match engine for this comparison. */
private final IMatchEngine.Factory.Registry matchEngineFactoryRegistry;
@@ -204,19 +193,9 @@ public class EMFCompare {
checkNotNull(scope);
checkNotNull(monitor);
- // Used to compute the time spent in the method
- long startTime = System.currentTimeMillis();
-
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - START"); //$NON-NLS-1$
- }
-
Comparison comparison = null;
try {
Monitor subMonitor = new SafeSubMonitor(monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: MATCH"); //$NON-NLS-1$
- }
comparison = matchEngineFactoryRegistry.getHighestRankingMatchEngineFactory(scope)
.getMatchEngine().match(scope, subMonitor);
@@ -226,62 +205,30 @@ public class EMFCompare {
List<IPostProcessor> postProcessors = postProcessorDescriptorRegistry.getPostProcessors(scope);
// CHECKSTYLE:OFF Yes, I want to have ifs here and no constant for "post-processor".
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: POST-MATCH with " + postProcessors.size() //$NON-NLS-1$
- + " post-processors"); //$NON-NLS-1$
- }
postMatch(comparison, postProcessors, subMonitor);
monitor.worked(1);
if (!hasToStop(comparison, monitor)) {
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: DIFF"); //$NON-NLS-1$
- }
diffEngine.diff(comparison, subMonitor);
monitor.worked(1);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: POST-DIFF with " //$NON-NLS-1$
- + postProcessors.size() + " post-processors"); //$NON-NLS-1$
- }
postDiff(comparison, postProcessors, subMonitor);
monitor.worked(1);
if (!hasToStop(comparison, monitor)) {
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: REQUIREMENTS"); //$NON-NLS-1$
- }
reqEngine.computeRequirements(comparison, subMonitor);
monitor.worked(1);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: POST-REQUIREMENTS with " //$NON-NLS-1$
- + postProcessors.size() + " post-processors"); //$NON-NLS-1$
- }
postRequirements(comparison, postProcessors, subMonitor);
monitor.worked(1);
if (!hasToStop(comparison, monitor)) {
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: EQUIVALENCES"); //$NON-NLS-1$
- }
equiEngine.computeEquivalences(comparison, subMonitor);
monitor.worked(1);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: POST-EQUIVALENCES with " //$NON-NLS-1$
- + postProcessors.size() + " post-processors"); //$NON-NLS-1$
- }
postEquivalences(comparison, postProcessors, subMonitor);
monitor.worked(1);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: CONFLICT"); //$NON-NLS-1$
- }
detectConflicts(comparison, postProcessors, subMonitor);
monitor.worked(1);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - starting step: POST-COMPARISON with " //$NON-NLS-1$
- + postProcessors.size() + " post-processors"); //$NON-NLS-1$
- }
// CHECKSTYLE:ON
postComparison(comparison, postProcessors, subMonitor);
monitor.worked(1);
@@ -289,9 +236,6 @@ public class EMFCompare {
}
}
} catch (ComparisonCanceledException e) {
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("compare() - Comparison has been canceled"); //$NON-NLS-1$
- }
if (comparison == null) {
comparison = new ComparisonSpec();
}
@@ -307,10 +251,6 @@ public class EMFCompare {
monitor.done();
}
- if (LOGGER.isInfoEnabled()) {
- logEndOfComparison(comparison, startTime);
- }
-
// Add scope to the comparison's adapters to make it available throughout the framework
if (scope instanceof Adapter) {
comparison.eAdapters().add((Adapter)scope);
@@ -353,32 +293,6 @@ public class EMFCompare {
}
/**
- * Log useful informations at the end of the comparison process.
- *
- * @param comparison
- * The comparison
- * @param start
- * The time when the method start
- */
- private void logEndOfComparison(Comparison comparison, long start) {
- long duration = System.currentTimeMillis() - start;
- int diffQuantity = comparison.getDifferences().size();
- int conflictQuantity = comparison.getConflicts().size();
- int matchQuantity = 0;
- EList<Match> matches = comparison.getMatches();
- for (Match match : matches) {
- matchQuantity++;
- Iterator<Match> subMatchIterator = match.getAllSubmatches().iterator();
- while (subMatchIterator.hasNext()) {
- matchQuantity++;
- subMatchIterator.next();
- }
- }
- LOGGER.info("compare() - FINISH - " + matchQuantity + " matches, " + diffQuantity + " diffs and " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + conflictQuantity + " conflicts found in " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
* Launches the conflict detection engine, if any has been given and if the comparison is three way.
*
* @param comparison
@@ -411,15 +325,7 @@ public class EMFCompare {
Iterator<IPostProcessor> processorsIterator = postProcessors.iterator();
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor iPostProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postMatch with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + START);
- }
iPostProcessor.postMatch(comparison, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postMatch with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + FINISH);
- }
}
}
@@ -438,15 +344,7 @@ public class EMFCompare {
Iterator<IPostProcessor> processorsIterator = postProcessors.iterator();
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor iPostProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postDiff with post-processor: " + iPostProcessor.getClass().getName() //$NON-NLS-1$
- + START);
- }
iPostProcessor.postDiff(comparison, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postDiff with post-processor: " + iPostProcessor.getClass().getName() //$NON-NLS-1$
- + FINISH);
- }
}
}
@@ -465,15 +363,7 @@ public class EMFCompare {
Iterator<IPostProcessor> processorsIterator = postProcessors.iterator();
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor iPostProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postRequirements with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + START);
- }
iPostProcessor.postRequirements(comparison, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postRequirements with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + FINISH);
- }
}
}
@@ -492,15 +382,7 @@ public class EMFCompare {
Iterator<IPostProcessor> processorsIterator = postProcessors.iterator();
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor iPostProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postEquivalences with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + START);
- }
iPostProcessor.postEquivalences(comparison, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postEquivalences with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + FINISH);
- }
}
}
@@ -519,15 +401,7 @@ public class EMFCompare {
Iterator<IPostProcessor> processorsIterator = postProcessors.iterator();
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor iPostProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postConflicts with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + START);
- }
iPostProcessor.postConflicts(comparison, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postConflicts with post-processor: " //$NON-NLS-1$
- + iPostProcessor.getClass().getName() + FINISH);
- }
}
}
@@ -547,19 +421,11 @@ public class EMFCompare {
int postProcessorIndex = 1;
while (!hasToStop(comparison, monitor) && processorsIterator.hasNext()) {
final IPostProcessor postProcessor = processorsIterator.next();
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postComparison with post-processor: " //$NON-NLS-1$
- + postProcessor.getClass().getName() + START);
- }
monitor.subTask(EMFCompareMessages.getString("PostComparison.monitor.postprocessor", //$NON-NLS-1$
postProcessor.getClass().getSimpleName(), String.valueOf(postProcessorIndex),
String.valueOf(postProcessors.size())));
postProcessor.postComparison(comparison, monitor);
postProcessorIndex++;
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("postComparison with post-processor: " //$NON-NLS-1$
- + postProcessor.getClass().getName() + FINISH);
- }
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
index 6430febc7..2ed2a52f9 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/DefaultConflictDetector.java
@@ -24,7 +24,6 @@ import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.CompareFactory;
@@ -69,9 +68,6 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*/
public class DefaultConflictDetector implements IConflictDetector {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DefaultConflictDetector.class);
-
/**
* {@inheritDoc}
*
@@ -79,10 +75,6 @@ public class DefaultConflictDetector implements IConflictDetector {
* org.eclipse.emf.common.util.Monitor)
*/
public void detect(Comparison comparison, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("detect conflicts - START"); //$NON-NLS-1$
- }
final List<Diff> differences = comparison.getDifferences();
final int diffCount = differences.size();
@@ -99,11 +91,6 @@ public class DefaultConflictDetector implements IConflictDetector {
Stream<Diff> conflictCandidates = differences.stream().filter(possiblyConflictingWith(diff));
checkConflict(comparison, diff, conflictCandidates::iterator);
}
-
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect conflicts - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
}
/**
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/MatchBasedConflictDetector.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/MatchBasedConflictDetector.java
index 2a03ffae9..f31e26f25 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/MatchBasedConflictDetector.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/conflict/MatchBasedConflictDetector.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.compare.conflict;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.ComparisonCanceledException;
@@ -38,9 +37,6 @@ import org.eclipse.emf.ecore.EObject;
*/
public class MatchBasedConflictDetector implements IConflictDetector {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(MatchBasedConflictDetector.class);
-
/**
* {@inheritDoc}
*
@@ -48,10 +44,6 @@ public class MatchBasedConflictDetector implements IConflictDetector {
* org.eclipse.emf.common.util.Monitor)
*/
public void detect(Comparison comparison, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("detect conflicts - START"); //$NON-NLS-1$
- }
final List<Diff> differences = comparison.getDifferences();
final int diffCount = differences.size();
@@ -68,10 +60,5 @@ public class MatchBasedConflictDetector implements IConflictDetector {
AbstractConflictSearch<? extends Diff> search = conflictSearchFactory.doSwitch(diff);
search.detectConflicts();
}
-
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect conflicts - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
index 1eb80abd8..a4b73aae8 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/DefaultDiffEngine.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.ComparisonCanceledException;
@@ -61,9 +60,6 @@ public class DefaultDiffEngine implements IDiffEngine {
*/
protected static final Object UNMATCHED_VALUE = new Object();
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DefaultDiffEngine.class);
-
/**
* The diff processor that will be used by this engine. Should be passed by the constructor and accessed
* by {@link #getDiffProcessor()}.
@@ -120,18 +116,10 @@ public class DefaultDiffEngine implements IDiffEngine {
* org.eclipse.emf.common.util.Monitor)
*/
public void diff(Comparison comparison, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(String.format("detect differences - START")); //$NON-NLS-1$
- }
monitor.subTask(EMFCompareMessages.getString("DefaultDiffEngine.monitor.diff")); //$NON-NLS-1$
for (Match rootMatch : comparison.getMatches()) {
checkForDifferences(rootMatch, monitor);
}
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect differences - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
}
/**
@@ -313,11 +301,17 @@ public class DefaultDiffEngine implements IDiffEngine {
List<Object> originValues = getAsList(match.getOrigin(), reference);
for (Object value : originValues) {
Match valueMatch = comparison.getMatch((EObject)value);
- if (valueMatch.getLeft() == null) {
- featureChange(match, reference, value, DifferenceKind.DELETE, DifferenceSource.LEFT);
- }
- if (valueMatch.getRight() == null) {
- featureChange(match, reference, value, DifferenceKind.DELETE, DifferenceSource.RIGHT);
+ if (valueMatch == null) {
+ // out of scope
+ } else {
+ if (valueMatch.getLeft() == null) {
+ featureChange(match, reference, value, DifferenceKind.DELETE,
+ DifferenceSource.LEFT);
+ }
+ if (valueMatch.getRight() == null) {
+ featureChange(match, reference, value, DifferenceKind.DELETE,
+ DifferenceSource.RIGHT);
+ }
}
}
} else {
@@ -325,8 +319,13 @@ public class DefaultDiffEngine implements IDiffEngine {
for (Object value : rightValues) {
Match valueMatch = comparison.getMatch((EObject)value);
- if (valueMatch.getLeft() == null) {
- featureChange(match, reference, value, DifferenceKind.DELETE, DifferenceSource.LEFT);
+ if (valueMatch == null) {
+ // out of scope
+ } else {
+ if (valueMatch.getLeft() == null) {
+ featureChange(match, reference, value, DifferenceKind.DELETE,
+ DifferenceSource.LEFT);
+ }
}
}
}
@@ -463,22 +462,26 @@ public class DefaultDiffEngine implements IDiffEngine {
EObject sideValue = (EObject)sideValues.get(currentSide++);
Match candidateMatch = comparison.getMatch(sideValue);
- EObject originValue;
- if (comparison.isThreeWay()) {
- originValue = candidateMatch.getOrigin();
+ if (candidateMatch == null) {
+ // out of scope
} else {
- originValue = candidateMatch.getRight();
- }
+ EObject originValue;
+ if (comparison.isThreeWay()) {
+ originValue = candidateMatch.getOrigin();
+ } else {
+ originValue = candidateMatch.getRight();
+ }
- if (matchingContainment(equalityHelper, sideValue, originValue)) {
- // Object present in both sides, in the same container and same containment feature.
- // We don't care about ordering so there is no change here.
- } else {
- // Object has either changed container or isn't present in the origin
- if (originValue != null) {
- featureChange(match, reference, sideValue, DifferenceKind.MOVE, side);
+ if (matchingContainment(equalityHelper, sideValue, originValue)) {
+ // Object present in both sides, in the same container and same containment feature.
+ // We don't care about ordering so there is no change here.
} else {
- featureChange(match, reference, sideValue, DifferenceKind.ADD, side);
+ // Object has either changed container or isn't present in the origin
+ if (originValue != null) {
+ featureChange(match, reference, sideValue, DifferenceKind.MOVE, side);
+ } else {
+ featureChange(match, reference, sideValue, DifferenceKind.ADD, side);
+ }
}
}
}
@@ -1172,8 +1175,13 @@ public class DefaultDiffEngine implements IDiffEngine {
if (isFeatureMapMove(comparison, feature, diffCandidate, values, source)) {
final Object entryValue = ((FeatureMap.Entry)diffCandidate).getValue();
if (entryValue instanceof EObject) {
- final EObject leftObject = comparison.getMatch((EObject)entryValue).getLeft();
- return !ComparisonUtil.isContainedInFeatureMap(leftObject);
+ Match match = comparison.getMatch((EObject)entryValue);
+ if (match == null) {
+ // out of scope
+ } else {
+ final EObject leftObject = match.getLeft();
+ return !ComparisonUtil.isContainedInFeatureMap(leftObject);
+ }
}
}
return false;
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
index e1830ae5d..89abd8c2b 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/diff/FeatureFilter.java
@@ -150,7 +150,7 @@ public class FeatureFilter {
final boolean toIgnore;
if (reference != null) {
// ignore the derived, container or transient
- if (!reference.isDerived() && !reference.isContainer() && !reference.isTransient()) {
+ if (!reference.isDerived() && !reference.isContainer() && !isTransient(reference)) {
/*
* EGenericTypes are usually "mutually derived" references that are handled through specific
* means in ecore (eGenericSuperTypes and eSuperTypes, EGenericType and eType...). As these
@@ -185,6 +185,10 @@ public class FeatureFilter {
* @return {@code true} if that attribute should be ignored by the comparison engine.
*/
protected boolean isIgnoredAttribute(EAttribute attribute) {
- return attribute == null || attribute.isDerived() || attribute.isTransient();
+ return attribute == null || attribute.isDerived() || isTransient(attribute);
+ }
+
+ protected boolean isTransient(EStructuralFeature feature) {
+ return feature.isTransient();
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
index 87ac0b681..d880940e8 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/equi/DefaultEquiEngine.java
@@ -15,7 +15,6 @@ import java.util.LinkedHashSet;
import java.util.Set;
import java.util.function.Predicate;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.CompareFactory;
import org.eclipse.emf.compare.Comparison;
@@ -46,9 +45,6 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*/
public class DefaultEquiEngine implements IEquiEngine {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DefaultEquiEngine.class);
-
/**
* {@inheritDoc}
*
@@ -56,10 +52,6 @@ public class DefaultEquiEngine implements IEquiEngine {
* org.eclipse.emf.common.util.Monitor)
*/
public void computeEquivalences(Comparison comparison, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(String.format("detect equivalences - START")); //$NON-NLS-1$
- }
monitor.subTask(EMFCompareMessages.getString("DefaultEquiEngine.monitor.eq")); //$NON-NLS-1$
for (Diff difference : comparison.getDifferences()) {
if (monitor.isCanceled()) {
@@ -67,10 +59,6 @@ public class DefaultEquiEngine implements IEquiEngine {
}
checkForEquivalences(comparison, difference);
}
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect equivalences - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
}
/**
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
index 65f660d78..29c78dd5d 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultMatchEngine.java
@@ -21,7 +21,6 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.common.util.URI;
@@ -63,9 +62,6 @@ public class DefaultMatchEngine implements IMatchEngine {
*/
public static final int DEFAULT_EOBJECT_URI_CACHE_MAX_SIZE = 1024;
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DefaultMatchEngine.class);
-
/** The delegate {@link IEObjectMatcher matcher} that will actually pair EObjects together. */
private final IEObjectMatcher eObjectMatcher;
@@ -113,10 +109,6 @@ public class DefaultMatchEngine implements IMatchEngine {
* org.eclipse.emf.common.util.Monitor)
*/
public Comparison match(IComparisonScope scope, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(String.format("detect matches - START")); //$NON-NLS-1$
- }
Comparison comparison = comparisonFactory.createComparison();
final Notifier left = scope.getLeft();
@@ -127,10 +119,6 @@ public class DefaultMatchEngine implements IMatchEngine {
match(comparison, scope, left, right, origin, monitor);
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect matches - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
return comparison;
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AbstractMerger.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AbstractMerger.java
index 42914a8f4..9f7ffc37c 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AbstractMerger.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/AbstractMerger.java
@@ -45,7 +45,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
@@ -80,9 +79,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
/** The key of the merge option that allows to the mergers to consider sub-diffs of a diff as a whole. */
public static final String SUB_DIFF_AWARE_OPTION = "subDiffAwareOption"; //$NON-NLS-1$
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(AbstractMerger.class);
-
/** A predicate for diffs with an unresolved state. */
private static final Predicate<? super Diff> HAS_UNRESOLVED_STATE = EMFComparePredicates
.hasState(UNRESOLVED);
@@ -206,8 +202,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
* @since 3.2
*/
public Set<Diff> getDirectMergeDependencies(Diff diff, boolean mergeRightToLeft) {
- long start = System.currentTimeMillis();
-
final Set<Diff> dependencies = new LazyLinkedHashSet<Diff>();
if (isAccepting(diff, mergeRightToLeft)) {
dependencies.addAll(diff.getRequires());
@@ -224,14 +218,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
}
}
- if (LOGGER.isDebugEnabled()) {
- Long duration = new Long(System.currentTimeMillis() - start);
- String log = String.format(
- "getDirectMergeDependencies(Diff, boolean) - %d dependencies found in %d ms for diff %d", //$NON-NLS-1$
- new Integer(dependencies.size()), duration, new Integer(diff.hashCode()));
- LOGGER.debug(log);
- }
-
return dependencies;
}
@@ -241,20 +227,10 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
* @since 3.2
*/
public Set<Diff> getDirectResultingMerges(Diff target, boolean mergeRightToLeft) {
- long start = System.currentTimeMillis();
-
final Set<Diff> resulting = new LazyLinkedHashSet<Diff>();
resulting.addAll(getImpliedMerges(target, mergeRightToLeft));
resulting.addAll(getLogicallyResultingMerges(target, mergeRightToLeft));
- if (LOGGER.isDebugEnabled()) {
- Long duration = new Long(System.currentTimeMillis() - start);
- String log = String.format(
- "getDirectResultingMerges(Diff, boolean) - %d resulting merges found in %d ms for diff %d", //$NON-NLS-1$
- new Integer(resulting.size()), duration, new Integer(target.hashCode()));
- LOGGER.debug(log);
- }
-
return resulting;
}
@@ -358,8 +334,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
* @since 3.2
*/
public Set<Diff> getDirectResultingRejections(Diff target, boolean rightToLeft) {
- long start = System.currentTimeMillis();
-
final Set<Diff> directlyImpliedRejections = new LazyLinkedHashSet<Diff>();
final Conflict conflict = target.getConflict();
if (conflict != null && conflict.getKind() == ConflictKind.REAL) {
@@ -369,14 +343,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
}
}
- if (LOGGER.isDebugEnabled()) {
- Long duration = new Long(System.currentTimeMillis() - start);
- String log = String.format(
- "getDirectResultingMerges(Diff, boolean) - %d implied rejections found in %d ms for diff %d", //$NON-NLS-1$
- new Integer(directlyImpliedRejections.size()), duration, new Integer(target.hashCode()));
- LOGGER.debug(log);
- }
-
return directlyImpliedRejections;
}
@@ -649,8 +615,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
* @since 3.5
*/
protected Set<Diff> getLogicallyResultingMerges(Diff diff, boolean mergeRightToLeft) {
- long start = System.currentTimeMillis();
-
final Set<Diff> resulting = new LazyLinkedHashSet<Diff>();
// we need to add the implication side that actually needs merging
@@ -670,14 +634,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
Iterables.addAll(resulting, directSubDiffs);
}
- if (LOGGER.isDebugEnabled()) {
- Long duration = new Long(System.currentTimeMillis() - start);
- String log = String.format(
- "getLogicallyResultingMerges(Diff, boolean) - %d merges found in %d ms for diff %d", //$NON-NLS-1$
- new Integer(resulting.size()), duration, new Integer(diff.hashCode()));
- LOGGER.debug(log);
- }
-
return resulting;
}
@@ -695,7 +651,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
* @since 3.5
*/
protected Set<Diff> getImpliedMerges(Diff target, boolean mergeRightToLeft) {
- long start = System.currentTimeMillis();
final Set<Diff> impliedMerges = new LazyLinkedHashSet<Diff>();
if (isAccepting(target, mergeRightToLeft)) {
@@ -744,13 +699,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
}
}
- if (LOGGER.isDebugEnabled()) {
- Long duration = new Long(System.currentTimeMillis() - start);
- String log = String.format(
- "getImpliedMerges(Diff, boolean) - %d implied merges found in %d ms for diff %d", //$NON-NLS-1$
- new Integer(impliedMerges.size()), duration, new Integer(target.hashCode()));
- LOGGER.debug(log);
- }
return impliedMerges;
}
@@ -771,8 +719,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
return;
}
- long start = System.currentTimeMillis();
-
// Change the diff's state before we actually merge it : this allows us to avoid requirement cycles.
target.setState(MERGING);
@@ -799,13 +745,6 @@ public abstract class AbstractMerger implements IMerger2, IMergeOptionAware, IMe
reject(target, rightToLeft);
target.setState(DISCARDED);
}
-
- if (LOGGER.isDebugEnabled()) {
- long duration = System.currentTimeMillis() - start;
- LOGGER.debug("copyDiff(Diff, Monitor, Boolean) - diff " + target.hashCode() //$NON-NLS-1$
- + " merged (rightToLeft: " + rightToLeft + ") in " //$NON-NLS-1$ //$NON-NLS-2$
- + duration + "ms"); //$NON-NLS-1$
- }
}
/**
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/BatchMerger.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/BatchMerger.java
index cde9540b5..81fd3bf5e 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/BatchMerger.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/BatchMerger.java
@@ -16,7 +16,6 @@ import static com.google.common.base.Predicates.alwaysTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Diff;
@@ -29,9 +28,6 @@ import org.eclipse.emf.compare.Diff;
*/
public class BatchMerger implements IBatchMerger {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(BatchMerger.class);
-
/** The registry from which we'll retrieve our mergers. */
private final IMerger.Registry2 registry;
@@ -134,26 +130,13 @@ public class BatchMerger implements IBatchMerger {
* org.eclipse.emf.common.util.Monitor)
*/
public void copyAllLeftToRight(Iterable<? extends Diff> differences, Monitor monitor) {
- long start = 0;
- if (LOGGER.isDebugEnabled()) {
- start = System.currentTimeMillis();
- LOGGER.debug("copyAllLeftToRight(differences, monitor) - Start"); //$NON-NLS-1$
- }
ComputeDiffsToMerge computer = new ComputeDiffsToMerge(false, relationshipComputer);
for (Diff toMerge : computer.getAllDiffsToMerge(Iterables.filter(differences, filter))) {
if (!AbstractMerger.isInTerminalState(toMerge)) {
final IMerger merger = registry.getHighestRankingMerger(toMerge);
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("copyAllLeftToRight - Selected merger: " //$NON-NLS-1$
- + merger.getClass().getSimpleName());
- }
merger.copyLeftToRight(toMerge, monitor);
}
}
- if (LOGGER.isDebugEnabled()) {
- long duration = System.currentTimeMillis() - start;
- LOGGER.debug("copyAllLeftToRight(differences, monitor) - Stop - Time spent: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
/**
@@ -163,25 +146,12 @@ public class BatchMerger implements IBatchMerger {
* org.eclipse.emf.common.util.Monitor)
*/
public void copyAllRightToLeft(Iterable<? extends Diff> differences, Monitor monitor) {
- long start = 0;
- if (LOGGER.isDebugEnabled()) {
- start = System.currentTimeMillis();
- LOGGER.debug("copyAllRightToLeft(differences, monitor) - Start"); //$NON-NLS-1$
- }
ComputeDiffsToMerge computer = new ComputeDiffsToMerge(true, relationshipComputer);
for (Diff toMerge : computer.getAllDiffsToMerge(Iterables.filter(differences, filter))) {
if (!AbstractMerger.isInTerminalState(toMerge)) {
final IMerger merger = registry.getHighestRankingMerger(toMerge);
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("copyAllLeftToRight - Selected merger: " //$NON-NLS-1$
- + merger.getClass().getSimpleName());
- }
merger.copyRightToLeft(toMerge, monitor);
}
}
- if (LOGGER.isDebugEnabled()) {
- long duration = System.currentTimeMillis() - start;
- LOGGER.debug("copyAllRightToLeft(differences, monitor) - Stop - Time spent: " + duration + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/ResourceAttachmentChangeMerger.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/ResourceAttachmentChangeMerger.java
index 9984bfafe..ba7a925fd 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/ResourceAttachmentChangeMerger.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/merge/ResourceAttachmentChangeMerger.java
@@ -17,7 +17,7 @@ import static org.eclipse.emf.compare.merge.IMergeCriterion.NONE;
import java.util.Collections;
import java.util.List;
-import org.apache.log4j.Logger;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
@@ -27,10 +27,12 @@ import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.MatchResource;
import org.eclipse.emf.compare.ResourceAttachmentChange;
import org.eclipse.emf.compare.internal.utils.DiffUtil;
+import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMIResource;
/**
@@ -39,8 +41,6 @@ import org.eclipse.emf.ecore.xmi.XMIResource;
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
public class ResourceAttachmentChangeMerger extends AbstractMerger {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(ResourceAttachmentChangeMerger.class);
/**
* {@inheritDoc}
@@ -354,15 +354,32 @@ public class ResourceAttachmentChangeMerger extends AbstractMerger {
+ sourceRes.getURI());
}
- final List<MatchResource> matchedResources = comparison.getMatchedResources();
- final int size = matchedResources.size();
ResourceSet targetSet = null;
- for (int i = 0; i < size && targetSet == null; i++) {
- final MatchResource matchRes = matchedResources.get(i);
- if (rightToLeft && matchRes.getLeft() != null) {
- targetSet = matchRes.getLeft().getResourceSet();
- } else if (!rightToLeft && matchRes.getRight() != null) {
- targetSet = matchRes.getRight().getResourceSet();
+ IComparisonScope scope = (IComparisonScope)EcoreUtil.getAdapter(comparison.eAdapters(),
+ IComparisonScope.class);
+ if (rightToLeft) {
+ Notifier left = scope.getLeft();
+ if (left instanceof ResourceSet) {
+ targetSet = (ResourceSet)left;
+ } else if (left instanceof Resource) {
+ targetSet = ((Resource)left).getResourceSet();
+ } else if (left instanceof EObject) {
+ Resource res = ((EObject)left).eResource();
+ if (res != null) {
+ targetSet = res.getResourceSet();
+ }
+ }
+ } else {
+ Notifier right = scope.getRight();
+ if (right instanceof ResourceSet) {
+ targetSet = (ResourceSet)right;
+ } else if (right instanceof Resource) {
+ targetSet = ((Resource)right).getResourceSet();
+ } else if (right instanceof EObject) {
+ Resource res = ((EObject)right).eResource();
+ if (res != null) {
+ targetSet = res.getResourceSet();
+ }
}
}
@@ -386,9 +403,6 @@ public class ResourceAttachmentChangeMerger extends AbstractMerger {
} else {
target = existing;
}
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info("Created resource " + targetURI); //$NON-NLS-1$
- }
if (rightToLeft) {
soughtMatch.setLeft(target);
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
index 236a5b712..ca25e5339 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/req/DefaultReqEngine.java
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Stream;
-import org.apache.log4j.Logger;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Monitor;
@@ -69,9 +68,6 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*/
public class DefaultReqEngine implements IReqEngine {
- /** The logger. */
- private static final Logger LOGGER = Logger.getLogger(DefaultReqEngine.class);
-
/** The time before we expire the values in {@link #cachedDifferences} after access, in seconds. */
private static final long CACHE_EXPIRATION_TIME = 30L;
@@ -94,10 +90,6 @@ public class DefaultReqEngine implements IReqEngine {
* @see org.eclipse.emf.compare.req.IReqEngine#computeRequirements(Comparison, Monitor)
*/
public void computeRequirements(Comparison comparison, Monitor monitor) {
- long start = System.currentTimeMillis();
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(String.format("detect requirements - START")); //$NON-NLS-1$
- }
monitor.subTask(EMFCompareMessages.getString("DefaultReqEngine.monitor.req")); //$NON-NLS-1$
for (Diff difference : comparison.getDifferences()) {
if (monitor.isCanceled()) {
@@ -105,10 +97,6 @@ public class DefaultReqEngine implements IReqEngine {
}
checkForRequiredDifferences(comparison, difference);
}
- if (LOGGER.isInfoEnabled()) {
- LOGGER.info(String.format("detect requirement - END - Took %d ms", Long.valueOf(System //$NON-NLS-1$
- .currentTimeMillis() - start)));
- }
}
/**
diff --git a/releng/org.eclipse.emf.compare.releng/.project b/releng/org.eclipse.emf.compare.releng/.project
new file mode 100644
index 000000000..04d241b6e
--- /dev/null
+++ b/releng/org.eclipse.emf.compare.releng/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.releng</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.emf.compare.releng/publish-milestone.sh b/releng/org.eclipse.emf.compare.releng/publish-milestone.sh
new file mode 100644
index 000000000..9daf16112
--- /dev/null
+++ b/releng/org.eclipse.emf.compare.releng/publish-milestone.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+# ====================================================================
+# Copyright (c) 2021 Obeo
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0
+#
+# Contributors:
+# Obeo - initial API and implementation
+# ====================================================================
+
+# Exit on error
+set -e
+
+# The SSH account to use
+export SSH_ACCOUNT="genie.emfcompare@projects-storage.eclipse.org"
+
+NIGHTLIES_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/nightly"
+MILESTONES_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/milestones"
+DROPS_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/downloads/drops"
+ZIP_PREFIX="emf-compare-update-"
+GROUP="modeling.emfcompare"
+
+if [[ ! ${QUALIFIER} =~ ^[0-9]\.[0-9]\.[0-9]+\.[0-9]{12}$ ]]
+then
+ echo "$QUALIFIER doesn't match the expect format x.x.x.yyyyMMddhhmm"
+ exit 1
+fi
+
+if ssh ${SSH_ACCOUNT} "[ ! -d ${NIGHTLIES_FOLDER}/${QUALIFIER} ]"
+then
+ echo "couldn't find build with qualifier $QUALIFIER in the promoted nightlies"
+ exit 1
+fi
+
+echo "promoting build $QUALIFIER as milestone $ALIAS"
+
+IFS=. read MAJOR MINOR MICRO TIMESTAMP <<<"${QUALIFIER}"
+
+VERSION_SHORT=${MAJOR}.${MINOR}
+VERSION=${MAJOR}.${MINOR}.${MICRO}
+
+UPDATE_ROOT_COMPOSITE=false
+if ssh ${SSH_ACCOUNT} "[ ! -d ${MILESTONES_FOLDER}/${VERSION_SHORT} ]"
+then
+ UPDATE_ROOT_COMPOSITE=true
+fi
+
+ssh ${SSH_ACCOUNT} << EOSSH
+ if ${UPDATE_ROOT_COMPOSITE}
+ then
+ mkdir -p ${MILESTONES_FOLDER}/${VERSION_SHORT}
+ chgrp ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}
+ fi
+
+ ## copy the nightly to its "milestones" location
+ cp -r ${NIGHTLIES_FOLDER}/${QUALIFIER} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
+ chgrp -R ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
+
+ ## Create a compressed archive of this repository and place it in the drops folder
+ if [ ! -d ${DROPS_FOLDER}/${VERSION} ]
+ then
+ mkdir -p ${DROPS_FOLDER}/${VERSION}
+ chgrp ${GROUP} ${DROPS_FOLDER}/${VERSION}
+ fi
+
+ mkdir -p ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}
+ pushd ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
+ zip -2 -r ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip *
+ popd
+ md5sum ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip > ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip.md5
+ chgrp -R ${GROUP} ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}
+
+ ## Create the p2.index file for this milestone
+cat <<EOF >${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}/p2.index
+version = 1
+metadata.repository.factory.order = compositeContent.xml,\!
+artifact.repository.factory.order = compositeArtifacts.xml,\!
+EOF
+ chgrp -R ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}/p2.index
+EOSSH
+
+## Update the composite update site with this new child
+
+#cd ${MILESTONES_FOLDER}/${VERSION_SHORT}
+#/shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=S${TIMESTAMP}
+
+#if [ "$UPDATE_ROOT_COMPOSITE" = true ]
+#then
+# cd ${MILESTONES_FOLDER}
+# /shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=${VERSION_SHORT}
+#fi \ No newline at end of file
diff --git a/releng/org.eclipse.emf.compare.releng/publish-nightly.sh b/releng/org.eclipse.emf.compare.releng/publish-nightly.sh
new file mode 100644
index 000000000..ee5137c92
--- /dev/null
+++ b/releng/org.eclipse.emf.compare.releng/publish-nightly.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+# ====================================================================
+# Copyright (c) 2021 Obeo
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0
+#
+# Contributors:
+# Obeo - initial API and implementation
+# ====================================================================
+
+if [ ${REFERENCE_TARGET_PLATFORM} != ${PLATFORM} ]; then
+ exit 0
+fi
+
+# Exit on error
+set -e
+
+# The SSH account to use
+export SSH_ACCOUNT="genie.emfcompare@projects-storage.eclipse.org"
+
+NIGHTLIES_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/nightly"
+GROUP="modeling.emfcompare"
+
+CORE_UPDATE_FOLDER=${WORKSPACE}/packaging/org.eclipse.emf.compare.update/target
+EXTRAS_UPDATE_FOLDER=${WORKSPACE}/packaging/org.eclipse.emf.compare.update.extras/target
+
+CORE_UPDATE_ZIP="$(ls ${CORE_UPDATE_FOLDER}/org.eclipse.emf.compare-*.zip | sort -V | tail -n1)"
+EXTRAS_UPDATE_ZIP="$(ls ${EXTRAS_UPDATE_FOLDER}/org.eclipse.emf.compare.extras-*.zip | sort -V | tail -n1)"
+
+CORE_ZIP_NAME=$(echo ${CORE_UPDATE_ZIP} | sed 's/.*\(org.eclipse.emf.compare-.*.zip\)$/\1/')
+EXTRAS_ZIP_NAME=$(echo ${EXTRAS_UPDATE_ZIP} | sed 's/.*\(org.eclipse.emf.compare.extras-.*.zip\)$/\1/')
+QUALIFIER=$(echo ${CORE_UPDATE_ZIP} | sed 's/.*org.eclipse.emf.compare-\(.*\).zip$/\1/')
+
+P2_TIMESTAMP=$(date +"%s000")
+
+ssh "${SSH_ACCOUNT}" mkdir -p ${NIGHTLIES_FOLDER}/${QUALIFIER}
+scp -rp ${CORE_UPDATE_ZIP} ${EXTRAS_UPDATE_ZIP} "${SSH_ACCOUNT}:${NIGHTLIES_FOLDER}/${QUALIFIER}"
+
+# make a composite with both "core" and "extras" features
+cat > compositeArtifacts.xml <<EOF
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='Eclipse EMF Compare ${QUALIFIER}' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+ <properties size='1'>
+ <property name='p2.timestamp' value='${P2_TIMESTAMP}'/>
+ </properties>
+ <children size='2'>
+ <child location='core'/>
+ <child location='extras'/>
+ </children>
+</repository>
+EOF
+cat > compositeContent.xml <<EOF
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='Eclipse EMF Compare ${QUALIFIER}' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+ <properties size='1'>
+ <property name='p2.timestamp' value='${P2_TIMESTAMP}'/>
+ </properties>
+ <children size='2'>
+ <child location='core'/>
+ <child location='extras'/>
+ </children>
+</repository>
+EOF
+
+# push this composite to the download area as well
+scp -rp compositeArtifacts.xml compositeContent.xml "${SSH_ACCOUNT}:${NIGHTLIES_FOLDER}/${QUALIFIER}"
+
+ssh "${SSH_ACCOUNT}" -T <<EOF
+ pushd ${NIGHTLIES_FOLDER}/${QUALIFIER}
+ unzip "${CORE_ZIP_NAME}" -d core/
+ unzip "${EXTRAS_ZIP_NAME}" -d extras/
+ rm ${CORE_ZIP_NAME}
+ rm ${EXTRAS_ZIP_NAME}
+ popd
+
+ # make sure permissions are update for the emfcompare group
+ chgrp -R ${GROUP} ${NIGHTLIES_FOLDER}/${QUALIFIER}
+ chmod -R g+w ${NIGHTLIES_FOLDER}/${QUALIFIER}
+
+ pushd ${NIGHTLIES_FOLDER}/latest
+ rm -r *
+ cp -r ../${QUALIFIER}/* .
+ popd
+EOF
diff --git a/releng/org.eclipse.emf.compare.releng/publish-release.sh b/releng/org.eclipse.emf.compare.releng/publish-release.sh
new file mode 100644
index 000000000..bd57cb63f
--- /dev/null
+++ b/releng/org.eclipse.emf.compare.releng/publish-release.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+# ====================================================================
+# Copyright (c) 2021 Obeo
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0
+#
+# Contributors:
+# Obeo - initial API and implementation
+# ====================================================================
+
+# Exit on error
+set -e
+
+# The SSH account to use
+export SSH_ACCOUNT="genie.emfcompare@projects-storage.eclipse.org"
+
+PROJECT_NAME="EMF Compare"
+MILESTONES_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/milestones"
+RELEASES_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/releases"
+DROPS_FOLDER="/home/data/httpd/download.eclipse.org/modeling/emf/compare/downloads/drops"
+ZIP_PREFIX="emf-compare-update-"
+GROUP="modeling.emfcompare"
+
+if [[ ! ${QUALIFIER} =~ ^[0-9]\.[0-9]\.[0-9]+\.[0-9]{12}$ ]]
+then
+ echo "$QUALIFIER doesn't match the expected format x.x.x.yyyyMMddhhmm"
+ exit 1
+fi
+
+IFS=. read MAJOR MINOR MICRO TIMESTAMP <<<"${QUALIFIER}"
+
+VERSION_SHORT=${MAJOR}.${MINOR}
+VERSION=${MAJOR}.${MINOR}.${MICRO}
+
+if ssh ${SSH_ACCOUNT} "[ ! -d ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP} ]"
+then
+ echo "couldn't find build with qualifier $QUALIFIER in the promoted milestones"
+ exit 1
+fi
+
+echo "promoting milestone S${TIMESTAMP} as release ${VERSION}"
+
+ssh ${SSH_ACCOUNT} << EOSSH
+ ## copy the drops
+
+ cp -r ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP} ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}
+ mv ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}/${ZIP_PREFIX}*.zip ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}/${ZIP_PREFIX}${VERSION}.zip
+ rm ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}/${ZIP_PREFIX}*.zip.md5
+ md5sum ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}/${ZIP_PREFIX}${VERSION}.zip > ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}/${ZIP_PREFIX}${VERSION}.zip.md5
+ chgrp -R ${GROUP} ${DROPS_FOLDER}/${VERSION}/R${TIMESTAMP}
+
+ ## copy the update site
+
+ UPDATE_ROOT_COMPOSITE=false
+ if [ ! -d ${RELEASES_FOLDER}/${VERSION_SHORT} ]
+ then
+ mkdir -p ${RELEASES_FOLDER}/${VERSION_SHORT}
+ chgrp -R ${GROUP} ${RELEASES_FOLDER}/${VERSION_SHORT}
+ UPDATE_ROOT_COMPOSITE=true
+ fi
+ cp -r ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP} ${RELEASES_FOLDER}/${VERSION_SHORT}/R${TIMESTAMP}
+ chgrp -R ${GROUP} ${RELEASES_FOLDER}/${VERSION_SHORT}/R${TIMESTAMP}
+
+ ## update the releases composite
+
+ #cd ${RELEASES_FOLDER}/${VERSION_SHORT}
+ #/shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=R${TIMESTAMP} -Dcomposite.name="${PROJECT_NAME} ${VERSION_SHORT} releases"
+
+ #if [ "$UPDATE_ROOT_COMPOSITE" = true ]
+ #then
+ #cd ${RELEASES_FOLDER}
+ #/shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=${VERSION_SHORT} -Dcomposite.name="${PROJECT_NAME} releases"
+ #fi
+
+ ## update the "latest" update site
+
+ rm -r ${RELEASES_FOLDER}/latest/*
+ cp -r ${RELEASES_FOLDER}/${VERSION_SHORT}/R${TIMESTAMP}/* ${RELEASES_FOLDER}/latest/
+EOSSH \ No newline at end of file

Back to the top