Buggy code:
public class BasicFunctionalityTest extends SolrTestCaseJ4 { public String getCoreName ( ) { } @ BeforeClass public static void beforeTests ( ) throws Exception { } @ Test public void testIgnoredFields ( ) throws Exception { } @ Test public void testSomeStuff ( ) throws Exception { SolrCore core = h . getCore ( ) ; <START_BUG> IndexWriter writer = ( ( org . apache . solr . update . DirectUpdateHandler2 ) ( core . getUpdateHandler ( ) ) ) . getIndexWriterProvider ( ) . getIndexWriter ( core ) ; <END_BUG> assertEquals ( "Mergefactor<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>picked<seq2seq4repair_space>up" , ( ( org . apache . lucene . index . LogMergePolicy ) ( writer . getConfig ( ) . getMergePolicy ( ) ) ) . getMergeFactor ( ) , 8 ) ; args . put ( VERSION , "2.2" ) ; assertQ ( "test<seq2seq4repair_space>query<seq2seq4repair_space>on<seq2seq4repair_space>empty<seq2seq4repair_space>index" , req ( "qlkciyopsbgzyvkylsjhchghjrdf" ) , "////result[@numFound='0']" ) ; assertU ( "deleting<seq2seq4repair_space>42<seq2seq4repair_space>for<seq2seq4repair_space>no<seq2seq4repair_space>reason<seq2seq4repair_space>at<seq2seq4repair_space>all" , delI ( "42" ) ) ; assertU ( "adding<seq2seq4repair_space>doc#42" , adoc ( "id" , "42" , "val_s" , "aa;bb" ) ) ; assertU ( "does<seq2seq4repair_space>commit<seq2seq4repair_space>work?" , commit ( ) ) ; assertQ ( "backslash<seq2seq4repair_space>escaping<seq2seq4repair_space>semicolon" , req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>val_s:aa\\;bb" ) , "////*[@numFound='1']" , "////int[@name='id'][.='42']" ) ; assertQ ( "quote<seq2seq4repair_space>escaping<seq2seq4repair_space>semicolon" , req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>val_s:\"aa;bb\"" ) , "////*[@numFound='1']" , "////int[@name='id'][.='42']" ) ; assertQ ( "no<seq2seq4repair_space>escaping<seq2seq4repair_space>semicolon" , req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>val_s:aa" ) , "////*[@numFound='0']" ) ; assertU ( delI ( "42" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:42" ) , "////*[@numFound='0']" ) ; assertU ( adoc ( "id" , "42" , "val_s" , "AAA" ) ) ; assertU ( adoc ( "id" , "42" , "val_s" , "BBB" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:42" ) , "////*[@numFound='1']" , "////str[.='BBB']" ) ; assertU ( adoc ( "id" , "42" , "val_s" , "CCC" ) ) ; assertU ( adoc ( "id" , "42" , "val_s" , "DDD" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:42" ) , "////*[@numFound='1']" , "////str[.='DDD']" ) ; String [ ] adds = new String [ ] { add ( doc ( "id" , "101" ) , "overwrite" , "true" ) , add ( doc ( "id" , "101" ) , "overwrite" , "true" ) , add ( doc ( "id" , "105" ) , "overwrite" , "false" ) , add ( doc ( "id" , "102" ) , "overwrite" , "true" ) , add ( doc ( "id" , "103" ) , "overwrite" , "false" ) , add ( doc ( "id" , "101" ) , "overwrite" , "true" ) } ; for ( String a : adds ) { assertU ( a , a ) ; } assertU ( commit ( ) ) ; assertQ ( req ( "q" , "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" , "rows" , "2147483647" ) , "////*[@numFound='4']" ) ; assertQ ( req ( "q" , "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>111]" , "rows" , "1147483647" ) , "////*[@numFound='4']" ) ; assertQ ( req ( "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" ) , "////*[@numFound='4']" ) ; assertU ( delI ( "102" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" ) , "////*[@numFound='3']" ) ; assertU ( delI ( "105" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" ) , "////*[@numFound='2']" ) ; assertU ( delQ ( "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" ) ) ; assertU ( commit ( ) ) ; assertQ ( req ( "id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]" ) , "////*[@numFound='0']" ) ; } @ Test public void testRequestHandlerBaseException ( ) { } @ Test public void testMultipleUpdatesPerAdd ( ) { } @ Test public void testDocBoost ( ) throws Exception { } @ Test public void testFieldBoost ( ) throws Exception { } @ Test public void testXMLWriter ( ) throws Exception { } @ Test public void testLocalSolrQueryRequestParams ( ) { } @ Test public void testKeywordTokenizerFactory ( ) { } @ Test public void testTermVectorFields ( ) { } @ Test public void testSolrParams ( ) throws Exception { } @ Test public void testDefaultFieldValues ( ) { } @ Test public void testTokenizer ( ) { } @ Test public void testConfigDefaults ( ) { } private String mkstr ( int len ) { } @ Test public void testNotLazyField ( ) throws IOException { } @ Test public void testLazyField ( ) throws IOException { } @ Test public void testDateMath ( ) { } public void testDateRoundtrip ( ) { } @ Test public void testPatternReplaceFilter ( ) { } @ Test public void testAbuseOfSort ( ) { } }

Fix:
IndexWriter writer = ( ( org . apache . solr . update . DirectUpdateHandler2 ) ( core . getUpdateHandler ( ) ) ) . getSolrCoreState ( ) . getIndexWriter ( core ) ;