Buggy code:
public class HTMLParser implements HTMLParserConstants { public static int SUMMARY_LENGTH = 200 ; StringBuffer title = new StringBuffer ( HTMLParser . SUMMARY_LENGTH ) ; StringBuffer summary = new StringBuffer ( ( ( HTMLParser . SUMMARY_LENGTH ) * 2 ) ) ; Properties metaTags = new Properties ( ) ; String currentMetaTag = null ; String currentMetaContent = null ; int length = 0 ; boolean titleComplete = false ; boolean inTitle = false ; boolean inMetaTag = false ; boolean inStyle = false ; boolean afterTag = false ; boolean afterSpace = false ; String eol = System . getProperty ( "line.separator" ) ; Reader pipeIn = null ; Writer pipeOut ; private HTMLParser . MyPipedInputStream pipeInStream = null ; private PipedOutputStream pipeOutStream = null ; private class MyPipedInputStream extends PipedInputStream { public MyPipedInputStream ( ) { } public MyPipedInputStream ( PipedOutputStream src ) throws IOException { } public boolean full ( ) throws IOException { } } public String getTitle ( ) throws IOException , InterruptedException { } public Properties getMetaTags ( ) throws IOException , InterruptedException { } public String getSummary ( ) throws IOException , InterruptedException { if ( ( pipeIn ) == null ) getReader ( ) ; while ( true ) { synchronized ( this ) { if ( ( ( summary . length ( ) ) >= ( HTMLParser . SUMMARY_LENGTH ) ) || ( pipeInStream . full ( ) ) ) break ; wait ( 10 ) ; } } if ( ( summary . length ( ) ) > ( HTMLParser . SUMMARY_LENGTH ) ) summary . setLength ( HTMLParser . SUMMARY_LENGTH ) ; String sum = summary . toString ( ) . trim ( ) ; String tit = getTitle ( ) ; <START_BUG> if ( ( sum . startsWith ( tit ) ) || ( sum . equals ( "" ) ) ) <END_BUG> return tit ; else return sum ; } public Reader getReader ( ) throws IOException { } void addToSummary ( String text ) { } void addText ( String text ) throws IOException { } void addMetaTag ( ) { } void addSpace ( ) throws IOException { } public final void HTMLDocument ( ) throws IOException , ParseException { } public final void Tag ( ) throws IOException , ParseException { } public final Token ArgValue ( ) throws ParseException { } public final Token Decl ( ) throws ParseException { } public final void CommentTag ( ) throws ParseException { } public final void ScriptTag ( ) throws ParseException { } private boolean jj_2_1 ( int xla ) { } private boolean jj_2_2 ( int xla ) { } private boolean jj_3_2 ( ) { } private boolean jj_3_1 ( ) { } public HTMLParserTokenManager token_source ; SimpleCharStream jj_input_stream ; public Token token ; public Token jj_nt ; private int jj_ntk ; private Token jj_scanpos ; private Token jj_lastpos ; private int jj_la ; private int jj_gen ; private final int [ ] jj_la1 = new int [ 14 ] ; private static int [ ] jj_la1_0 ; private static void jj_la1_init_0 ( ) { } private final HTMLParser . JJCalls [ ] jj_2_rtns = new HTMLParser . JJCalls [ 2 ] ; private boolean jj_rescan = false ; private int jj_gc = 0 ; public HTMLParser ( InputStream stream ) { } public HTMLParser ( InputStream stream , String encoding ) { } public void ReInit ( InputStream stream ) { } public void ReInit ( InputStream stream , String encoding ) { } public HTMLParser ( Reader stream ) { } public void ReInit ( Reader stream ) { } public HTMLParser ( HTMLParserTokenManager tm ) { } public void ReInit ( HTMLParserTokenManager tm ) { } private Token jj_consume_token ( int kind ) throws ParseException { } private static final class LookaheadSuccess extends Error { } private final HTMLParser . LookaheadSuccess jj_ls = new HTMLParser . LookaheadSuccess ( ) ; private boolean jj_scan_token ( int kind ) { } public final Token getNextToken ( ) { } public final Token getToken ( int index ) { } private int jj_ntk ( ) { } private List < int [ ] > jj_expentries = new ArrayList < int [ ] > ( ) ; private int [ ] jj_expentry ; private int jj_kind = - 1 ; private int [ ] jj_lasttokens = new int [ 100 ] ; private int jj_endpos ; private void jj_add_error_token ( int kind , int pos ) { } public ParseException generateParseException ( ) { } public final void enable_tracing ( ) { } public final void disable_tracing ( ) { } private void jj_rescan_token ( ) { } private void jj_save ( int index , int xla ) { } static final class JJCalls { int gen ; Token first ; int arg ; HTMLParser . JJCalls next ; } }

Fix:
if ( sum . equals ( "" ) )