Buggy code:
public class LukeRequestHandler extends RequestHandlerBase { private static Logger log = Logger . getLogger ( LukeRequestHandler . class . getName ( ) ) ; 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 ; @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private static String getFieldFlags ( Fieldable 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 { } @ SuppressWarnings ( "unchecked" ) private static SimpleOrderedMap < Object > getIndexedFieldsInfo ( final SolrIndexSearcher searcher , final Set < String > fields , final int numTerms ) throws Exception { Query matchAllDocs = new MatchAllDocsQuery ( ) ; SolrQueryParser qp = searcher . getSchema ( ) . getSolrQueryParser ( null ) ; IndexReader reader = searcher . getReader ( ) ; IndexSchema schema = searcher . getSchema ( ) ; Map < String , LukeRequestHandler . TopTermQueue > ttinfo = null ; if ( numTerms > 0 ) { ttinfo = LukeRequestHandler . getTopTerms ( reader , fields , numTerms , null ) ; } SimpleOrderedMap < Object > finfo = new SimpleOrderedMap < Object > ( ) ; Collection < String > fieldNames = reader . getFieldNames ( ALL ) ; for ( String fieldName : fieldNames ) { if ( ( fields != null ) && ( ! ( fields . contains ( fieldName ) ) ) ) { continue ; } SimpleOrderedMap < Object > f = new SimpleOrderedMap < Object > ( ) ; SchemaField sfield = schema . getFieldOrNull ( fieldName ) ; FieldType ftype = ( sfield == null ) ? null : sfield . getType ( ) ; f . add ( "type" , ( ftype == null ? null : ftype . getTypeName ( ) ) ) ; f . add ( "schema" , LukeRequestHandler . getFieldFlags ( sfield ) ) ; <START_BUG> if ( ( schema . getDynamicPattern ( sfield . getName ( ) ) ) != null ) { <END_BUG> f . add ( "dynamicBase" , schema . getDynamicPattern ( sfield . getName ( ) ) ) ; } if ( ( ( ttinfo != null ) && ( sfield != null ) ) && ( sfield . indexed ( ) ) ) { Query q = qp . parse ( ( fieldName + ":[*<seq2seq4repair_space>TO<seq2seq4repair_space>*]" ) ) ; int docCount = searcher . numDocs ( q , matchAllDocs ) ; if ( docCount > 0 ) { DocList ds = searcher . getDocList ( q , ( ( Query ) ( null ) ) , ( ( Sort ) ( null ) ) , 0 , 1 ) ; try { Document doc = searcher . doc ( ds . iterator ( ) . next ( ) ) ; Fieldable fld = doc . getFieldable ( fieldName ) ; if ( fld != null ) { f . add ( "index" , LukeRequestHandler . getFieldFlags ( fld ) ) ; } else { f . add ( "index" , "(unstored<seq2seq4repair_space>field)" ) ; } } catch ( Exception ex ) { LukeRequestHandler . log . warning ( ( "error<seq2seq4repair_space>reading<seq2seq4repair_space>field:<seq2seq4repair_space>" + fieldName ) ) ; } } f . add ( "docs" , docCount ) ; LukeRequestHandler . TopTermQueue topTerms = ttinfo . get ( fieldName ) ; if ( topTerms != null ) { f . add ( "distinct" , topTerms . distinctTerms ) ; f . add ( "topTerms" , topTerms . toNamedList ( searcher . getSchema ( ) ) ) ; f . add ( "histogram" , topTerms . histogram . toNamedList ( ) ) ; } } finfo . add ( fieldName , f ) ; } return finfo ; } 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 , SimpleOrderedMap < Object > fields , SchemaField uniqueField , SchemaField f ) { } public static SimpleOrderedMap < Object > getIndexInfo ( IndexReader reader , boolean countTerms ) throws IOException { } @ Override public String getDescription ( ) { } @ Override public String getVersion ( ) { } @ Override public String getSourceId ( ) { } @ Override public String getSource ( ) { } @ Override public URL [ ] getDocs ( ) { } private static class TermHistogram { int maxBucket = - 1 ; public Map < Integer , Integer > hist = new HashMap < Integer , Integer > ( ) ; private static final double LOG2 = Math . log ( 2 ) ; public static int getPowerOfTwoBucket ( int num ) { } public void add ( int df ) { } 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 ) { } } private static Map < String , LukeRequestHandler . TopTermQueue > getTopTerms ( IndexReader reader , Set < String > fields , int numTerms , Set < String > junkWords ) throws Exception { } }

Fix:
if ( ( sfield != null ) && ( ( schema . getDynamicPattern ( sfield . getName ( ) ) ) != null ) ) {