Buggy code:
} command = CommandParser . removeFirstWord ( command ) ; if ( CommandValidator . hasHashTags ( command ) ) { ArrayList < String > tagsList = CommandParser . getTags ( command ) ; cmdParameters . put ( TAG_LIST , tagsList ) ; command = CommandParser . removeTags ( command ) ; } while ( ! ( CommandValidator . isEmptyString ( command ) ) ) { if ( command . startsWith ( TASK_DESC_DELIMITER ) ) { if ( CommandValidator . isDescriptionWithinDelimiters ( command ) ) { String description = CommandParser . getDescriptionWithoutQuotes ( command ) ; cmdParameters . put ( DESCRIPTION , description ) ; description = CommandParser . getDescriptionWithQuotes ( command ) ; command = CommandParser . removeFirstWord ( command , description ) ; } else { String message = String . format ( INVALID_TASK_DESCRIPTION , TASK_DESC_DELIMITER ) ; return CommandParser . invalidCommand ( message ) ; } } else if ( ( CommandValidator . hasStartAndEndDateTime ( command ) ) || ( CommandValidator . isDeadlineTask ( command ) ) ) { if ( ( cmdParameters . containsKey ( START_DATETIME ) ) || ( cmdParameters . containsKey ( END_DATETIME ) ) ) { return CommandParser . invalidCommand ( INVALID_COMMAND ) ; } String endDateTimeStr ; DateTime endDateTime ; if ( CommandValidator . isDeadlineTask ( command ) ) { endDateTimeStr = CommandParser . getDeadline ( command ) ; endDateTimeStr = CommandParser . removeRecurringField ( endDateTimeStr ) ; endDateTime = new DateTime ( endDateTimeStr ) ; } else if ( CommandValidator . hasStartAndEndDateTime ( command ) ) { String startDateTimeStr = CommandParser . getStartDateTime ( command ) ; endDateTimeStr = CommandParser . getEndDateTime ( command ) ; endDateTimeStr = CommandParser . removeRecurringField ( endDateTimeStr ) ; DateTime startDateTime = new DateTime ( startDateTimeStr ) ; if ( startDateTime . isEmpty ( ) ) { String message = String . format ( INVALID_START_DATETIME , startDateTimeStr ) ; return CommandParser . invalidCommand ( message ) ; } endDateTime = new DateTime ( endDateTimeStr ) ; if ( startDateTime . isAfter ( endDateTime ) ) { String message = String . format ( INVALID_START_DATETINE_AFTER_END_DATETIME , startDateTime , endDateTime ) ; return CommandParser . invalidCommand ( message ) ; } cmdParameters . put ( START_DATETIME , startDateTime ) ; command = CommandParser . removeDateTime ( command , startDateTimeStr ) ; } else { return CommandParser . invalidCommand ( INVALID_COMMAND ) ; } if ( endDateTime . isEmpty ( ) ) { String message = String . format ( INVALID_END_DATETIME , endDateTimeStr ) ; return CommandParser . invalidCommand ( message ) ; } cmdParameters . put ( END_DATETIME , endDateTime ) ; command = CommandParser . removeDateTime ( command , endDateTimeStr ) ; } else if ( CommandValidator . hasFloatingButNoRecurringFlag ( command ) ) { if ( ( cmdParameters . containsKey ( START_DATETIME ) ) || ( cmdParameters . containsKey ( END_DATETIME ) ) ) { return CommandParser . invalidCommand ( INVALID_COMMAND ) ; } command = command . replace ( TO_FLOATING_TASK_FLAG , "" ) . trim ( ) ; cmdParameters . put ( START_DATETIME , new DateTime ( ) ) ; cmdParameters . put ( END_DATETIME , new DateTime ( ) ) ; } else if ( CommandValidator . hasRecurringButNoFloatingFlag ( command ) ) { if ( recurringID == ( Constants . NOT_A_RECURRING_TASK ) ) { return CommandParser . invalidCommand ( INVALID_RECURRING_TASK ) ; } else { cmdParameters . put ( RECUR_ID , recurringID ) ; command = command . replaceFirst ( RECURRING_FLAG , "" ) . trim ( ) ; } } else if ( CommandValidator . isRecurringTask ( command ) ) { if ( ! ( ( cmdParameters . containsKey ( START_DATETIME ) ) && ( cmdParameters . containsKey ( END_DATETIME ) ) ) ) { Task taskSelected = ( ( Task ) ( cmdParameters . get ( TASK_OBJECT ) ) ) ; <START_BUG> if ( ! ( taskSelected . hasDate ( ) ) ) { <END_BUG> return CommandParser . invalidCommand ( INVALID_TO_RECURRING_TASK ) ; } } if ( ( cmdParameters . containsKey ( START_DATETIME ) ) || ( cmdParameters . containsKey ( END_DATETIME ) ) ) { DateTime specifiedStartDateTime = ( ( DateTime ) ( cmdParameters . get ( START_DATETIME ) ) ) ; DateTime specifiedEndDateTime = ( ( DateTime ) ( cmdParameters . get ( END_DATETIME ) ) ) ; if ( ! ( ( specifiedStartDateTime . hasDate ( ) ) && ( specifiedEndDateTime . hasDate ( ) ) ) ) { return CommandParser . invalidCommand ( INVALID_TO_RECURRING_TASK ) ; } } if ( cmdParameters . containsKey ( RECUR_ID ) ) { return CommandParser . invalidCommand ( INVALID_COMMAND ) ; } cmdParameters = CommandParser . handleRecurringInfo ( command , cmdParameters ) ; command = "" ; } else { return CommandParser . invalidCommand ( INVALID_COMMAND ) ; } } return cmdParameters ; } private static HashMap < CmdParameters , Object > getRemoveCmdParameters ( String command , TaskList tasksDisplayed ) { } private static HashMap < CmdParameters , Object > getViewCmdParameters ( String command , TaskList tasksDisplayed ) { } private static HashMap < CmdParameters , Object > getViewCmdParametersForRecurringTasks ( HashMap < CmdParameters , Object > cmdParameters , String indexStr , TaskList tasksDisplayed ) { } private static HashMap < CmdParameters , Object > getSearchCmdParameters ( String command ) { } private static HashMap < CmdParameters , Object > getMarkCmdParameters ( String command , TaskList tasksDisplayed ) { } private static HashMap < CmdParameters , Object > getUndoCmdParameters ( String command ) { } private static HashMap < CmdParameters , Object > getRedoCmdParameters ( String command ) { } private static HashMap < CmdParameters , Object > getSetCmdParameters ( String command ) { } private static HashMap < CmdParameters , Object > getExitCmdParameters ( String command ) { } private static HashMap < CmdParameters , Object > invalidCommand ( String message ) { } public static TaskList getTasksByTaskRange ( String currentParam , TaskList tasksDisplayed ) { }

Fix:
if ( ! ( ( taskSelected . hasStartDate ( ) ) && ( taskSelected . hasEndDate ( ) ) ) ) {