Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaƫl Barbero2013-11-05 07:38:52 -0500
committerGerrit Code Review @ Eclipse.org2013-11-12 04:41:39 -0500
commit665acb288c8e1cec33281c1add4a7bdb6eaa8ab6 (patch)
tree4c5ed798f7e8fe4c449f647bdf07f423cd441c7a /plugins/org.eclipse.emf.compare.ide.ui/src
parent9778b83ddd83cea68783bb20d804b5540e38329b (diff)
downloadorg.eclipse.emf.compare-665acb288c8e1cec33281c1add4a7bdb6eaa8ab6.tar.gz
org.eclipse.emf.compare-665acb288c8e1cec33281c1add4a7bdb6eaa8ab6.tar.xz
org.eclipse.emf.compare-665acb288c8e1cec33281c1add4a7bdb6eaa8ab6.zip
[417360] Fix NPE when comparison is not between ResourceSets
Diffstat (limited to 'plugins/org.eclipse.emf.compare.ide.ui/src')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewerContentProvider.java12
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java12
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewerContentProvider.java12
3 files changed, 24 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewerContentProvider.java
index 666222cf6..b778c859e 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/table/TableContentMergeViewerContentProvider.java
@@ -140,8 +140,10 @@ public class TableContentMergeViewerContentProvider implements IMergeViewerConte
Resource eResource = leftEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}
@@ -194,8 +196,10 @@ public class TableContentMergeViewerContentProvider implements IMergeViewerConte
Resource eResource = rightEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java
index ec046e752..50d651e2f 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java
@@ -140,8 +140,10 @@ public class EMFCompareTextMergeViewerContentProvider implements IMergeViewerCon
Resource eResource = leftEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}
@@ -194,8 +196,10 @@ public class EMFCompareTextMergeViewerContentProvider implements IMergeViewerCon
Resource eResource = rightEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewerContentProvider.java
index 0f41dc702..c715901fc 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewerContentProvider.java
@@ -177,8 +177,10 @@ public class TreeContentMergeViewerContentProvider implements IMergeViewerConten
Resource eResource = leftEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}
@@ -240,8 +242,10 @@ public class TreeContentMergeViewerContentProvider implements IMergeViewerConten
Resource eResource = rightEObject.eResource();
if (eResource != null) {
ResourceSet resourceSet = eResource.getResourceSet();
- saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ if (resourceSet != null) {
+ saveAllResources(resourceSet, ImmutableMap.of(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
+ Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER));
+ }
}
}
}

Back to the top