Buggy code:
public class ColumnComparator implements Comparator { protected int index ; protected boolean ascending ; protected String columnName ; public ColumnComparator ( String columnName , int index , boolean ascending ) { } public int compare ( Object o1 , Object o2 ) { int sort = 1 ; if ( ( o1 instanceof LoggingEvent ) && ( o2 instanceof LoggingEvent ) ) { LoggingEvent e1 = ( ( LoggingEvent ) ( o1 ) ) ; LoggingEvent e2 = ( ( LoggingEvent ) ( o2 ) ) ; switch ( ( index ) + 1 ) { case ChainsawColumns . INDEX_LEVEL_COL_NAME : sort = ( e1 . getLevel ( ) . isGreaterOrEqual ( e2 . getLevel ( ) ) ) ? 1 : - 1 ; break ; case ChainsawColumns . INDEX_LOGGER_COL_NAME : sort = e1 . getLoggerName ( ) . compareToIgnoreCase ( e2 . getLoggerName ( ) ) ; break ; case ChainsawColumns . INDEX_MESSAGE_COL_NAME : sort = e1 . getMessage ( ) . toString ( ) . compareToIgnoreCase ( e2 . getMessage ( ) . toString ( ) ) ; break ; case ChainsawColumns . INDEX_NDC_COL_NAME : if ( ( ( e1 . getNDC ( ) ) != null ) && ( ( e2 . getNDC ( ) ) != null ) ) { sort = e1 . getNDC ( ) . compareToIgnoreCase ( e2 . getNDC ( ) ) ; } break ; case ChainsawColumns . INDEX_METHOD_COL_NAME : if ( ( e1 . locationInformationExists ( ) ) & ( e2 . locationInformationExists ( ) ) ) { sort = e1 . getLocationInformation ( ) . getMethodName ( ) . compareToIgnoreCase ( e2 . getLocationInformation ( ) . getMethodName ( ) ) ; } break ; case ChainsawColumns . INDEX_CLASS_COL_NAME : if ( ( e1 . locationInformationExists ( ) ) & ( e2 . locationInformationExists ( ) ) ) { sort = e1 . getLocationInformation ( ) . getClassName ( ) . compareToIgnoreCase ( e2 . getLocationInformation ( ) . getClassName ( ) ) ; } break ; case ChainsawColumns . INDEX_FILE_COL_NAME : if ( ( e1 . locationInformationExists ( ) ) & ( e2 . locationInformationExists ( ) ) ) { sort = e1 . getLocationInformation ( ) . getFileName ( ) . compareToIgnoreCase ( e2 . getLocationInformation ( ) . getFileName ( ) ) ; } break ; case ChainsawColumns . INDEX_TIMESTAMP_COL_NAME : <START_BUG> sort = ( ( e1 . timeStamp ) < ( e2 . timeStamp ) ) ? - 1 : ( e1 . timeStamp ) == ( e2 . timeStamp ) ? 0 : 1 ; <END_BUG> break ; case ChainsawColumns . INDEX_THREAD_COL_NAME : sort = e1 . getThreadName ( ) . compareToIgnoreCase ( e2 . getThreadName ( ) ) ; break ; case ChainsawColumns . INDEX_ID_COL_NAME : int id1 = Integer . parseInt ( e1 . getProperty ( LOG4J_ID_KEY ) ) ; int id2 = Integer . parseInt ( e2 . getProperty ( LOG4J_ID_KEY ) ) ; if ( id1 == id2 ) { sort = 0 ; } else if ( id1 < id2 ) { sort = 1 ; } else { sort = - 1 ; } break ; case ChainsawColumns . INDEX_THROWABLE_COL_NAME : if ( ( ( e1 . getThrowableStrRep ( ) ) != null ) && ( ( e2 . getThrowableStrRep ( ) ) != null ) ) { String [ ] s1 = e1 . getThrowableStrRep ( ) ; String [ ] s2 = e2 . getThrowableStrRep ( ) ; boolean foundDiff = false ; for ( int i = 0 ; i < ( s1 . length ) ; i ++ ) { if ( foundDiff || ( i > ( s2 . length ) ) ) { break ; } sort = s1 [ i ] . compareToIgnoreCase ( s2 [ i ] ) ; foundDiff = sort != 0 ; } } break ; case ChainsawColumns . INDEX_LINE_COL_NAME : if ( ( e1 . locationInformationExists ( ) ) & ( e2 . locationInformationExists ( ) ) ) { sort = e1 . getLocationInformation ( ) . getLineNumber ( ) . compareToIgnoreCase ( e2 . getLocationInformation ( ) . getLineNumber ( ) ) ; } break ; default : if ( ( ( e1 . getMDC ( columnName ) ) != null ) && ( ( e2 . getMDC ( columnName ) ) != null ) ) { sort = e1 . getMDC ( columnName ) . toString ( ) . compareToIgnoreCase ( e2 . getMDC ( columnName ) . toString ( ) ) ; } } } sort = ( sort == 0 ) ? 0 : sort < 0 ? - 1 : 1 ; if ( ( ! ( ascending ) ) && ( sort != 0 ) ) { sort = ( sort < 0 ) ? 1 : - 1 ; } return sort ; } }

Fix:
sort = ( ( e1 . getTimeStamp ( ) ) < ( e2 . getTimeStamp ( ) ) ) ? - 1 : ( e1 . getTimeStamp ( ) ) == ( e2 . getTimeStamp ( ) ) ? 0 : 1 ;