Buggy code:
; System . out . println ( ( ( ( "Buffer<seq2seq4repair_space>pos:<seq2seq4repair_space>" + ( indices [ 0 ] ) ) + "Task<seq2seq4repair_space>pos:<seq2seq4repair_space>" ) + ( indices [ 1 ] ) ) ) ; getInternalStorage ( ) ; _searchList = new ArrayList < Task > ( ) ; String searchKeyword = command . getSpecificParameter ( NAME . getTaskKeyName ( ) ) ; String searchDateKeyword = command . getSpecificParameter ( KEYWORD . getTaskKeyName ( ) ) ; String dateString = command . getSpecificParameter ( ENDDATE . getTaskKeyName ( ) ) ; String timeString = command . getSpecificParameter ( ENDTIME . getTaskKeyName ( ) ) ; if ( ( ( searchKeyword == null ) && ( searchDateKeyword == null ) ) || ( ( ( searchDateKeyword != null ) && ( dateString == null ) ) && ( timeString == null ) ) ) { Status . _outcome = Outcome . ERROR ; Status . _errorCode = ErrorCode . SEARCH_INVALID ; return getOperationStatus ( command ) ; } Logic . logger . logp ( Level . INFO , "Logic" , "searchFile(Command<seq2seq4repair_space>command)" , "Searching<seq2seq4repair_space>tasks<seq2seq4repair_space>in<seq2seq4repair_space>file." , searchKeyword ) ; if ( searchKeyword != null ) { String [ ] keywords = searchKeyword . toLowerCase ( ) . split ( "<seq2seq4repair_space>" ) ; for ( Task entry : _fullTaskList ) { for ( String word : keywords ) { String taskNameCopy = entry . getName ( ) ; String taskNameLowerCase = taskNameCopy . toLowerCase ( ) ; if ( taskNameLowerCase . contains ( word ) ) { System . out . println ( ( ! ( _searchList . contains ( entry ) ) ) ) ; if ( ! ( _searchList . contains ( entry ) ) ) { _searchList . add ( entry ) ; } else { } } } } System . out . println ( _searchList . size ( ) ) ; } else { Date referenceDate ; try { if ( searchDateKeyword . trim ( ) . equalsIgnoreCase ( Logic . SEARCH_BEFORE ) ) { referenceDate = Task . parseDateTimeToString ( new Date ( ) , dateString , timeString , true ) ; } else { referenceDate = Task . parseDateTimeToString ( new Date ( ) , dateString , timeString , false ) ; } } catch ( ParseException pe ) { Status . _outcome = Outcome . ERROR ; Status . _errorCode = ErrorCode . SEARCH_INVALID ; return getOperationStatus ( command ) ; } for ( Task entry : _fullTaskList ) { if ( searchDateKeyword . trim ( ) . equalsIgnoreCase ( Logic . SEARCH_BEFORE ) ) { if ( ( entry . isEvent ( ) ) && ( ( referenceDate . compareTo ( entry . getStartDate ( ) ) ) > 0 ) ) { _searchList . add ( entry ) ; } else if ( ( ! ( entry . isFloatingTask ( ) ) ) && ( ( referenceDate . compareTo ( entry . getEndDate ( ) ) ) > 0 ) ) { _searchList . add ( entry ) ; } else { } } else if ( searchDateKeyword . trim ( ) . equalsIgnoreCase ( Logic . SEARCH_ON ) ) { Date intervalStart = ( ( Date ) ( referenceDate . clone ( ) ) ) ; intervalStart . setHours ( 0 ) ; intervalStart . setMinutes ( 0 ) ; Date intervalEnd = ( ( Date ) ( referenceDate . clone ( ) ) ) ; intervalEnd . setHours ( 23 ) ; intervalEnd . setMinutes ( 59 ) ; if ( ( ( entry . isEvent ( ) ) && ( ( intervalStart . compareTo ( entry . getStartDate ( ) ) ) <= 0 ) ) && ( ( intervalEnd . compareTo ( entry . getStartDate ( ) ) ) >= 0 ) ) { _searchList . add ( entry ) ; } else if ( ( ( ! ( entry . isFloatingTask ( ) ) ) && ( ( intervalStart . compareTo ( entry . getEndDate ( ) ) ) <= 0 ) ) && ( ( intervalEnd . compareTo ( entry . getEndDate ( ) ) ) >= 0 ) ) { _searchList . add ( entry ) ; } else { } } else if ( searchDateKeyword . trim ( ) . equalsIgnoreCase ( Logic . SEARCH_AFTER ) ) { if ( ( entry . isEvent ( ) ) && ( ( referenceDate . compareTo ( entry . getStartDate ( ) ) ) <= 0 ) ) { _searchList . add ( entry ) ; } else <START_BUG> if ( ( ! ( entry . isFloatingTask ( ) ) ) && ( ( referenceDate . compareTo ( entry . getEndDate ( ) ) ) <= 0 ) ) { <END_BUG> _searchList . add ( entry ) ; } else { } } else { Status . _outcome = Outcome . ERROR ; Status . _errorCode = ErrorCode . SEARCH_INVALID ; indices [ 0 ] = - 1 ; indices [ 1 ] = - 1 ; setUiTaskDisplays ( command . getCommand ( ) , indices ) ; return getOperationStatus ( command ) ; } } } setUiTaskDisplays ( command . getCommand ( ) , indices ) ; Status . _outcome = Outcome . SUCCESS ; return getOperationStatus ( command ) ; } private String setSaveFilePath ( Command command ) { } private String undo ( Command command ) { } private void createAndAddTaskToFile ( Command command ) { } private int [ ] getTaskIndex ( Command command ) { } private void removeTaskAndUpdateFile ( Command command ) { } private void updateTaskInFile ( Command command ) { } private void completeTaskInFile ( Command command ) { } private void sortAndUpdateFile ( Command command ) { } private State createPreviousState ( Command command , int [ ] oldIndices ) { } private void undoAdd ( State state ) { } private void undoDelete ( State state ) { }

Fix:
if ( ( ! ( entry . isFloatingTask ( ) ) ) && ( ( referenceDate . compareTo ( entry . getEndDate ( ) ) ) < 0 ) ) {