Buggy code:
public class SnapPuller { private static final Logger LOG = LoggerFactory . getLogger ( SnapPuller . class . getName ( ) ) ; private final String masterUrl ; private final ReplicationHandler . ReplicationHandler replicationHandler ; private final Integer pollInterval ; private String pollIntervalStr ; private ScheduledExecutorService executorService ; private volatile long executorStartTime ; private volatile long replicationStartTime ; private final SolrCore solrCore ; private volatile List < Map < String , Object > > filesToDownload ; private volatile List < Map < String , Object > > confFilesToDownload ; private volatile List < Map < String , Object > > filesDownloaded ; private volatile List < Map < String , Object > > confFilesDownloaded ; private volatile Map < String , Object > currentFile ; private volatile SnapPuller . FileFetcher fileFetcher ; private volatile ExecutorService fsyncService ; private volatile boolean stop = false ; private boolean useInternal = false ; private boolean useExternal = false ; private AtomicBoolean pollDisabled = new AtomicBoolean ( false ) ; private static HttpClient client ; private final HttpClient myHttpClient ; private static synchronized HttpClient createHttpClient ( String connTimeout , String readTimeout , String httpBasicAuthUser , String httpBasicAuthPassword , boolean useCompression ) { } public SnapPuller ( final NamedList initArgs , final ReplicationHandler . ReplicationHandler handler , final SolrCore sc ) { } private void startExecutorService ( ) { } @ SuppressWarnings ( "unchecked" ) NamedList getLatestVersion ( ) throws IOException { } private void fetchFileList ( long gen ) throws IOException { } private boolean successfulInstall = false ; @ SuppressWarnings ( "unchecked" ) boolean fetchLatestIndex ( SolrCore core , boolean force ) throws IOException , InterruptedException { } private volatile Exception fsyncException ; private void terminateAndWaitFsyncService ( ) throws Exception { } private void logReplicationTimeAndConfFiles ( Collection < Map < String , Object > > modifiedConfFiles , boolean successfulInstall ) { } static long getTotalBytesDownloaded ( SnapPuller snappuller ) { } private StringBuffer readToStringBuffer ( long replicationTime , String str ) { } private void doCommit ( ) throws IOException { SolrQueryRequest req = new org . apache . solr . request . LocalSolrQueryRequest ( solrCore , new ModifiableSolrParams ( ) ) ; <START_BUG> solrCore . getUpdateHandler ( ) . newIndexWriter ( ) ; <END_BUG> try { Future [ ] waitSearcher = new Future [ 1 ] ; solrCore . getSearcher ( true , false , waitSearcher , true ) ; if ( ( waitSearcher [ 0 ] ) != null ) { try { waitSearcher [ 0 ] . get ( ) ; } catch ( InterruptedException e ) { SolrException . log ( SnapPuller . LOG , e ) ; } catch ( ExecutionException e ) { SolrException . log ( SnapPuller . LOG , e ) ; } } solrCore . getUpdateHandler ( ) . commit ( new org . apache . solr . update . CommitUpdateCommand ( req , false ) ) ; } finally { req . close ( ) ; } } private File createTempindexDir ( SolrCore core ) { } private void reloadCore ( ) { } private void downloadConfFiles ( List < Map < String , Object > > confFilesToDownload , long latestGeneration ) throws Exception { } private void downloadIndexFiles ( boolean downloadCompleteIndex , File tmpIdxDir , long latestGeneration ) throws Exception { } private boolean isIndexStale ( ) { } private boolean copyAFile ( File tmpIdxDir , File indexDir , String fname , List < String > copiedfiles ) { } private boolean copyIndexFiles ( File tmpIdxDir , File indexDir ) { } private void copyTmpConfFiles2Conf ( File tmpconfDir ) { } private String getDateAsStr ( Date d ) { } private boolean modifyIndexProps ( String tmpIdxDirName ) { } private final Map < String , FileInfo > confFileInfoCache = new HashMap < String , FileInfo > ( ) ; private Collection < Map < String , Object > > getModifiedConfFiles ( List < Map < String , Object > > confFilesToDownload ) { } static boolean delTree ( File dir ) { } void disablePoll ( ) { } void enablePoll ( ) { } void abortPull ( ) { } long getReplicationStartTime ( ) { } List < Map < String , Object > > getConfFilesToDownload ( ) { } List < Map < String , Object > > getConfFilesDownloaded ( ) { } List < Map < String , Object > > getFilesToDownload ( ) { } List < Map < String , Object > > getFilesDownloaded ( ) { } Map < String , Object > getCurrentFile ( ) { } boolean isPollingDisabled ( ) { } Long getNextScheduledExecTime ( ) { } private static class ReplicationHandlerException extends InterruptedException { public ReplicationHandlerException ( String message ) { } } private class FileFetcher { boolean includeChecksum = true ; private File copy2Dir ; String fileName ; String saveAs ; long size ; long lastmodified ; long bytesDownloaded = 0 ; FileChannel fileChannel ; private FileOutputStream fileOutputStream ; byte [ ] buf = new byte [ 1024 * 1024 ] ; Checksum checksum ; File file ; int errorCount = 0 ; private boolean isConf ; private boolean aborted = false ; private Long indexGen ; FileFetcher ( File dir , Map < String , Object > fileDetails , String saveAs , boolean isConf , long latestGen ) throws IOException { } void fetchFile ( ) throws Exception { } private int fetchPackets ( FastInputStream fis ) throws Exception { } private int readInt ( byte [ ] b ) { } private long readLong ( byte [ ] b ) { } private void cleanup ( ) { } FastInputStream getStream ( ) throws IOException { } } NamedList getDetails ( ) throws IOException , SolrServerException { } static Integer readInterval ( String interval ) { } public void destroy ( ) { } String getMasterUrl ( ) { } String getPollInterval ( ) { } private static final int MAX_RETRIES = 5 ;

Fix:
solrCore . getUpdateHandler ( ) . newIndexWriter ( true ) ;