Buggy code:
} public static class QPTestParser extends StandardQueryParser { public QPTestParser ( Analyzer a ) { } private static class QPTestParserQueryNodeProcessor extends QueryNodeProcessorImpl { @ Override protected QueryNode postProcessNode ( QueryNode node ) throws QueryNodeException { } @ Override protected QueryNode preProcessNode ( QueryNode node ) throws QueryNodeException { } @ Override protected List < QueryNode > setChildrenOrder ( List < QueryNode > children ) throws QueryNodeException { } } } private int originalMaxClauses ; @ Override public void setUp ( ) throws Exception { } public StandardQueryParser getParser ( Analyzer a ) throws Exception { } public Query getQuery ( String query , Analyzer a ) throws Exception { } public Query getQueryAllowLeadingWildcard ( String query , Analyzer a ) throws Exception { } public void assertQueryEquals ( String query , Analyzer a , String result ) throws Exception { } public void assertQueryEqualsAllowLeadingWildcard ( String query , Analyzer a , String result ) throws Exception { } public void assertQueryEquals ( StandardQueryParser qp , String field , String query , String result ) throws Exception { } public void assertEscapedQueryEquals ( String query , Analyzer a , String result ) throws Exception { } public void assertWildcardQueryEquals ( String query , boolean lowercase , String result , boolean allowLeadingWildcard ) throws Exception { } public void assertWildcardQueryEquals ( String query , boolean lowercase , String result ) throws Exception { } public void assertWildcardQueryEquals ( String query , String result ) throws Exception { } public Query getQueryDOA ( String query , Analyzer a ) throws Exception { } public void assertQueryEqualsDOA ( String query , Analyzer a , String result ) throws Exception { } public void testConstantScoreAutoRewrite ( ) throws Exception { } public void testCJK ( ) throws Exception { } private class SimpleCJKTokenizer extends Tokenizer { private CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; public SimpleCJKTokenizer ( ) { } @ Override public boolean incrementToken ( ) throws IOException { } } private class SimpleCJKAnalyzer extends Analyzer { @ Override public TokenStreamComponents createComponents ( String fieldName ) { } } public void testCJKTerm ( ) throws Exception { } public void testCJKBoostedTerm ( ) throws Exception { } public void testCJKPhrase ( ) throws Exception { } public void testCJKBoostedPhrase ( ) throws Exception { } public void testCJKSloppyPhrase ( ) throws Exception { } public void testSimple ( ) throws Exception { } public void testPunct ( ) throws Exception { } public void testGroup ( ) throws Exception { } public void testSlop ( ) throws Exception { } public void testNumber ( ) throws Exception { } public void testWildcard ( ) throws Exception { } public void testLeadingWildcardType ( ) throws Exception { } public void testQPA ( ) throws Exception { } public void testRange ( ) throws Exception { } private String getDate ( String s , DateTools . Resolution resolution ) throws Exception { } private String getDate ( Date d , DateTools . Resolution resolution ) { } private String escapeDateString ( String s ) { } private String getLocalizedDate ( int year , int month , int day ) { } public void testDateRange ( ) throws Exception { } public void assertDateRangeQueryEquals ( StandardQueryParser qp , String field , String startDate , String endDate , Date endDateInclusive , DateTools . Resolution resolution ) throws Exception { } public void testEscaped ( ) throws Exception { } public void testQueryStringEscaping ( ) throws Exception { } @ Ignore ( "flexible<seq2seq4repair_space>queryparser<seq2seq4repair_space>shouldn't<seq2seq4repair_space>escape<seq2seq4repair_space>wildcard<seq2seq4repair_space>terms" ) public void testEscapedWildcard ( ) throws Exception { } public void testTabNewlineCarriageReturn ( ) throws Exception { } public void testSimpleDAO ( ) throws Exception { } public void testBoost ( ) throws Exception { } public void assertQueryNodeException ( String queryString ) throws Exception { } public void testException ( ) throws Exception { } public void testCustomQueryParserWildcard ( ) { } public void testCustomQueryParserFuzzy ( ) throws Exception { } public void testBooleanQuery ( ) throws Exception { } public void testPrecedence ( ) throws Exception { } public void testStarParsing ( ) throws Exception { } public void testRegexps ( ) throws Exception { } public void testStopwords ( ) throws Exception { } public void testPositionIncrement ( ) throws Exception { } public void testMatchAllDocs ( ) throws Exception { } private void assertHits ( int expected , String query , IndexSearcher is ) throws IOException , QueryNodeException { } @ Override public void tearDown ( ) throws Exception { } private class CannedTokenizer extends Tokenizer { private int upto = 0 ; private final PositionIncrementAttribute posIncr = addAttribute ( PositionIncrementAttribute . class ) ; private final CharTermAttribute term = addAttribute ( CharTermAttribute . class ) ; public CannedTokenizer ( ) { } @ Override public boolean incrementToken ( ) { } @ Override public void reset ( ) throws IOException { } } private class CannedAnalyzer extends Analyzer { @ Override public TokenStreamComponents createComponents ( String ignored ) { } } public void testMultiPhraseQuery ( ) throws Exception { Directory dir = newDirectory ( ) ; IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new TestQPHelper . CannedAnalyzer ( ) ) ) ; Document doc = new Document ( ) ; doc . add ( newTextField ( "field" , "" , NO ) ) ; w . addDocument ( doc ) ; IndexReader r = DirectoryReader . open ( w , true ) ; IndexSearcher s = newSearcher ( r ) ; Query q = new StandardQueryParser ( new TestQPHelper . CannedAnalyzer ( ) ) . parse ( "\"a\"" , "field" ) ; assertTrue ( ( q instanceof MultiPhraseQuery ) ) ; assertEquals ( 1 , s . search ( q , 10 ) . totalHits ) ; r . close ( ) ; <START_BUG> w . close ( ) ; <END_BUG> dir . close ( ) ; } public void testRegexQueryParsing ( ) throws Exception { } }

Fix:
w . shutdown ( ) ;