Buggy code:
public class ICalBackupRestore { private static final String CRLF = "\r\n" ; private static class KeyValuePair { public String key ; public String value ; public KeyValuePair ( String k , String v ) { } } public static void backup ( File file , List < TodoItem > items ) throws FileNotFoundException { } private static void dateTimeToStream ( Calendar calendar , PrintStream stream ) { } private static String escapeString ( String str ) { } private static ICalBackupRestore . KeyValuePair readICalLine ( BufferedReader iCalReader ) throws IOException { } public static List < TodoItem > restore ( File file ) throws FileNotFoundException , IOException { BufferedReader iCalFileReader = new BufferedReader ( new FileReader ( file ) ) ; ArrayList < TodoItem > items = new ArrayList < TodoItem > ( ) ; ICalBackupRestore . KeyValuePair line ; boolean inTodo = false ; TodoItem item = null ; boolean dtstamp = false ; boolean description = false ; boolean status = false ; boolean categories = false ; boolean ordinal = false ; while ( ( line = ICalBackupRestore . readICalLine ( iCalFileReader ) ) != null ) { if ( ! inTodo ) { if ( ( ( line . key . compareTo ( "BEGIN" ) ) == 0 ) && ( ( line . value . compareTo ( "VTODO" ) ) == 0 ) ) { inTodo = true ; item = new TodoItem ( ) ; dtstamp = description = status = categories = ordinal = false ; } } else { if ( ( line . key . compareTo ( "END" ) ) == 0 ) { if ( ( ( line . value . compareTo ( "VTODO" ) ) == 0 ) && ( ( ( ( dtstamp && description ) && status ) && categories ) && ordinal ) ) { items . add ( item ) ; inTodo = false ; } } else if ( ( line . key . compareTo ( "DTSTAMP" ) ) == 0 ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . set ( Calendar . YEAR , Integer . parseInt ( line . value . substring ( 0 , 4 ) ) ) ; calendar . set ( Calendar . MONTH , Integer . parseInt ( line . value . substring ( 4 , 6 ) ) ) ; calendar . set ( Calendar . DAY_OF_MONTH , Integer . parseInt ( line . value . substring ( 6 , 8 ) ) ) ; calendar . set ( Calendar . HOUR_OF_DAY , Integer . parseInt ( line . value . substring ( 9 , 11 ) ) ) ; calendar . set ( Calendar . MINUTE , Integer . parseInt ( line . value . substring ( 11 , 13 ) ) ) ; calendar . set ( Calendar . SECOND , Integer . parseInt ( line . value . substring ( 13 , 15 ) ) ) ; item . setLastModified ( calendar . getTimeInMillis ( ) ) ; dtstamp = true ; } else if ( ( line . key . compareTo ( "DESCRIPTION" ) ) == 0 ) { item . setTitle ( ICalBackupRestore . unescapeString ( line . value ) ) ; description = true ; } else if ( ( line . key . compareTo ( "STATUS" ) ) == 0 ) { if ( ( line . value . compareTo ( "NEEDS-ACTION" ) ) == 0 ) { item . setStatus ( ITEM_STATUS_OPEN ) ; status = true ; } else if ( ( line . value . compareTo ( "IN-PROGRESS" ) ) == 0 ) { item . setStatus ( ITEM_STATUS_STARTED ) ; status = true ; } else <START_BUG> if ( ( line . value . compareTo ( "COMPLETE" ) ) == 0 ) { <END_BUG> item . setStatus ( ITEM_STATUS_DONE ) ; status = true ; } } else if ( ( line . key . compareTo ( "CATEGORIES" ) ) == 0 ) { item . getTags ( ) . addAll ( Arrays . asList ( line . value . split ( "," ) ) ) ; categories = true ; } else if ( ( line . key . compareTo ( "X-ORDINAL" ) ) == 0 ) { item . setOrdinal ( Integer . parseInt ( line . value ) ) ; ordinal = true ; } } } return items ; } private static String unescapeString ( String str ) { } }

Fix:
if ( ( line . value . compareTo ( "COMPLETED" ) ) == 0 ) {