Skip to content

Commit

Permalink
A quick fix to make code work with Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
priyaaank committed Sep 13, 2016
1 parent 9f94db9 commit 4aec376
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/com/thoughtworks/rover/parser/StringCommandParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class StringCommandParser {

public static final String BY_EACH_CHARACTER = "";
public static final int START_INDEX = 1;
public static final int START_INDEX = 0;

private static Map<String, ICommand> stringToCommandMap = new HashMap<String, ICommand>() {{
put("L", new RotateLeftCommand());
Expand All @@ -33,6 +33,7 @@ private List<ICommand> buildCommandsList(final String commandString) {
List<ICommand> commands = new ArrayList<ICommand>();

for(String commandCharacter : commandCharactersFrom(commandString)) {
if (commandCharacter == null) break;
ICommand mappedCommand = lookupEquivalentCommand(commandCharacter.toUpperCase());
commands.add(mappedCommand);
}
Expand Down

0 comments on commit 4aec376

Please sign in to comment.