From d2c8cefa18c21167d9706d3371bc1938e3f9ed90 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Wed, 23 May 2012 15:03:03 +0200 Subject: [PATCH] Added constructor to exception --- .../src/se/sics/cooja/mspmote/AbstractMspMoteType.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/AbstractMspMoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/AbstractMspMoteType.java index 69a37ffe9..2a6e68361 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/AbstractMspMoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/AbstractMspMoteType.java @@ -126,7 +126,8 @@ public abstract class AbstractMspMoteType extends MspMoteType { /* Handle multiple compilation commands one by one */ String[] arr = getCompileCommands().split("\n"); for (String cmd: arr) { - if (cmd.trim().isEmpty()) { + cmd = cmd.trim(); + if (cmd.isEmpty()) { continue; } @@ -143,8 +144,7 @@ public abstract class AbstractMspMoteType extends MspMoteType { ); } catch (Exception e) { MoteTypeCreationException newException = - new MoteTypeCreationException("Mote type creation failed: " + e.getMessage()); - newException = (MoteTypeCreationException) newException.initCause(e); + new MoteTypeCreationException("Mote type creation failed: " + e.getMessage(), e); newException.setCompilationOutput(compilationOutput); /* Print last 10 compilation errors to console */