Buggy code:
public class CommandParser implements Parser { private static final String [ ] KEYWORDS_DATETIME_SEPARATOR = new String [ ] { "from" , "on" , "between" , "by" , "in" , "at" , "on" , "due" } ; private static final String [ ] COMMAND_KEYWORD_ADD = new String [ ] { "add" , "create" , "new" , "ins" , "insert" , "put" } ; private static final String [ ] COMMAND_KEYWORD_UPDATE = new String [ ] { "update" , "change" , "modify" , "edit" , "alter" } ; private static final String [ ] COMMAND_KEYWORD_DELETE = new String [ ] { "delete" , "clear" , "remove" , "rm" , "discard" } ; private static final String [ ] COMMAND_KEYWORD_VIEW_AND_SEARCH = new String [ ] { "search" , "find" , "look" , "display" , "show" , "open" , "view" , "list" } ; private static final String [ ] COMMAND_KEYWORD_UNDO = new String [ ] { "undo" , "revert" } ; private static final String [ ] COMMAND_KEYWORD_REDO = new String [ ] { "redo" } ; private static final String [ ] COMMAND_KEYWORD_MARK = new String [ ] { "mark" , "complete" , "done" , "check" } ; private static final String [ ] COMMAND_KEYWORD_UNMARK = new String [ ] { "unmark" , "incomplete" , "undone" , "uncheck" } ; private static final String [ ] COMMAND_KEYWORD_EXIT = new String [ ] { "exit" , "quit" , "close" } ; private static final String [ ] VIEW_KEYWORDS_ALL = new String [ ] { "" , "all" , "everything" } ; private static final String [ ] VIEW_KEYWORDS_UPCOMING = new String [ ] { "upcoming" , "incomplete" , "undone" , "todo" } ; private static final String [ ] VIEW_KEYWORDS_COMPLETED = new String [ ] { "completed" , "complete" , "done" } ; private static final String [ ] VIEW_KEYWORDS_OVERDUE = new String [ ] { "overdue" , "due" , "urgent" , "late" } ; private static final String [ ] SEARCH_RELATIVITY_BEFORE = new String [ ] { "before" , "b4" } ; private static final String [ ] SEARCH_RELATIVITY_AFTER = new String [ ] { "after" , "aft" } ; private static final String [ ] SEARCH_RELATIVITY_EXACT = new String [ ] { "on" } ; private static final String [ ] SEARCH_RELATIVITY_SPECIFIED = new String [ ] { "between" , "from" } ; private static final LocalDateTime MIN_DATETIME = LocalDateTime . MIN ; private static final LocalDateTime MAX_DATETIME = LocalDateTime . MAX ; private static final int NUM_START_END_DATETIME = 2 ; private static final int START_DATETIME = 0 ; private static final int END_DATETIME = 1 ; private enum RelativeType { BEFORE , AFTER , EXACT , SPECIFIED , NONE ; } private com . joestelmach . natty . Parser _natty ; private Logger _logger ; private HashMap < String , ViewType > dictViewTypes ; private HashMap < String , CommandParser . RelativeType > dictRelativeTypes ; public CommandParser ( ) { } private void initializeDictionaries ( ) { } public ICommand parse ( String input ) throws InvalidCommandException { } private ViewType getViewType ( String key ) { } private CommandParser . RelativeType getRelativeType ( String key ) { } private CommandType getCommandType ( String key ) throws InvalidCommandException { } private ICommand executeCommandType ( CommandType cmd , String command ) throws InvalidCommandException { } private String determineTaskName ( String command , DateGroup group ) { } private ICommand doAdd ( String command ) throws InvalidCommandException { } private ICommand doUpdate ( String command ) throws InvalidCommandException { } private ICommand doDelete ( String command ) throws InvalidCommandException { } private ICommand doView ( String command ) { } private ICommand doUndo ( String command ) { } private ICommand doRedo ( String command ) { } private ICommand doMark ( String command ) throws InvalidCommandException { } private ICommand doUnmark ( String command ) throws InvalidCommandException { } private ICommand doExit ( ) { } private static LocalDateTime [ ] getStartAndEndDateTime ( List < Date > dates ) { } private static boolean hasKeyword ( String needle , String [ ] haystack ) { } private static String getCommandKeyword ( String command ) { } private static String getCommandParameters ( String command ) { <START_BUG> return command . replace ( CommandParser . getCommandKeyword ( command ) , "" ) . trim ( ) ; <END_BUG> } private static String [ ] splitStringWithWhitespace ( String command ) { } private static LocalDateTime convertDateToLocalDateTime ( Date date ) { } }

Fix:
return command . replaceFirst ( CommandParser . getCommandKeyword ( command ) , "" ) . trim ( ) ;