@@ -246,10 +246,8 @@ public HackController(HackSimulator simulator, String scriptFileName) {
246246 try {
247247 loadNewScript (file , false );
248248 saveWorkingDir (file );
249- } catch (ScriptException se ) {
249+ } catch (ScriptException | ControllerException se ) {
250250 displayMessage (se .getMessage (), true );
251- } catch (ControllerException ce ) {
252- displayMessage (ce .getMessage (), true );
253251 }
254252
255253 fastForwardRunning = true ;
@@ -450,14 +448,8 @@ else if (breakpoint.isReached()) {
450448 if (breakpointReached )
451449 tempBreakpoints .clear ();
452450
453- } catch (ControllerException ce ) {
451+ } catch (ControllerException | ProgramException | CommandException | VariableException ce ) {
454452 stopWithError (ce );
455- } catch (ProgramException pe ) {
456- stopWithError (pe );
457- } catch (CommandException ce ) {
458- stopWithError (ce );
459- } catch (VariableException ve ) {
460- stopWithError (ve );
461453 }
462454
463455 singleStepLocked = false ;
@@ -913,8 +905,7 @@ protected void reloadDefaultScript() {
913905 try {
914906 loadNewScript (defaultScriptFile , false );
915907 rewind ();
916- } catch (ScriptException ignored ) {
917- } catch (ControllerException ignored ) {
908+ } catch (ScriptException | ControllerException ignored ) {
918909 }
919910 }
920911 }
@@ -1070,10 +1061,7 @@ public void actionPerformed(ControllerEvent event) {
10701061 doUnknownAction (event .getAction (), event .getData ());
10711062 break ;
10721063 }
1073- } catch (ScriptException e ) {
1074- displayMessage (e .getMessage (), true );
1075- stopMode ();
1076- } catch (ControllerException e ) {
1064+ } catch (ScriptException | ControllerException e ) {
10771065 displayMessage (e .getMessage (), true );
10781066 stopMode ();
10791067 }
0 commit comments