Buggy code:
public class StackMapFrame { public static final int USED = 1 ; public static final int SAME_FRAME = 0 ; public static final int CHOP_FRAME = 1 ; public static final int APPEND_FRAME = 2 ; public static final int SAME_FRAME_EXTENDED = 3 ; public static final int FULL_FRAME = 4 ; public static final int SAME_LOCALS_1_STACK_ITEMS = 5 ; public static final int SAME_LOCALS_1_STACK_ITEMS_EXTENDED = 6 ; public int pc ; public int numberOfStackItems ; private int numberOfLocals ; public int localIndex ; public VerificationTypeInfo [ ] locals ; public VerificationTypeInfo [ ] stackItems ; private int numberOfDifferentLocals = - 1 ; public int tagBits ; public StackMapFrame ( int initialLocalSize ) { } public int getFrameType ( StackMapFrame prevFrame ) { } public void addLocal ( int resolvedPosition , VerificationTypeInfo info ) { } public void addStackItem ( VerificationTypeInfo info ) { } public void addStackItem ( TypeBinding binding ) { } public StackMapFrame duplicate ( ) { } public int numberOfDifferentLocals ( StackMapFrame prevFrame ) { if ( ( this . numberOfDifferentLocals ) != ( - 1 ) ) return this . numberOfDifferentLocals ; if ( prevFrame == null ) { this . numberOfDifferentLocals = 0 ; return 0 ; } VerificationTypeInfo [ ] prevLocals = prevFrame . locals ; VerificationTypeInfo [ ] currentLocals = this . locals ; int prevLocalsLength = ( prevLocals == null ) ? 0 : prevLocals . length ; int currentLocalsLength = ( currentLocals == null ) ? 0 : currentLocals . length ; int prevNumberOfLocals = prevFrame . getNumberOfLocals ( ) ; int currentNumberOfLocals = getNumberOfLocals ( ) ; int result = 0 ; if ( prevNumberOfLocals == 0 ) { if ( currentNumberOfLocals != 0 ) { result = currentNumberOfLocals ; int counter = 0 ; for ( int i = 0 ; ( i < currentLocalsLength ) && ( counter < currentNumberOfLocals ) ; i ++ ) { if ( ( currentLocals [ i ] ) != null ) { switch ( currentLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } } else if ( currentNumberOfLocals == 0 ) { int counter = 0 ; result = - prevNumberOfLocals ; for ( int i = 0 ; ( i < prevLocalsLength ) && ( counter < prevNumberOfLocals ) ; i ++ ) { if ( ( prevLocals [ i ] ) != null ) { switch ( prevLocals [ i ] . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : i ++ ; } counter ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } } else { int indexInPrevLocals = 0 ; int indexInCurrentLocals = 0 ; int currentLocalsCounter = 0 ; int prevLocalsCounter = 0 ; currentLocalsLoop : for ( ; ( indexInCurrentLocals < currentLocalsLength ) && ( currentLocalsCounter < currentNumberOfLocals ) ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal != null ) { currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } <START_BUG> for ( ; ( indexInPrevLocals < prevLocalsLength ) && ( prevLocalsCounter < prevNumberOfLocals ) ; indexInPrevLocals ++ ) { <END_BUG> VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal != null ) { prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } if ( ( equals ( prevLocal , currentLocal ) ) && ( indexInPrevLocals == indexInCurrentLocals ) ) { if ( result != 0 ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInPrevLocals ++ ; continue currentLocalsLoop ; } if ( currentLocal != null ) { result ++ ; } else { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } indexInCurrentLocals ++ ; break currentLocalsLoop ; } if ( currentLocalsCounter < currentNumberOfLocals ) { for ( ; ( indexInCurrentLocals < currentLocalsLength ) && ( currentLocalsCounter < currentNumberOfLocals ) ; indexInCurrentLocals ++ ) { VerificationTypeInfo currentLocal = currentLocals [ indexInCurrentLocals ] ; if ( currentLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result ++ ; currentLocalsCounter ++ ; switch ( currentLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInCurrentLocals ++ ; } } } else if ( prevLocalsCounter < prevNumberOfLocals ) { result = - result ; for ( ; ( indexInPrevLocals < prevLocalsLength ) && ( prevLocalsCounter < prevNumberOfLocals ) ; indexInPrevLocals ++ ) { VerificationTypeInfo prevLocal = prevLocals [ indexInPrevLocals ] ; if ( prevLocal == null ) { result = Integer . MAX_VALUE ; this . numberOfDifferentLocals = result ; return result ; } result -- ; prevLocalsCounter ++ ; switch ( prevLocal . id ( ) ) { case TypeIds . T_double : case TypeIds . T_long : indexInPrevLocals ++ ; } } } } this . numberOfDifferentLocals = result ; return result ; } public int getNumberOfLocals ( ) { } public int getOffsetDelta ( StackMapFrame prevFrame ) { } public String toString ( ) { } private void printFrame ( StringBuffer buffer , StackMapFrame frame ) { } private String print ( VerificationTypeInfo [ ] infos , int length ) { } public void putLocal ( int resolvedPosition , VerificationTypeInfo info ) { } public void replaceWithElementType ( ) { }

Fix:
if ( ( indexInPrevLocals < prevLocalsLength ) && ( prevLocalsCounter < prevNumberOfLocals ) ) {