Commit f5cfd41e authored by Sarah Grebing's avatar Sarah Grebing

Bugfix in SaveCommandhandling

parent 58789c46
Pipeline #21802 passed with stages
in 3 minutes and 22 seconds
......@@ -225,7 +225,8 @@ public class InterpreterBuilder {
public InterpreterBuilder setProblemPath(File path){
Map<String, CommandHandler<KeyData>> builtinsnew = this.bich.getBuiltins();
builtinsnew.put("save", new SaveCommand(path));
SaveCommand sc = new SaveCommand(path);
builtinsnew.put(SaveCommand.SAVE_COMMAND_NAME, sc);
this.bich.setBuiltins(builtinsnew);
return this;
......
......@@ -18,12 +18,10 @@ public class BuiltInCommandHandler implements CommandHandler<KeyData> {
@Getter @Setter
private Map<String, CommandHandler<KeyData>> builtins;
@Getter @Setter
private SaveCommand sc;
public BuiltInCommandHandler() {
builtins = new HashMap<>();
builtins.put("save", sc);
}
......
......@@ -15,7 +15,7 @@ import java.io.File;
import java.io.IOException;
public class SaveCommand implements CommandHandler<KeyData> {
private static final String SAVE_COMMAND_NAME = "#save";
public static final String SAVE_COMMAND_NAME = "#save";
private static Logger logger = LogManager.getLogger(SaveCommand.class);
private static Logger consoleLogger = LogManager.getLogger("console");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment