Browse Source

Bug fix: PEPA model errors were not handled properly in the GUI.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@6657 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 13 years ago
parent
commit
af2379160b
  1. 5
      prism/src/userinterface/model/GUIMultiModelHandler.java
  2. 6
      prism/src/userinterface/model/computation/ParseModelThread.java

5
prism/src/userinterface/model/GUIMultiModelHandler.java

@ -776,11 +776,12 @@ public class GUIMultiModelHandler extends JPanel implements PrismModelListener
theModel.notifyEventListeners(new GUIModelEvent(GUIModelEvent.MODEL_PARSED, parsedModel));
}
public synchronized void modelParseFailed(PrismLangException parserError, boolean background)
public synchronized void modelParseFailed(PrismException parserError, boolean background)
{
lastError = parserError.getMessage();
editor.modelParseFailed(parserError, background);
if (parserError instanceof PrismLangException)
editor.modelParseFailed((PrismLangException) parserError, background);
tree.stopParsing();
parsing = false;

6
prism/src/userinterface/model/computation/ParseModelThread.java

@ -43,7 +43,7 @@ public class ParseModelThread extends GUIComputationThread
private boolean background;
private ModulesFile mod;
private String errMsg;
private PrismLangException parseError;
private PrismException parseError;
static int counter = 0;
int id;
long before;
@ -91,7 +91,7 @@ public class ParseModelThread extends GUIComputationThread
}
// Load into PRISM once done
prism.loadPRISMModel(mod);
} catch (PrismLangException err) {
} catch (PrismException err) {
parseError = err;
errMsg = err.getMessage();
SwingUtilities.invokeLater(new Runnable()
@ -109,8 +109,6 @@ public class ParseModelThread extends GUIComputationThread
}
});
return;
} catch (PrismException e) {
throw new RuntimeException("Unexpected PrismException: " + e.getMessage());
}
// If we get here, the parse has been successful, notify the interface and tell the handler.

Loading…
Cancel
Save