Buggy code:
public class DAO { private static final String DBUrl = "jdbc:mysql://////avscience" ; Date startDate = new Date ( 114 , 4 , 19 ) ; public DAO ( ) { } public static void setNewsProps ( String newNews ) { } static Properties getNewsProps ( ) { } public String getNews ( ) { } public void addPitXML ( long serial , String xml ) { } public void writeAllPitsToXML ( ) { } public void updateLayers ( ) { } public void updatePitLayers ( PitObs pit ) { } public boolean checkBuild ( PitObs pit ) { } public void writeSLFLayersToFile ( ) { } public void writeECPTTestPits ( ) { } public int getMaxDepth ( PitObs pit ) { } public void writePitsToFiles ( ) { } public void logDownload ( String target ) { } public void writePitFiles ( String user ) { } public void fixStrings ( ) { } void writePitToFile ( avscience . wba . PitObs pit ) { } void writePitToFile ( PitObs pit ) { } public LinkedHashMap getPitsFromQuery ( String whereclause ) { } public String [ ] [ ] getPitStringArrayFromQuery ( String whereclause ) { } Hashtable getPitLabels ( ) { } public String [ ] getUserAddreses ( ) { } public void getEmailsAsCSVFile ( ) { } private void loadDriver ( ) { } private Connection getConnection ( ) throws SQLException { } boolean hasUser ( WebUser u ) { } public boolean addUser ( WebUser user ) { } public void updateUser ( WebUser user ) { } public void deleteUser ( WebUser user ) { } public boolean webUserExist ( String userName ) { } public boolean authWebUser ( String userName , String email ) { } public boolean authDataUser ( String userName , String email ) { } public boolean authSuperUser ( String userName , String email ) { } public WebUser getUser ( String userName , String email ) { } private boolean pitUnAltered ( String data ) { } private boolean occUnAltered ( String data ) { } public String removeDelims ( String s ) { } boolean dbPitEdited ( PitObs pit ) { } public PitObs convertPit ( PitObs pit ) { } public void writePitToDB ( PitObs pit ) { } public void writePitToDB ( String data ) { } public void writeOccToDB ( String data ) { System . out . println ( "writeOccToDB" ) ; avscience . server . CharacterCleaner cleaner = new avscience . server . CharacterCleaner ( ) ; AvOccurence occ = new AvOccurence ( data ) ; occ = cleaner . cleanStrings ( occ ) ; String pn = occ . getPitName ( ) ; pn = removeDelims ( pn ) ; occ . setPitName ( pn ) ; if ( occPresent ( occ ) ) { System . out . println ( "Occ<seq2seq4repair_space>already<seq2seq4repair_space>in<seq2seq4repair_space>DB" ) ; if ( occUnAltered ( data ) ) { return ; } else { System . out . println ( "Deleting<seq2seq4repair_space>occ.." ) ; deleteOcc ( occ ) ; } } System . out . println ( ( "writing<seq2seq4repair_space>occ<seq2seq4repair_space>to<seq2seq4repair_space>DB<seq2seq4repair_space>:<seq2seq4repair_space>" + ( occ . getPitName ( ) ) ) ) ; <START_BUG> String query = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>OCC_TABLE<seq2seq4repair_space>(OCC_DATA,<seq2seq4repair_space>OBS_DATE,<seq2seq4repair_space>TIMESTAMP,<seq2seq4repair_space>ELV_START,<seq2seq4repair_space>ELV_DEPOSIT,<seq2seq4repair_space>ASPECT,<seq2seq4repair_space>TYPE,<seq2seq4repair_space>TRIGGER_TYPE,<seq2seq4repair_space>TRIGGER_CODE,<seq2seq4repair_space>US_SIZE,<seq2seq4repair_space>CDN_SIZE,<seq2seq4repair_space>AVG_FRACTURE_DEPTH,<seq2seq4repair_space>MAX_FRACTURE_DEPTH,<seq2seq4repair_space>WEAK_LAYER_TYPE,<seq2seq4repair_space>WEAK_LAYER_HARDNESS,<seq2seq4repair_space>SNOW_PACK_TYPE,<seq2seq4repair_space>FRACTURE_WIDTH,<seq2seq4repair_space>FRACTURE_LENGTH,<seq2seq4repair_space>AV_LENGTH,<seq2seq4repair_space>AVG_START_ANGLE,<seq2seq4repair_space>MAX_START_ANGLE,<seq2seq4repair_space>MIN_START_ANGLE,<seq2seq4repair_space>ALPHA_ANGLE,<seq2seq4repair_space>DEPTH_DEPOSIT,<seq2seq4repair_space>LOC_NAME,<seq2seq4repair_space>LOC_ID,<seq2seq4repair_space>STATE,<seq2seq4repair_space>,MTN_RANGE,<seq2seq4repair_space>LAT,<seq2seq4repair_space>LONGITUDE,<seq2seq4repair_space>NORTH,<seq2seq4repair_space>WEST,<seq2seq4repair_space>USERNAME,<seq2seq4repair_space>NAME,<seq2seq4repair_space>LOCAL_SERIAL,<seq2seq4repair_space>SHARE)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" ; <END_BUG> try { Connection conn = getConnection ( ) ; if ( conn == null ) { System . out . println ( "Connection<seq2seq4repair_space>null::" ) ; } else { PreparedStatement stmt = conn . prepareStatement ( query ) ; stmt . setString ( 1 , data ) ; String ser = occ . getSerial ( ) ; System . out . println ( ( "Occ<seq2seq4repair_space>Serial:<seq2seq4repair_space>" + ser ) ) ; String pdata = "" ; java . sql . Date odate = null ; long otime = 0 ; PitObs pit = null ; if ( ( ser != null ) && ( ( ser . trim ( ) . length ( ) ) > 0 ) ) { System . out . println ( ( "getPitBySerial:<seq2seq4repair_space>" + ser ) ) ; pdata = getPitByLocalSerial ( ser ) ; if ( ( pdata != null ) && ( ( pdata . trim ( ) . length ( ) ) > 1 ) ) { System . out . println ( "getting<seq2seq4repair_space>pit<seq2seq4repair_space>by<seq2seq4repair_space>local<seq2seq4repair_space>serial." ) ; pit = new PitObs ( pdata ) ; if ( pit != null ) { otime = pit . getTimestamp ( ) ; } } else { System . out . println ( ( ( "Can't<seq2seq4repair_space>get<seq2seq4repair_space>Pit:<seq2seq4repair_space>" + ser ) + "<seq2seq4repair_space>by<seq2seq4repair_space>serial." ) ) ; } } else { String wdata = getPit ( pn ) ; if ( ( wdata != null ) && ( ( wdata . trim ( ) . length ( ) ) > 1 ) ) { pit = new PitObs ( wdata ) ; } else { System . out . println ( ( ( "Can't<seq2seq4repair_space>get<seq2seq4repair_space>Pit:<seq2seq4repair_space>" + pn ) + "<seq2seq4repair_space>by<seq2seq4repair_space>Name." ) ) ; } } if ( pit == null ) { System . out . println ( "Pit<seq2seq4repair_space>is<seq2seq4repair_space>null.." ) ; } else if ( ( pit . getUser ( ) ) == null ) { System . out . println ( "Pit<seq2seq4repair_space>user<seq2seq4repair_space>is<seq2seq4repair_space>null." ) ; } System . out . println ( "setting<seq2seq4repair_space>dates." ) ; if ( otime > 1 ) { odate = new java . sql . Date ( otime ) ; } else { String dt = pit . getDateString ( ) ; if ( dt != null ) { odate = getDate ( dt ) ; } if ( odate == null ) { odate = new java . sql . Date ( System . currentTimeMillis ( ) ) ; } } System . out . println ( ( "Date:<seq2seq4repair_space>" + ( odate . toString ( ) ) ) ) ; stmt . setDate ( 2 , odate ) ; stmt . setDate ( 3 , new java . sql . Date ( System . currentTimeMillis ( ) ) ) ; System . out . println ( "setting<seq2seq4repair_space>elevation." ) ;

Fix:
String query = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>OCC_TABLE<seq2seq4repair_space>(OCC_DATA,<seq2seq4repair_space>OBS_DATE,<seq2seq4repair_space>TIMESTAMP,<seq2seq4repair_space>ELV_START,<seq2seq4repair_space>ELV_DEPOSIT,<seq2seq4repair_space>ASPECT,<seq2seq4repair_space>TYPE,<seq2seq4repair_space>TRIGGER_TYPE,<seq2seq4repair_space>TRIGGER_CODE,<seq2seq4repair_space>US_SIZE,<seq2seq4repair_space>CDN_SIZE,<seq2seq4repair_space>AVG_FRACTURE_DEPTH,<seq2seq4repair_space>MAX_FRACTURE_DEPTH,<seq2seq4repair_space>WEAK_LAYER_TYPE,<seq2seq4repair_space>WEAK_LAYER_HARDNESS,<seq2seq4repair_space>SNOW_PACK_TYPE,<seq2seq4repair_space>FRACTURE_WIDTH,<seq2seq4repair_space>FRACTURE_LENGTH,<seq2seq4repair_space>AV_LENGTH,<seq2seq4repair_space>AVG_START_ANGLE,<seq2seq4repair_space>MAX_START_ANGLE,<seq2seq4repair_space>MIN_START_ANGLE,<seq2seq4repair_space>ALPHA_ANGLE,<seq2seq4repair_space>DEPTH_DEPOSIT,<seq2seq4repair_space>LOC_NAME,<seq2seq4repair_space>LOC_ID,<seq2seq4repair_space>STATE,<seq2seq4repair_space>MTN_RANGE,<seq2seq4repair_space>LAT,<seq2seq4repair_space>LONGITUDE,<seq2seq4repair_space>NORTH,<seq2seq4repair_space>WEST,<seq2seq4repair_space>USERNAME,<seq2seq4repair_space>NAME,<seq2seq4repair_space>LOCAL_SERIAL,<seq2seq4repair_space>SHARE)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" ;