Buggy code:
public class SQLExec extends JDBCTask { public static class DelimiterType extends EnumeratedAttribute { public static final String NORMAL = "normal" ; public static final String ROW = "row" ; public String [ ] getValues ( ) { } } private int goodSql = 0 ; private int totalSql = 0 ; private Connection conn = null ; private Union resources = new Union ( ) ; private Statement statement = null ; private File srcFile = null ; private String sqlCommand = "" ; private Vector transactions = new Vector ( ) ; private String delimiter = ";" ; private String delimiterType = SQLExec . DelimiterType . NORMAL ; private boolean print = false ; private boolean showheaders = true ; private File output = null ; private String onError = "abort" ; private String encoding = null ; private boolean append = false ; private boolean keepformat = false ; private boolean escapeProcessing = true ; public void setSrc ( File srcFile ) { } public void addText ( String sql ) { } public void addFileset ( FileSet set ) { } public void add ( ResourceCollection rc ) { } public SQLExec . Transaction createTransaction ( ) { } public void setEncoding ( String encoding ) { } public void setDelimiter ( String delimiter ) { } public void setDelimiterType ( SQLExec . DelimiterType delimiterType ) { } public void setPrint ( boolean print ) { } public void setShowheaders ( boolean showheaders ) { } public void setOutput ( File output ) { } public void setAppend ( boolean append ) { } public void setOnerror ( SQLExec . OnError action ) { } public void setKeepformat ( boolean keepformat ) { } public void setEscapeProcessing ( boolean enable ) { } public void execute ( ) throws BuildException { } protected void runStatements ( Reader reader , PrintStream out ) throws IOException , SQLException { StringBuffer sql = new StringBuffer ( ) ; String line ; BufferedReader in = new BufferedReader ( reader ) ; while ( ( line = in . readLine ( ) ) != null ) { if ( ! ( keepformat ) ) { line = line . trim ( ) ; } line = getProject ( ) . replaceProperties ( line ) ; if ( ! ( keepformat ) ) { if ( line . startsWith ( "////" ) ) { continue ; } if ( line . startsWith ( "--" ) ) { continue ; } StringTokenizer st = new StringTokenizer ( line ) ; if ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; if ( "REM" . equalsIgnoreCase ( token ) ) { continue ; } } } if ( ! ( keepformat ) ) { sql . append ( ( "<seq2seq4repair_space>" + line ) ) ; } else { sql . append ( ( "\n" + line ) ) ; } if ( ! ( keepformat ) ) { if ( ( line . indexOf ( "--" ) ) >= 0 ) { sql . append ( "\n" ) ; } } if ( ( ( delimiterType . equals ( SQLExec . DelimiterType . NORMAL ) ) && ( StringUtils . endsWith ( sql , delimiter ) ) ) || ( ( delimiterType . equals ( SQLExec . DelimiterType . ROW ) ) && ( line . equals ( delimiter ) ) ) ) { execSQL ( sql . substring ( 0 , ( ( sql . length ( ) ) - ( delimiter . length ( ) ) ) ) , out ) ; sql . replace ( 0 , sql . length ( ) , "" ) ; } } <START_BUG> if ( ! ( sql . equals ( "" ) ) ) { <END_BUG> execSQL ( sql . toString ( ) , out ) ; } } protected void execSQL ( String sql , PrintStream out ) throws SQLException { } protected void printResults ( PrintStream out ) throws SQLException { } protected void printResults ( ResultSet rs , PrintStream out ) throws SQLException { } public static class OnError extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public class Transaction { private Resource tSrcResource = null ; private String tSqlCommand = "" ; public void setSrc ( File src ) { } public void setSrcResource ( Resource src ) { } public void addText ( String sql ) { } public void addConfigured ( ResourceCollection a ) { } private void runTransaction ( PrintStream out ) throws IOException , SQLException { } } }

Fix:
if ( ( sql . length ( ) ) > 0 ) {