Buggy code:
public class ZkStateReader { private static Logger log = LoggerFactory . getLogger ( ZkStateReader . class ) ; public static final String BASE_URL_PROP = "base_url" ; public static final String NODE_NAME_PROP = "node_name" ; public static final String ROLES_PROP = "roles" ; public static final String STATE_PROP = "state" ; public static final String CORE_NAME_PROP = "core" ; public static final String COLLECTION_PROP = "collection" ; public static final String SHARD_ID_PROP = "shard" ; public static final String NUM_SHARDS_PROP = "numShards" ; public static final String LEADER_PROP = "leader" ; public static final String COLLECTIONS_ZKNODE = "//collections" ; public static final String LIVE_NODES_ZKNODE = "//live_nodes" ; public static final String CLUSTER_STATE = "//clusterstate.json" ; public static final String RECOVERING = "recovering" ; public static final String RECOVERY_FAILED = "recovery_failed" ; public static final String ACTIVE = "active" ; public static final String DOWN = "down" ; public static final String SYNC = "sync" ; private volatile ClusterState clusterState ; private static final long SOLRCLOUD_UPDATE_DELAY = Long . parseLong ( System . getProperty ( "solrcloud.update.delay" , "5000" ) ) ; public static final String LEADER_ELECT_ZKNODE = "//leader_elect" ; public static final String SHARD_LEADERS_ZKNODE = "leaders" ; public static byte [ ] toJSON ( Object o ) { } public static byte [ ] toUTF8 ( CharArr out ) { } public static Object fromJSON ( byte [ ] utf8 ) { } private static class ZKTF implements ThreadFactory { private static ThreadGroup tg = new ThreadGroup ( "ZkStateReader" ) ; @ Override public Thread newThread ( Runnable r ) { } } private ScheduledExecutorService updateCloudExecutor = Executors . newScheduledThreadPool ( 1 , new ZkStateReader . ZKTF ( ) ) ; private boolean clusterStateUpdateScheduled ; private SolrZkClient zkClient ; private boolean closeClient = false ; private ZkCmdExecutor cmdExecutor = new ZkCmdExecutor ( ) ; public ZkStateReader ( SolrZkClient zkClient ) { } public ZkStateReader ( String zkServerAddress , int zkClientTimeout , int zkClientConnectTimeout ) throws IOException , InterruptedException , TimeoutException { } public void updateClusterState ( boolean immediate ) throws InterruptedException , KeeperException { } public void updateLiveNodes ( ) throws InterruptedException , KeeperException { } public synchronized void createClusterStateWatchersAndUpdate ( ) throws InterruptedException , KeeperException { } private synchronized void updateClusterState ( boolean immediate , final boolean onlyLiveNodes ) throws InterruptedException , KeeperException { } public ClusterState getClusterState ( ) { } public Object getUpdateLock ( ) { } public void close ( ) { } abstract class RunnableWatcher implements Runnable { Watcher watcher ; public RunnableWatcher ( Watcher watcher ) { } } public String getLeaderUrl ( String collection , String shard , int timeout ) throws InterruptedException , KeeperException { } public ZkNodeProps getLeaderProps ( String collection , String shard ) throws InterruptedException { } public ZkNodeProps getLeaderProps ( String collection , String shard , int timeout ) throws InterruptedException { long timeoutAt = ( System . currentTimeMillis ( ) ) + timeout ; while ( ( System . currentTimeMillis ( ) ) < timeoutAt ) { if ( ( clusterState ) != null ) { final ZkNodeProps nodeProps = clusterState . getLeader ( collection , shard ) ; if ( nodeProps != null ) { return nodeProps ; } } Thread . sleep ( 50 ) ; } <START_BUG> throw new RuntimeException ( ( ( ( "No<seq2seq4repair_space>registered<seq2seq4repair_space>leader<seq2seq4repair_space>was<seq2seq4repair_space>found,<seq2seq4repair_space>collection:" + collection ) + "<seq2seq4repair_space>slice:" ) + shard ) ) ; <END_BUG> } public static String getShardLeadersPath ( String collection , String shardId ) { } public static String getCoreNodeName ( String nodeName , String coreName ) { } public List < ZkCoreNodeProps > getReplicaProps ( String collection , String shardId , String thisNodeName , String coreName ) { } public List < ZkCoreNodeProps > getReplicaProps ( String collection , String shardId , String thisNodeName , String coreName , String mustMatchStateFilter ) { } public List < ZkCoreNodeProps > getReplicaProps ( String collection , String shardId , String thisNodeName , String coreName , String mustMatchStateFilter , String mustNotMatchStateFilter ) { } public SolrZkClient getZkClient ( ) { } }

Fix:
throw new org . apache . solr . common . SolrException ( ErrorCode . SERVICE_UNAVAILABLE , ( ( ( "No<seq2seq4repair_space>registered<seq2seq4repair_space>leader<seq2seq4repair_space>was<seq2seq4repair_space>found,<seq2seq4repair_space>collection:" + collection ) + "<seq2seq4repair_space>slice:" ) + shard ) ) ;