Skip to content

Commit

Permalink
mspsim: remove unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
nfi committed Nov 5, 2024
1 parent 4e054da commit 3b07138
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion java/se/sics/mspsim/cli/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion java/se/sics/mspsim/cli/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 3b07138

Please sign in to comment.