Buggy code:
public class Rfc822Parser extends AbstractParser { private static final int RETURN_PATH = 0 ; private static final int RECEIVED = 1 ; private static final int FROM = 2 ; private static final int SENDER = 3 ; private static final int REPLY_TO = 4 ; private static final int RESENT_FROM = 5 ; private static final int RESENT_SENDER = 6 ; private static final int RESENT_REPLY_TO = 7 ; private static final int DATE = 8 ; private static final int RESENT_DATE = 9 ; private static final int TO = 10 ; private static final int RESENT_TO = 11 ; private static final int CC = 12 ; private static final int RESENT_CC = 13 ; private static final int BCC = 14 ; private static final int RESENT_BCC = 15 ; private static final int MESSAGE_ID = 16 ; private static final int RESENT_MESSAGE_ID = 17 ; private static final int IN_REPLY_TO = 18 ; private static final int REFERENCES = 19 ; private static final int KEYWORDS = 20 ; private static final int SUBJECT = 21 ; private static final int COMMENTS = 22 ; private static final int ENCRYPTED = 23 ; private static final int Mime_VERSION = 24 ; private static final int X_ADDITIONAL = 25 ; private String [ ] input ; private EncodedWordDecoder decoder ; private ColumbaHeader parsedHeader ; private boolean mime ; private String mimeVer ; public Rfc822Parser ( ) { } public Message parse ( String input , boolean parseHeader , ColumbaHeader header , int action ) { } private int getCode ( String par ) { } public ColumbaHeader parseHeader ( String message ) { } private ColumbaHeader parseHeaderString ( String input ) { } public void addColumbaHeaderFields ( ColumbaHeader h ) { long OneDay = ( ( 24 * 60 ) * 60 ) * 1000 ; TimeZone localTimeZone = TimeZone . getDefault ( ) ; h . set ( "columba.flags.recent" , new Boolean ( false ) ) ; h . set ( "columba.host" , new String ( "" ) ) ; <START_BUG> Date date = DateParser . parseString ( ( ( String ) ( h . get ( "date" ) ) ) ) ; <END_BUG> h . set ( "columba.date" , date ) ; Date date2 = ( ( Date ) ( h . get ( "columba.date" ) ) ) ; long t = date . getTime ( ) ; long datediff = ( ( ( System . currentTimeMillis ( ) ) + ( localTimeZone . getRawOffset ( ) ) ) - ( ( ( t + ( localTimeZone . getRawOffset ( ) ) ) // OneDay ) * OneDay ) ) // OneDay ; if ( datediff > 1 ) { h . set ( "columba.flags.seen" , new Boolean ( true ) ) ; } String shortFrom = ( ( String ) ( h . get ( "From" ) ) ) ; if ( shortFrom != null ) { if ( ( shortFrom . indexOf ( "<" ) ) != ( - 1 ) ) { shortFrom = shortFrom . substring ( 0 , shortFrom . indexOf ( "<" ) ) ; if ( ( shortFrom . length ( ) ) > 0 ) { if ( ( shortFrom . startsWith ( "\"" ) ) && ( ( shortFrom . length ( ) ) > 1 ) ) shortFrom = shortFrom . substring ( 1 , ( ( shortFrom . length ( ) ) - 1 ) ) ; if ( ( shortFrom . endsWith ( "\"" ) ) && ( ( shortFrom . length ( ) ) > 1 ) ) shortFrom = shortFrom . substring ( 0 , ( ( shortFrom . length ( ) ) - 1 ) ) ; } else { shortFrom = ( ( String ) ( h . get ( "From" ) ) ) ; if ( shortFrom . startsWith ( "<" ) ) shortFrom = shortFrom . substring ( 1 , ( ( shortFrom . length ( ) ) - 1 ) ) ; if ( shortFrom . endsWith ( ">" ) ) shortFrom = shortFrom . substring ( 0 , ( ( shortFrom . length ( ) ) - 1 ) ) ; } } h . set ( "columba.from" , shortFrom ) ; } else { h . set ( "columba.from" , new String ( "" ) ) ; } String priority = ( ( String ) ( h . get ( "X-Priority" ) ) ) ; if ( priority != null ) { try { Integer p = new Integer ( priority ) ; h . set ( "columba.priority" , p ) ; } catch ( Exception ex ) { h . set ( "columba.priority" , new Integer ( 3 ) ) ; } } else { h . set ( "columba.priority" , new Integer ( 3 ) ) ; } String attachment = ( ( String ) ( h . get ( "Content-Type" ) ) ) ; if ( attachment != null ) { attachment = attachment . toLowerCase ( ) ; if ( ( attachment . indexOf ( "multipart" ) ) != ( - 1 ) ) { h . set ( "columba.attachment" , new Boolean ( true ) ) ; } else { h . set ( "columba.attachment" , new Boolean ( false ) ) ; } } else { h . set ( "columba.attachment" , new Boolean ( false ) ) ; } } }

Fix:
Date date = DateParser . parseString ( ( ( String ) ( h . get ( "Date" ) ) ) ) ;