diff --git a/java/se/sics/mspsim/cli/Command.java b/java/se/sics/mspsim/cli/Command.java index c40870dc5..24ab2ca02 100644 --- a/java/se/sics/mspsim/cli/Command.java +++ b/java/se/sics/mspsim/cli/Command.java @@ -23,7 +23,7 @@ public abstract class Command { public abstract int executeCommand(CommandContext context); /* default behavior is that it returns *this* instance (which might be bad in some cases) */ - public Object getInstance() { + public Command getInstance() { return this; } } diff --git a/java/se/sics/mspsim/cli/CommandHandler.java b/java/se/sics/mspsim/cli/CommandHandler.java index 8aa503e37..d58e2e327 100644 --- a/java/se/sics/mspsim/cli/CommandHandler.java +++ b/java/se/sics/mspsim/cli/CommandHandler.java @@ -164,7 +164,7 @@ private File resolveScript(String script) { private Command getCommand(String cmd) { Command command = commands.get(cmd); if (command != null) { - return (Command) command.getInstance(); + return command.getInstance(); } File scriptFile = resolveScript(cmd); if (scriptFile != null && scriptFile.isFile() && scriptFile.canRead()) {