Buggy code:
public class SnapShooter { private static final Logger LOG = LoggerFactory . getLogger ( SnapShooter . class . getName ( ) ) ; private String snapDir = null ; private SolrCore solrCore ; private SimpleFSLockFactory lockFactory ; public SnapShooter ( SolrCore core , String location ) { } void createSnapAsync ( final IndexCommit indexCommit , final ReplicationHandler replicationHandler ) { } void createSnapAsync ( final IndexCommit indexCommit , final int numberToKeep , final ReplicationHandler replicationHandler ) { } void createSnapshot ( final IndexCommit indexCommit , int numberToKeep , ReplicationHandler replicationHandler ) { SnapShooter . LOG . info ( "Creating<seq2seq4repair_space>backup<seq2seq4repair_space>snapshot..." ) ; NamedList < Object > details = new NamedList < Object > ( ) ; details . add ( "startTime" , new Date ( ) . toString ( ) ) ; File snapShotDir = null ; String directoryName = null ; Lock lock = null ; try { if ( numberToKeep < ( Integer . MAX_VALUE ) ) { deleteOldBackups ( numberToKeep ) ; } SimpleDateFormat fmt = new SimpleDateFormat ( SnapShooter . DATE_FMT , Locale . ROOT ) ; directoryName = "snapshot." + ( fmt . format ( new Date ( ) ) ) ; lock = lockFactory . makeLock ( ( directoryName + ".lock" ) ) ; if ( lock . isLocked ( ) ) return ; snapShotDir = new File ( snapDir , directoryName ) ; if ( ! ( snapShotDir . mkdir ( ) ) ) { SnapShooter . LOG . warn ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>snapshot<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( snapShotDir . getAbsolutePath ( ) ) ) ) ; return ; } Collection < String > files = indexCommit . getFileNames ( ) ; SnapShooter . FileCopier fileCopier = new SnapShooter . FileCopier ( ) ; <START_BUG> Directory dir = solrCore . getDirectoryFactory ( ) . get ( solrCore . getNewIndexDir ( ) , DEFAULT , solrCore . getSolrConfig ( ) . indexConfig . lockType ) ; <END_BUG> try { fileCopier . copyFiles ( dir , files , snapShotDir ) ; } finally { solrCore . getDirectoryFactory ( ) . release ( dir ) ; } details . add ( "fileCount" , files . size ( ) ) ; details . add ( "status" , "success" ) ; details . add ( "snapshotCompletedAt" , new Date ( ) . toString ( ) ) ; } catch ( Exception e ) { SnapPuller . delTree ( snapShotDir ) ; SnapShooter . LOG . error ( "Exception<seq2seq4repair_space>while<seq2seq4repair_space>creating<seq2seq4repair_space>snapshot" , e ) ; details . add ( "snapShootException" , e . getMessage ( ) ) ; } finally { replicationHandler . core . getDeletionPolicy ( ) . releaseCommitPoint ( indexCommit . getGeneration ( ) ) ; replicationHandler . snapShootDetails = details ; if ( lock != null ) { try { lock . release ( ) ; } catch ( IOException e ) { SnapShooter . LOG . error ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>release<seq2seq4repair_space>snapshoot<seq2seq4repair_space>lock:<seq2seq4repair_space>" + directoryName ) + ".lock" ) ) ; } } } } private void deleteOldBackups ( int numberToKeep ) { } private class OldBackupDirectory implements Comparable < SnapShooter . OldBackupDirectory > { File dir ; Date timestamp ; final Pattern dirNamePattern = Pattern . compile ( "^snapshot[.](.*)$" ) ; OldBackupDirectory ( File dir ) { } @ Override public int compareTo ( SnapShooter . OldBackupDirectory that ) { } } public static final String SNAP_DIR = "snapDir" ; public static final String DATE_FMT = "yyyyMMddHHmmssSSS" ; private class FileCopier { public void copyFiles ( Directory sourceDir , Collection < String > files , File destDir ) throws IOException { } public void copyFile ( Directory sourceDir , String indexFile , File destination , Directory destDir ) throws IOException { } } }

Fix:
Directory dir = solrCore . getDirectoryFactory ( ) . get ( solrCore . getIndexDir ( ) , DEFAULT , solrCore . getSolrConfig ( ) . indexConfig . lockType ) ;