Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2019-09-10 08:49:15 -0400
committerlgoubet2019-09-10 08:49:42 -0400
commit96a6bb8fa47c7d27867279103eb411b5cfff27e2 (patch)
tree6492ec215b93a2f3cb6d93751961619ec6811f78
parent411886e2e5e83f9a359229214a4ca48c54163dfe (diff)
downloadorg.eclipse.emf.compare-96a6bb8fa47c7d27867279103eb411b5cfff27e2.tar.gz
org.eclipse.emf.compare-96a6bb8fa47c7d27867279103eb411b5cfff27e2.tar.xz
org.eclipse.emf.compare-96a6bb8fa47c7d27867279103eb411b5cfff27e2.zip
Behavior change in 2019-06 - Exceptions are now in the diagnostic
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/SynchronizationModel.java61
1 files changed, 31 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/SynchronizationModel.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/SynchronizationModel.java
index b55025ccb..457e8b398 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/SynchronizationModel.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/SynchronizationModel.java
@@ -326,37 +326,38 @@ public final class SynchronizationModel implements IDiagnosable {
if (diagnosticData.isEmpty()) {
continue;
}
- // source of problem
- Object object = diagnosticData.get(0);
-
- if (object instanceof ResourceStatus) {
- ResourceStatus status = (ResourceStatus)object;
- final IPath resourceIPath = status.getPath();
- if (containsResourceWithPath(resourceIPath)) {
- d.merge(child);
- }
- } else if (object instanceof Resource.Diagnostic) {
- Resource.Diagnostic resourceDiagnostic = (Resource.Diagnostic)object;
- String location = resourceDiagnostic.getLocation();
- URI locationUri = URI.createURI(location, false);
- String fullPath = null;
- if (locationUri.isPlatform()) {
- fullPath = locationUri.toPlatformString(true);
+ // Try and find the problem's source
+ for (Object potentialSource : diagnosticData) {
+ if (potentialSource instanceof ResourceStatus) {
+ ResourceStatus status = (ResourceStatus)potentialSource;
+ final IPath resourceIPath = status.getPath();
+ if (containsResourceWithPath(resourceIPath)) {
+ d.merge(child);
+ }
+ } else if (potentialSource instanceof Resource.Diagnostic) {
+ Resource.Diagnostic resourceDiagnostic = (Resource.Diagnostic)potentialSource;
+ String location = resourceDiagnostic.getLocation();
+ URI locationUri = URI.createURI(location, false);
+ String fullPath = null;
+ if (locationUri.isPlatform()) {
+ fullPath = locationUri.toPlatformString(true);
+ } else {
+ fullPath = locationUri.toString();
+ }
+ if (fullPath == null) {
+ continue;
+ }
+ final Path path = new Path(fullPath);
+ if (containsResourceWithPath(path)) {
+ d.merge(child);
+ }
} else {
- fullPath = locationUri.toString();
- }
- if (fullPath == null) {
- continue;
- }
- final Path path = new Path(fullPath);
- if (containsResourceWithPath(path)) {
- d.merge(child);
- }
- } else {
- // best guess - if the source of the problem is one of the resources, we are interested in
- // the diagnostic
- if (syncModel.getResources().contains(object)) {
- d.merge(child);
+ // best guess - if the source of the problem is one of the resources, we are
+ // interested in
+ // the diagnostic
+ if (syncModel.getResources().contains(potentialSource)) {
+ d.merge(child);
+ }
}
}
}

Back to the top