Buggy code:
public class DbUtil { private String threadName = "" ; public static final int TCHAR = 0 ; public static final int TDATE = 1 ; public static final int TDECIMAL = 2 ; public static final int TDECIMALNN = 3 ; public static final int TDOUBLE = 4 ; public static final int TFLOAT = 5 ; public static final int TINT = 6 ; public static final int TLONGINT = 7 ; public static final int TNUMERICLARGE = 8 ; public static final int TREAL = 9 ; public static final int TSMALLINT = 10 ; public static final int TTIME = 11 ; public static final int TTIMESTAMP = 12 ; public static final int TVARCHAR = 13 ; public static final int NUMTYPES = 14 ; public static String [ ] colnames = new String [ ] { "t_char" , "t_date" , "t_decimal" , "t_decimal_nn" , "t_double" , "t_float" , "t_int" , "t_longint" , "t_numeric_large" , "t_real" , "t_smallint" , "t_time" , "t_timestamp" , "t_varchar" } ; public DbUtil ( String thName ) { } public int add_one_row ( Connection conn , String thread_id ) throws Exception { } public int update_one_row ( Connection conn , String thread_id ) throws Exception { } public int delete_one_row ( Connection conn , String thread_id ) throws Exception { } public long pick_one ( Connection conn , String thread_id ) throws Exception { } public synchronized void printException ( String where , Exception e ) { System . out . println ( e . toString ( ) ) ; if ( e instanceof SQLException ) { SQLException se = ( ( SQLException ) ( e ) ) ; if ( se . getSQLState ( ) . equals ( "40001" ) ) System . out . println ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>deadlocked<seq2seq4repair_space>detected" ) ) ; if ( se . getSQLState ( ) . equals ( "40XL1" ) ) System . out . println ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>lock<seq2seq4repair_space>timeout<seq2seq4repair_space>exception" ) ) ; if ( se . getSQLState ( ) . equals ( "23500" ) ) System . out . println ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>duplicate<seq2seq4repair_space>key<seq2seq4repair_space>violation" ) ) ; if ( ( se . getNextException ( ) ) != null ) { String m = se . getNextException ( ) . getSQLState ( ) ; System . out . println ( ( ( ( se . getNextException ( ) . getMessage ( ) ) + "<seq2seq4repair_space>SQLSTATE:<seq2seq4repair_space>" ) + m ) ) ; System . out . println ( ( ( ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>---><seq2seq4repair_space>Details<seq2seq4repair_space>of<seq2seq4repair_space>exception:<seq2seq4repair_space>" ) + ( se . toString ( ) ) ) + "<seq2seq4repair_space>" ) + ( se . getErrorCode ( ) ) ) ) ; } } <START_BUG> if ( e . getMessage ( ) . equals ( null ) ) { <END_BUG> System . out . println ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>NULL<seq2seq4repair_space>error<seq2seq4repair_space>message<seq2seq4repair_space>detected" ) ) ; System . out . println ( ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>Here<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>NULL<seq2seq4repair_space>exection<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; System . out . println ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>--><seq2seq4repair_space>Stack<seq2seq4repair_space>trace<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>NULL<seq2seq4repair_space>exception<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) ; e . printStackTrace ( System . out ) ; } System . out . println ( ( ( ( ( ( getThreadName ( ) ) + "<seq2seq4repair_space>dbUtil<seq2seq4repair_space>----><seq2seq4repair_space>During<seq2seq4repair_space>" ) + where ) + ",<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>was<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; } public String getThreadName ( ) { } }

Fix:
if ( ( e . getMessage ( ) ) == null ) {