From 6bbcce7c269243537b81165f146facebc8ffd0ec Mon Sep 17 00:00:00 2001
From: Michael Leuschel <leuschel@cs.uni-duesseldorf.de>
Date: Tue, 24 Sep 2019 11:16:37 +0200
Subject: [PATCH] add tip to clean Rodin project when load fails

---
 .../src/de/prob/core/command/LoadEventBModelCommand.java       | 3 ++-
 .../src/de/prob/core/command/internal/InternalLoadCommand.java | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java b/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java
index 08a8456e..de110e75 100644
--- a/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java
+++ b/de.prob.core/src/de/prob/core/command/LoadEventBModelCommand.java
@@ -107,7 +107,8 @@ public final class LoadEventBModelCommand {
 				Logger.notifyUserWithoutBugreport(message);
 			}
 		} catch (CommandException ex) {
-			Logger.notifyUser("Event-B Model or Context could not be loaded due to an exception: " + ex.getMessage(),
+			Logger.notifyUser("Event-B Model or Context could not be loaded due to an exception: " 
+			                  + ex.getMessage() + "\nTry cleaning the Rodin project (Project -> Clean).",
 					ex);
 		}
 
diff --git a/de.prob.core/src/de/prob/core/command/internal/InternalLoadCommand.java b/de.prob.core/src/de/prob/core/command/internal/InternalLoadCommand.java
index 640f8bcb..1e98e98c 100644
--- a/de.prob.core/src/de/prob/core/command/internal/InternalLoadCommand.java
+++ b/de.prob.core/src/de/prob/core/command/internal/InternalLoadCommand.java
@@ -25,6 +25,7 @@ public final class InternalLoadCommand implements IComposableCommand {
 		} catch (TranslationFailedException e) {
 			throw new CommandException(
 					"Translation from Event-B to ProB's internal representation failed: " + e.getMessage(),
+					// probably a clean of Rodin project can help; this text is added in LoadEventBModelCommand
 					e);
 		}
 	}
-- 
GitLab