Buggy code:
public class BasicZkTest extends AbstractZkTestCase { @ BeforeClass public static void beforeClass ( ) { } @ Test public void testBasic ( ) throws Exception { assertTrue ( "Not<seq2seq4repair_space>using<seq2seq4repair_space>ZooKeeper" , h . getCoreContainer ( ) . isZooKeeperAware ( ) ) ; ZkController zkController = h . getCoreContainer ( ) . getZkController ( ) ; 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 ( ) ) ; int zkPort = zkServer . getPort ( ) ; zkServer . shutdown ( ) ; Thread . sleep ( 300 ) ; zkServer = new ZkTestServer ( zkDir , zkPort ) ; zkServer . run ( ) ; Thread . sleep ( 300 ) ; assertTrue ( zkController . getCloudState ( ) . getLiveNodes ( ) . toString ( ) , zkController . getCloudState ( ) . liveNodesContain ( zkController . getNodeName ( ) ) ) ; 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']" ) ; zkController . getZkClient ( ) . setData ( "//configs//conf1//solrconfig.xml" , new byte [ 0 ] ) ; try { SolrTestCaseJ4 . ignoreException ( "SAXParseException" ) ; h . getCoreContainer ( ) . reload ( h . getCore ( ) . getName ( ) ) ; SolrTestCaseJ4 . resetExceptionIgnores ( ) ; fail ( "The<seq2seq4repair_space>reloaded<seq2seq4repair_space>SolrCore<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>pick<seq2seq4repair_space>up<seq2seq4repair_space>configs<seq2seq4repair_space>from<seq2seq4repair_space>zookeeper" ) ; } catch ( SAXParseException e ) { } } @ AfterClass public static void afterClass ( ) { } }

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