Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-05-18 19:31:23 -0400
committeratikhomirov2007-05-18 19:31:23 -0400
commit0ac61326cf11e0a9a2a990b88a858483e23cb379 (patch)
tree644af5ec1e6ee1e15985d0f38e80be5974f03efe
parent1d60d6ae03f7da77a867893084b3076207b30a7b (diff)
downloadorg.eclipse.gmf-tooling-0ac61326cf11e0a9a2a990b88a858483e23cb379.tar.gz
org.eclipse.gmf-tooling-0ac61326cf11e0a9a2a990b88a858483e23cb379.tar.xz
org.eclipse.gmf-tooling-0ac61326cf11e0a9a2a990b88a858483e23cb379.zip
warning is good as well
-rw-r--r--plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/migrate/ModelLoadHelper.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/migrate/ModelLoadHelper.java b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/migrate/ModelLoadHelper.java
index fb6a3618e..405e7ced7 100644
--- a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/migrate/ModelLoadHelper.java
+++ b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/migrate/ModelLoadHelper.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
/**
* This class is helper for loading model from resource, handles load exceptions, result status
* aggregation and safe root object access.
+ * XXX [artem] this class is needs a rewrite. Check MigrationPatchesTest#assertOnLoadModelMigrationSuccess
*/
public class ModelLoadHelper {
private static final String DIAGNOSTIC_SOURCE = "gmf.common.modelLoadHelper"; //$NON-NLS-1$
@@ -58,7 +59,7 @@ public class ModelLoadHelper {
}
public boolean isOK() {
- return diagnostic.getSeverity() == Diagnostic.OK;
+ return diagnostic.getSeverity() == Diagnostic.OK || diagnostic.getSeverity() == Diagnostic.WARNING;
}
/**
@@ -145,11 +146,9 @@ public class ModelLoadHelper {
EcorePlugin.INSTANCE.getPluginLogger().log(e);
resource.getErrors().add(ModelLoadHelper.createDiagnostic(resource, e));
}
+ EList<Resource.Diagnostic> errors = resource.getErrors();
EList<Resource.Diagnostic> warnings = resource.getWarnings();
- if (warnings.size() == 1 && warnings.get(0) instanceof MigrationResource.Diagnostic) {
- return diagnostic;
- }
- if(!resource.getErrors().isEmpty() || !warnings.isEmpty()) {
+ if(!errors.isEmpty() || !warnings.isEmpty()) {
Diagnostic resourceDiagnostic = EcoreUtil.computeDiagnostic(resource, true);
Integer severityOpt = new Integer(resourceDiagnostic.getSeverity() == Diagnostic.ERROR ? 0 : 1);
String message = MessageFormat.format(Messages.modelLoadedWithProblems,

Back to the top