Buggy code:
public static void assertTokenStreamContents ( TokenStream ts , String [ ] output , int [ ] startOffsets , int [ ] endOffsets ) throws IOException { } public static void assertTokenStreamContents ( TokenStream ts , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , Integer finalOffset ) throws IOException { } public static void assertTokenStreamContents ( TokenStream ts , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , int [ ] posIncrements ) throws IOException { } public static void assertTokenStreamContents ( TokenStream ts , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , int [ ] posIncrements , Integer finalOffset ) throws IOException { } public static void assertTokenStreamContents ( TokenStream ts , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , int [ ] posIncrements , int [ ] posLengths , Integer finalOffset ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , String [ ] types , int [ ] posIncrements ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , String [ ] types , int [ ] posIncrements , int [ ] posLengths ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , String [ ] types , int [ ] posIncrements , int [ ] posLengths , boolean offsetsAreCorrect ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , String [ ] types ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] posIncrements ) throws IOException { } public static void assertAnalyzesToPositions ( Analyzer a , String input , String [ ] output , int [ ] posIncrements , int [ ] posLengths ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] startOffsets , int [ ] endOffsets ) throws IOException { } public static void assertAnalyzesTo ( Analyzer a , String input , String [ ] output , int [ ] startOffsets , int [ ] endOffsets , int [ ] posIncrements ) throws IOException { } static void checkResetException ( Analyzer a , String input ) throws IOException { } public static void checkOneTerm ( Analyzer a , final String input , final String expected ) throws IOException { } public static void checkRandomData ( Random random , Analyzer a , int iterations ) throws IOException { } public static void checkRandomData ( Random random , Analyzer a , int iterations , int maxWordLength ) throws IOException { } public static void checkRandomData ( Random random , Analyzer a , int iterations , boolean simple ) throws IOException { } static class AnalysisThread extends Thread { final int iterations ; final int maxWordLength ; final long seed ; final Analyzer a ; final boolean useCharFilter ; final boolean simple ; final boolean offsetsAreCorrect ; final RandomIndexWriter iw ; public boolean failed ; AnalysisThread ( long seed , Analyzer a , int iterations , int maxWordLength , boolean useCharFilter , boolean simple , boolean offsetsAreCorrect , RandomIndexWriter iw ) { } @ Override public void run ( ) { } } public static void checkRandomData ( Random random , Analyzer a , int iterations , int maxWordLength , boolean simple ) throws IOException { } public static void checkRandomData ( Random random , Analyzer a , int iterations , int maxWordLength , boolean simple , boolean offsetsAreCorrect ) throws IOException { } private static void checkRandomData ( Random random , Analyzer a , int iterations , int maxWordLength , boolean useCharFilter , boolean simple , boolean offsetsAreCorrect , RandomIndexWriter iw ) throws IOException { final LineFileDocs docs = new LineFileDocs ( random ) ; Document doc = null ; Field field = null ; Field currentField = null ; StringReader bogus = new StringReader ( "" ) ; if ( iw != null ) { doc = new Document ( ) ; FieldType ft = new FieldType ( TextField . TYPE_NOT_STORED ) ; if ( random . nextBoolean ( ) ) { ft . setStoreTermVectors ( true ) ; ft . setStoreTermVectorOffsets ( random . nextBoolean ( ) ) ; ft . setStoreTermVectorPositions ( random . nextBoolean ( ) ) ; <START_BUG> if ( ( ft . storeTermVectorPositions ( ) ) && ( ! ( PREFLEX_IMPERSONATION_IS_ACTIVE ) ) ) { <END_BUG> ft . setStoreTermVectorPayloads ( random . nextBoolean ( ) ) ; } } if ( random . nextBoolean ( ) ) { ft . setOmitNorms ( true ) ; } String pf = _TestUtil . getPostingsFormat ( "dummy" ) ; boolean supportsOffsets = ! ( doesntSupportOffsets . contains ( pf ) ) ; switch ( random . nextInt ( 4 ) ) { case 0 : ft . setIndexOptions ( DOCS_ONLY ) ; break ; case 1 : ft . setIndexOptions ( DOCS_AND_FREQS ) ; break ; case 2 : ft . setIndexOptions ( DOCS_AND_FREQS_AND_POSITIONS ) ; break ; default : if ( supportsOffsets && offsetsAreCorrect ) { ft . setIndexOptions ( DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS ) ; } else { ft . setIndexOptions ( DOCS_AND_FREQS_AND_POSITIONS ) ; } } currentField = field = new Field ( "dummy" , bogus , ft ) ; doc . add ( currentField ) ; } try { for ( int i = 0 ;

Fix:
if ( ( ft . storeTermVectorPositions ( ) ) && ( ! ( OLD_FORMAT_IMPERSONATION_IS_ACTIVE ) ) ) {