Buggy code:
public final class ZkController { private static Logger log = LoggerFactory . getLogger ( ZkController . class ) ; static final String NEWL = System . getProperty ( "line.separator" ) ; private static final Pattern URL_POST = Pattern . compile ( "https?:////(.*)" ) ; private static final Pattern URL_PREFIX = Pattern . compile ( "(https?:////).*" ) ; static final String CONFIGS_ZKNODE = "//configs" ; public static final String COLLECTION_PARAM_PREFIX = "collection." ; public static final String CONFIGNAME_PROP = "configName" ; private final HashMap < String , CoreState > coreStates = new HashMap < String , CoreState > ( ) ; private SolrZkClient zkClient ; private ZkStateReader zkStateReader ; private LeaderElector leaderElector ; private String zkServerAddress ; private String localHostPort ; private String localHostContext ; private String localHostName ; private String localHost ; private String hostName ; private OverseerElector overseerElector ; private int numShards ; private Map < String , CoreAssignment > assignments = new HashMap < String , CoreAssignment > ( ) ; private RecoveryStrat recoveryStrat = new RecoveryStrat ( ) ; public static void main ( String [ ] args ) throws Exception { } public ZkController ( String zkServerAddress , int zkClientTimeout , int zkClientConnectTimeout , String localHost , String locaHostPort , String localHostContext , int numShards , final CurrentCoreDescriptorProvider registerOnReconnect ) throws IOException , InterruptedException , TimeoutException { } public void close ( ) { } public boolean configFileExists ( String collection , String fileName ) throws InterruptedException , KeeperException { } public CloudState getCloudState ( ) { } public byte [ ] getConfigFileData ( String zkConfigName , String fileName ) throws InterruptedException , KeeperException { } private String getHostAddress ( ) throws IOException { } public String getHostName ( ) { } public SolrZkClient getZkClient ( ) { } public String getZkServerAddress ( ) { } private void init ( ) { } private String getAssignmentsNode ( ) { } private void createEphemeralLiveNode ( ) throws InterruptedException , KeeperException { } public String getNodeName ( ) { } public boolean pathExists ( String path ) throws InterruptedException , KeeperException { } public String readConfigName ( String collection ) throws IOException , InterruptedException , KeeperException { } public String register ( String coreName , final CoreDescriptor desc ) throws Exception { } private void publishAsActive ( String shardUrl , final CloudDescriptor cloudDesc , String shardZkNodeName , String shardId ) { } private boolean getShardId ( final CoreDescriptor desc , CloudState state , String shardZkNodeName ) { } private void doLeaderElectionProcess ( ElectionContext context ) throws IOException , InterruptedException , KeeperException { } public void unregister ( String coreName , CloudDescriptor cloudDesc ) { } public void uploadToZK ( File dir , String zkPath ) throws IOException , InterruptedException , KeeperException { File [ ] files = dir . listFiles ( ) ; for ( File file : files ) { if ( ! ( file . getName ( ) . startsWith ( "." ) ) ) { if ( ! ( file . isDirectory ( ) ) ) { <START_BUG> zkClient . setData ( ( ( zkPath + "//" ) + ( file . getName ( ) ) ) , file ) ; <END_BUG> } else { uploadToZK ( file , ( ( zkPath + "//" ) + ( file . getName ( ) ) ) ) ; } } } } public void uploadConfigDir ( File dir , String configName ) throws IOException , InterruptedException , KeeperException { } void printLayoutToStdOut ( ) throws InterruptedException , KeeperException { } private void setUpCollectionsNode ( ) throws InterruptedException , KeeperException { } private void setupOverseerNodes ( ) throws InterruptedException , KeeperException { } public void createCollectionZkNode ( CloudDescriptor cd ) throws IOException , InterruptedException , KeeperException { } public ZkStateReader getZkStateReader ( ) { } private void publishState ( CloudDescriptor cloudDesc , String shardZkNodeName , Map < String , String > props ) { } private String doGetShardIdProcess ( String coreName , CloudDescriptor descriptor ) { } private void processAssignmentsUpdate ( byte [ ] assignments ) throws IOException { } public RecoveryStrat getRecoveryStrat ( ) { } }

Fix:
zkClient . makePath ( ( ( zkPath + "//" ) + ( file . getName ( ) ) ) , file ) ;