Skip to content
Snippets Groups Projects
Commit ead46511 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

More explicit information in case of model internal coherence problems

parent a7859556
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils;
* @author hummel
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: CC9C1C2E6EE24D1B861861D4BCA95D75
* @ConQAT.Rating YELLOW Hash: 908BAA6397ED5750B4FAE01669F9069D
*/
class ModelContext implements ITopLevelElement, CommandStackListener {
......@@ -279,7 +279,7 @@ class ModelContext implements ITopLevelElement, CommandStackListener {
// Perform diagnostics
Diagnostic validate = Diagnostician.INSTANCE.validate(getRootModelElement());
if(validate.getSeverity() != Diagnostic.OK) {
warning(ToolingKernelActivator.getDefault(), validate.getMessage());
warning(ToolingKernelActivator.getDefault(), getFullMessage(validate));
}
monitor.worked(1);
......@@ -354,6 +354,25 @@ class ModelContext implements ITopLevelElement, CommandStackListener {
}
}
/**
* Gathers all the error messages of a given diagnostic.
*
* @param diagnostic
* @return The error message of <code>diagnostic</code> <i>and the ones of its potential
* children</i>.
*/
private String getFullMessage(Diagnostic diagnostic) {
String res = new String();
if(diagnostic.getSeverity() != Diagnostic.OK) {
res = diagnostic.getMessage();
for(Diagnostic child : diagnostic.getChildren()) {
String childMessage = getFullMessage(child);
res += (childMessage.isEmpty() ? "" : "\n") + childMessage;
}
}
return res;
}
/**
* Perform saving of the model and states the last change as intended.
* Added to solve issue #2140.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment