Buggy code:
public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAware { private static final Logger LOG = LoggerFactory . getLogger ( ReplicationHandler . class . getName ( ) ) ; SolrCore core ; private SnapPuller snapPuller ; private ReentrantLock snapPullLock = new ReentrantLock ( ) ; private String includeConfFiles ; private NamedList < String > confFileNameAlias = new NamedList < String > ( ) ; private boolean isMaster = false ; private boolean isSlave = false ; private boolean replicateOnOptimize = false ; private boolean replicateOnCommit = false ; private boolean replicateOnStart = false ; private int numberBackupsToKeep = 0 ; private int numTimesReplicated = 0 ; private final Map < String , ReplicationHandler . FileInfo > confFileInfoCache = new HashMap < String , ReplicationHandler . FileInfo > ( ) ; private Integer reserveCommitDuration = SnapPuller . readInterval ( "00:00:10" ) ; private volatile IndexCommit indexCommitPoint ; volatile NamedList < Object > snapShootDetails ; private AtomicBoolean replicationEnabled = new AtomicBoolean ( true ) ; @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private List < NamedList < Object > > getCommits ( ) { } private void getFileChecksum ( SolrParams solrParams , SolrQueryResponse rsp ) { } private Map < String , Long > getCheckSums ( String [ ] files , File dir , Checksum checksum ) { } static Long getCheckSum ( Checksum checksum , File f ) { } private volatile SnapPuller tempSnapPuller ; public boolean doFetch ( SolrParams solrParams , boolean forceReplication ) { } boolean isReplicating ( ) { } private void doSnapShoot ( SolrParams params , SolrQueryResponse rsp , SolrQueryRequest req ) { } private void getFileStream ( SolrParams solrParams , SolrQueryResponse rsp ) { } @ SuppressWarnings ( "unchecked" ) private void getFileList ( SolrParams solrParams , SolrQueryResponse rsp ) { } List < Map < String , Object > > getConfFileInfoFromCache ( NamedList < String > nameAndAlias , final Map < String , ReplicationHandler . FileInfo > confFileInfoCache ) { } static class FileInfo { long lastmodified ; String name ; long size ; long checksum ; public FileInfo ( long lasmodified , String name , long size , long checksum ) { } Map < String , Object > getAsMap ( ) { } } void disablePoll ( ) { } void enablePoll ( ) { } boolean isPollingDisabled ( ) { } int getTimesReplicatedSinceStartup ( ) { } void setTimesReplicatedSinceStartup ( ) { } long getIndexSize ( ) { <START_BUG> return FileUtils . sizeOfDirectory ( new File ( core . getIndexDir ( ) ) ) ; <END_BUG> } private Map < String , Object > getFileInfo ( File file ) { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } private long [ ] getIndexVersion ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public NamedList getStatistics ( ) { } private NamedList < Object > getReplicationDetails ( boolean showSlaveDetails ) { } private void addVal ( NamedList < Object > nl , String key , Properties props , Class clzz ) { } private List < String > getReplicateAfterStrings ( ) { } private long getTimeElapsed ( SnapPuller snapPuller ) { } Properties loadReplicationProperties ( ) { } @ SuppressWarnings ( "unchecked" ) public void inform ( SolrCore core ) { } private boolean isEnabled ( NamedList params ) { } private void registerCloseHook ( ) { } private void registerFileStreamResponseWriter ( ) { } private SolrEventListener getEventListener ( final boolean snapshoot , final boolean getCommit ) { } private class FileStream { private SolrParams params ; private FastOutputStream fos ; private Long indexGen ; private IndexDeletionPolicyWrapper delPolicy ; public FileStream ( SolrParams solrParams ) { } public void write ( OutputStream out ) throws IOException { } private void writeNothing ( ) throws IOException { } } public static final String MASTER_URL = "masterUrl" ; public static final String STATUS = "status" ; public static final String COMMAND = "command" ; public static final String CMD_DETAILS = "details" ; public static final String CMD_BACKUP = "backup" ; public static final String CMD_FETCH_INDEX = "fetchindex" ; public static final String CMD_ABORT_FETCH = "abortfetch" ; public static final String CMD_GET_FILE_LIST = "filelist" ; public static final String CMD_GET_FILE = "filecontent" ; public static final String CMD_FILE_CHECKSUM = "filechecksum" ; public static final String CMD_DISABLE_POLL = "disablepoll" ; public static final String CMD_DISABLE_REPL = "disablereplication" ; public static final String CMD_ENABLE_REPL = "enablereplication" ; public static final String CMD_ENABLE_POLL = "enablepoll" ; public static final String CMD_INDEX_VERSION = "indexversion" ; public static final String CMD_SHOW_COMMITS = "commits" ; public static final String GENERATION = "generation" ; public static final String OFFSET = "offset" ; public static final String LEN = "len" ; public static final String FILE = "file" ; public static final String NAME = "name" ; public static final String SIZE = "size" ; public static final String LAST_MODIFIED = "lastmodified" ; public static final String CONF_FILE_SHORT = "cf" ; public static final String CHECKSUM = "checksum" ; public static final String ALIAS = "alias" ; public static final String CONF_CHECKSUM = "confchecksum" ; public static final String CONF_FILES = "confFiles" ; public static final String REPLICATE_AFTER = "replicateAfter" ; public static final String FILE_STREAM = "filestream" ; public static final int PACKET_SZ = 1024 * 1024 ; public static final String RESERVE = "commitReserveDuration" ; public static final String COMPRESSION = "compression" ; public static final String EXTERNAL = "external" ; public static final String INTERNAL = "internal" ; public static final String ERR_STATUS = "ERROR" ; public static final String OK_STATUS = "OK" ; public static final String NEXT_EXECUTION_AT = "nextExecutionAt" ; public static final String NUMBER_BACKUPS_TO_KEEP_REQUEST_PARAM = "numberToKeep" ; public static final String NUMBER_BACKUPS_TO_KEEP_INIT_PARAM = "maxNumberOfBackups" ; }

Fix:
return FileUtils . sizeOfDirectory ( new File ( core . getNewIndexDir ( ) ) ) ;