Buggy code:
public final class SegmentInfo implements Cloneable { private static final int CHECK_FIELDINFO = - 2 ; static final int NO = - 1 ; static final int YES = 1 ; static final int WITHOUT_GEN = 0 ; public String name ; public int docCount ; public Directory dir ; private long delGen ; private Map < Integer , Long > normGen ; private boolean isCompoundFile ; private volatile List < String > files ; private volatile long sizeInBytesNoStore = - 1 ; private volatile long sizeInBytesWithStore = - 1 ; private int docStoreOffset ; private String docStoreSegment ; private boolean docStoreIsCompoundFile ; private int delCount ; private int hasVectors = SegmentInfo . CHECK_FIELDINFO ; private int hasProx = SegmentInfo . CHECK_FIELDINFO ; private FieldInfos fieldInfos ; private SegmentCodecs segmentCodecs ; private Map < String , String > diagnostics ; private String version ; private long bufferedDeletesGen ; private long fieldInfosVersion ; public SegmentInfo ( String name , int docCount , Directory dir , boolean isCompoundFile , SegmentCodecs segmentCodecs , FieldInfos fieldInfos ) { } void reset ( SegmentInfo src ) { } void setDiagnostics ( Map < String , String > diagnostics ) { } public Map < String , String > getDiagnostics ( ) { } public SegmentInfo ( Directory dir , int format , IndexInput input , CodecProvider codecs ) throws IOException { } synchronized void loadFieldInfos ( Directory dir , boolean checkCompoundFile ) throws IOException { } public long sizeInBytes ( boolean includeDocStores ) throws IOException { } public boolean getHasVectors ( ) throws IOException { } public FieldInfos getFieldInfos ( ) throws IOException { } public boolean hasDeletions ( ) { } void advanceDelGen ( ) { } void clearDelGen ( ) { } @ Override public Object clone ( ) { } public String getDelFileName ( ) { } public boolean hasSeparateNorms ( int fieldNumber ) { } public boolean hasSeparateNorms ( ) { } void initNormGen ( ) { } void advanceNormGen ( int fieldIndex ) { } public String getNormFileName ( int number ) { if ( hasSeparateNorms ( number ) ) { <START_BUG> return IndexFileNames . fileNameFromGeneration ( name , ( "s" + number ) , normGen . get ( number ) ) ; <END_BUG> } else { return IndexFileNames . fileNameFromGeneration ( name , NORMS_EXTENSION , SegmentInfo . WITHOUT_GEN ) ; } } void setUseCompoundFile ( boolean isCompoundFile ) { } public boolean getUseCompoundFile ( ) { } public int getDelCount ( ) { } void setDelCount ( int delCount ) { } @ Deprecated public int getDocStoreOffset ( ) { } @ Deprecated public boolean getDocStoreIsCompoundFile ( ) { } @ Deprecated public void setDocStoreIsCompoundFile ( boolean docStoreIsCompoundFile ) { } @ Deprecated void setDocStore ( int offset , String segment , boolean isCompoundFile ) { } @ Deprecated public String getDocStoreSegment ( ) { } @ Deprecated void setDocStoreOffset ( int offset ) { } @ Deprecated public void setDocStoreSegment ( String docStoreSegment ) { } public void write ( IndexOutput output ) throws IOException { } public boolean getHasProx ( ) throws IOException { } public void setSegmentCodecs ( SegmentCodecs segmentCodecs ) { } SegmentCodecs getSegmentCodecs ( ) { } private void addIfExists ( Set < String > files , String fileName ) throws IOException { } public List < String > files ( ) throws IOException { } private void clearFilesCache ( ) { } @ Override public String toString ( ) { } public String toString ( Directory dir , int pendingDelCount ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public void setVersion ( String version ) { } public String getVersion ( ) { } long getBufferedDeletesGen ( ) { } void setBufferedDeletesGen ( long v ) { } }

Fix:
return IndexFileNames . fileNameFromGeneration ( name , ( ( IndexFileNames . SEPARATE_NORMS_EXTENSION ) + number ) , normGen . get ( number ) ) ;