From 3b07138198817239d4440d51db1ddfd5451d0142 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Wed, 16 Oct 2024 19:57:16 +0200 Subject: [PATCH] mspsim: remove unnecessary cast --- java/se/sics/mspsim/cli/Command.java | 2 +- java/se/sics/mspsim/cli/CommandHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/se/sics/mspsim/cli/Command.java b/java/se/sics/mspsim/cli/Command.java index c40870dc54..24ab2ca020 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 8aa503e37a..d58e2e3276 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()) {