Buggy code:
private static final Set EXTENDED_ENGLISH_STOP_WORDS = PatternAnalyzer . makeStopSet ( new String [ ] { "a" , "about" , "above" , "across" , "adj" , "after" , "afterwards" , "again" , "against" , "albeit" , "all" , "almost" , "alone" , "along" , "already" , "also" , "although" , "always" , "among" , "amongst" , "an" , "and" , "another" , "any" , "anyhow" , "anyone" , "anything" , "anywhere" , "are" , "around" , "as" , "at" , "be" , "became" , "because" , "become" , "becomes" , "becoming" , "been" , "before" , "beforehand" , "behind" , "being" , "below" , "beside" , "besides" , "between" , "beyond" , "both" , "but" , "by" , "can" , "cannot" , "co" , "could" , "down" , "during" , "each" , "eg" , "either" , "else" , "elsewhere" , "enough" , "etc" , "even" , "ever" , "every" , "everyone" , "everything" , "everywhere" , "except" , "few" , "first" , "for" , "former" , "formerly" , "from" , "further" , "had" , "has" , "have" , "he" , "hence" , "her" , "here" , "hereafter" , "hereby" , "herein" , "hereupon" , "hers" , "herself" , "him" , "himself" , "his" , "how" , "however" , "i" , "ie" , "if" , "in" , "inc" , "indeed" , "into" , "is" , "it" , "its" , "itself" , "last" , "latter" , "latterly" , "least" , "less" , "ltd" , "many" , "may" , "me" , "meanwhile" , "might" , "more" , "moreover" , "most" , "mostly" , "much" , "must" , "my" , "myself" , "namely" , "neither" , "never" , "nevertheless" , "next" , "no" , "nobody" , "none" , "noone" , "nor" , "not" , "nothing" , "now" , "nowhere" , "of" , "off" , "often" , "on" , "once<seq2seq4repair_space>one" , "only" , "onto" , "or" , "other" , "others" , "otherwise" , "our" , "ours" , "ourselves" , "out" , "over" , "own" , "per" , "perhaps" , "rather" , "s" , "same" , "seem" , "seemed" , "seeming" , "seems" , "several" , "she" , "should" , "since" , "so" , "some" , "somehow" , "someone" , "something" , "sometime" , "sometimes" , "somewhere" , "still" , "such" , "t" , "than" , "that" , "the" , "their" , "them" , "themselves" , "then" , "thence" , "there" , "thereafter" , "thereby" , "therefor" , "therein" , "thereupon" , "these" , "they" , "this" , "those" , "though" , "through" , "throughout" , "thru" , "thus" , "to" , "together" , "too" , "toward" , "towards" , "under" , "until" , "up" , "upon" , "us" , "very" , "via" , "was" , "we" , "well" , "were" , "what" , "whatever" , "whatsoever" , "when" , "whence" , "whenever" , "whensoever" , "where" , "whereafter" , "whereas" , "whereat" , "whereby" , "wherefrom" , "wherein" , "whereinto" , "whereof" , "whereon" , "whereto" , "whereunto" , "whereupon" , "wherever" , "wherewith" , "whether" , "which" , "whichever" , "whichsoever" , "while" , "whilst" , "whither" , "who" , "whoever" , "whole" , "whom" , "whomever" , "whomsoever" , "whose" , "whosoever" , "why" , "will" , "with" , "within" , "without" , "would" , "xsubj" , "xcal" , "xauthor" , "xother<seq2seq4repair_space>" , "xnote" , "yet" , "you" , "your" , "yours" , "yourself" , "yourselves" } ) ; public static final PatternAnalyzer DEFAULT_ANALYZER = new PatternAnalyzer ( PatternAnalyzer . NON_WORD_PATTERN , true , PatternAnalyzer . makeStopSet ( ENGLISH_STOP_WORDS ) ) ; public static final PatternAnalyzer EXTENDED_ANALYZER = new PatternAnalyzer ( PatternAnalyzer . NON_WORD_PATTERN , true , PatternAnalyzer . EXTENDED_ENGLISH_STOP_WORDS ) ; private final Pattern pattern ; private final boolean toLowerCase ; private final Set stopWords ; public PatternAnalyzer ( Pattern pattern , boolean toLowerCase , Set stopWords ) { } public TokenStream tokenStream ( String fieldName , String text ) { } public TokenStream tokenStream ( String fieldName , Reader reader ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } private static boolean eq ( Object o1 , Object o2 ) { } private static boolean eqPattern ( Pattern p1 , Pattern p2 ) { } private static String toString ( Reader input ) throws IOException { try { int len = 256 ; char [ ] buffer = new char [ len ] ; char [ ] output = new char [ len ] ; len = 0 ; int n ; while ( ( n = input . read ( buffer ) ) >= 0 ) { if ( ( len + n ) > ( output . length ) ) { char [ ] tmp = new char [ Math . max ( ( ( output . length ) << 1 ) , ( len + n ) ) ] ; System . arraycopy ( output , 0 , tmp , 0 , len ) ; System . arraycopy ( buffer , 0 , tmp , len , n ) ; buffer = output ; output = tmp ; } else { System . arraycopy ( buffer , 0 , output , len , n ) ; } len += n ; } <START_BUG> return new String ( output , 0 , output . length ) ; <END_BUG> } finally { if ( input != null ) input . close ( ) ; } } private static Set makeStopSet ( String [ ] stopWords ) { } private static final class PatternTokenizer extends TokenStream { private final String str ; private final boolean toLowerCase ; private Matcher matcher ; private int pos = 0 ; private static final Locale locale = Locale . getDefault ( ) ; public PatternTokenizer ( String str , Pattern pattern , boolean toLowerCase ) { } public Token next ( ) { } } private static final class FastStringTokenizer extends TokenStream { private final String str ; private int pos ;

Fix:
return new String ( output , 0 , len ) ;