Buggy code:
public class LukeRequestHandler extends RequestHandlerBase { private static Logger log = LoggerFactory . getLogger ( LukeRequestHandler . class ) ; public static final String NUMTERMS = "numTerms" ; public static final String DOC_ID = "docId" ; public static final String ID = "id" ; public static final int DEFAULT_COUNT = 10 ; static final int HIST_ARRAY_SIZE = 33 ; private static enum ShowStyle { ALL , DOC , SCHEMA , INDEX ; public static LukeRequestHandler . ShowStyle get ( String v ) { } } @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private static String getFieldFlags ( IndexableField f ) { } private static String getFieldFlags ( SchemaField f ) { } public static SimpleOrderedMap < String > getFieldFlagsKey ( ) { } private static SimpleOrderedMap < Object > getDocumentFieldsInfo ( Document doc , int docId , IndexReader reader , IndexSchema schema ) throws IOException { } private static SimpleOrderedMap < Object > getIndexedFieldsInfo ( SolrQueryRequest req ) throws Exception { } private static Document getFirstLiveDoc ( AtomicReader reader , String fieldName , Terms terms ) throws IOException { } private static SimpleOrderedMap < Object > getSchemaInfo ( IndexSchema schema ) { } private static SimpleOrderedMap < Object > getAnalyzerInfo ( Analyzer analyzer ) { } private static void populateFieldInfo ( IndexSchema schema , Map < String , List < String > > typeusemap , Map < String , Object > fields , SchemaField uniqueField , SchemaField f ) { } public static SimpleOrderedMap < Object > getIndexInfo ( DirectoryReader reader , boolean detail ) throws IOException { } public static SimpleOrderedMap < Object > getIndexInfo ( DirectoryReader reader ) throws IOException { Directory dir = reader . directory ( ) ; SimpleOrderedMap < Object > indexInfo = new SimpleOrderedMap < Object > ( ) ; indexInfo . add ( "numDocs" , reader . numDocs ( ) ) ; indexInfo . add ( "maxDoc" , reader . maxDoc ( ) ) ; indexInfo . add ( "version" , reader . getVersion ( ) ) ; <START_BUG> indexInfo . add ( "segmentCount" , reader . getTopReaderContext ( ) . leaves ( ) . size ( ) ) ; <END_BUG> indexInfo . add ( "current" , reader . isCurrent ( ) ) ; indexInfo . add ( "hasDeletions" , reader . hasDeletions ( ) ) ; indexInfo . add ( "directory" , dir ) ; indexInfo . add ( "userData" , reader . getIndexCommit ( ) . getUserData ( ) ) ; String s = reader . getIndexCommit ( ) . getUserData ( ) . get ( COMMIT_TIME_MSEC_KEY ) ; if ( s != null ) { indexInfo . add ( "lastModified" , new Date ( Long . parseLong ( s ) ) ) ; } return indexInfo ; } @ SuppressWarnings ( "unchecked" ) private static void getDetailedFieldInfo ( SolrQueryRequest req , String field , SimpleOrderedMap < Object > fieldMap ) throws IOException { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } @ Override public URL [ ] getDocs ( ) { } static class TermHistogram { int _maxBucket = - 1 ; int [ ] _buckets = new int [ LukeRequestHandler . HIST_ARRAY_SIZE ] ; public void add ( int [ ] buckets ) { } public NamedList < Integer > toNamedList ( ) { } } private static class TopTermQueue extends PriorityQueue { static class TermInfo { TermInfo ( Term t , int df ) { } int docFreq ; Term term ; } public int minFreq = 0 ; public int distinctTerms = 0 ; public LukeRequestHandler . TermHistogram histogram ; TopTermQueue ( int size ) { } @ Override protected final boolean lessThan ( Object a , Object b ) { } public NamedList < Integer > toNamedList ( IndexSchema schema ) { } public LukeRequestHandler . TopTermQueue . TermInfo getTopTermInfo ( ) { } } }

Fix:
indexInfo . add ( "segmentCount" , reader . leaves ( ) . size ( ) ) ;