Buggy code:
public class Label { public CodeStream codeStream ; static final int POS_NOT_SET = - 1 ; public int position = Label . POS_NOT_SET ; public int [ ] forwardReferences = new int [ 10 ] ; public int forwardReferenceCount = 0 ; private boolean isWide = false ; public Label ( ) { } public Label ( CodeStream codeStream ) { } void addForwardReference ( int iPos ) { } public void appendForwardReferencesFrom ( Label otherLabel ) { } void branch ( ) { } void branchWide ( ) { } public boolean hasForwardReferences ( ) { } public void inlineForwardReferencesFromLabelsTargeting ( int gotoLocation ) { } public boolean isStandardLabel ( ) { } public void place ( ) { if ( ( position ) == ( Label . POS_NOT_SET ) ) { position = codeStream . position ; codeStream . addLabel ( this ) ; int oldPosition = position ; boolean isOptimizedBranch = false ; if ( ( forwardReferenceCount ) != 0 ) { <START_BUG> isOptimizedBranch = ( ( ( forwardReferences [ ( ( forwardReferenceCount ) - 1 ) ] ) + 2 ) == ( position ) ) && ( ( codeStream . bCodeStream [ ( ( codeStream . classFileOffset ) - 3 ) ] ) == ( OPC_goto ) ) ; <END_BUG> if ( isOptimizedBranch ) { codeStream . position = position -= 3 ; codeStream . classFileOffset -= 3 ; ( forwardReferenceCount ) -- ; int index = ( codeStream . pcToSourceMapSize ) - 2 ; if ( ( codeStream . lastEntryPC ) == oldPosition ) { codeStream . lastEntryPC = position ; } if ( ( index >= 0 ) && ( ( codeStream . pcToSourceMap [ index ] ) == ( position ) ) ) { codeStream . pcToSourceMapSize -= 2 ; } if ( codeStream . generateLocalVariableTableAttributes ) { LocalVariableBinding [ ] locals = codeStream . locals ; for ( int i = 0 , max = locals . length ; i < max ; i ++ ) { LocalVariableBinding local = locals [ i ] ; if ( ( local != null ) && ( ( local . initializationCount ) > 0 ) ) { if ( ( local . initializationPCs [ ( ( ( ( local . initializationCount ) - 1 ) << 1 ) + 1 ) ] ) == oldPosition ) { local . initializationPCs [ ( ( ( ( local . initializationCount ) - 1 ) << 1 ) + 1 ) ] = position ; } if ( ( local . initializationPCs [ ( ( ( local . initializationCount ) - 1 ) << 1 ) ] ) == oldPosition ) { local . initializationPCs [ ( ( ( local . initializationCount ) - 1 ) << 1 ) ] = position ; } } } } } } for ( int i = 0 ; i < ( forwardReferenceCount ) ; i ++ ) { int offset = ( ( position ) - ( forwardReferences [ i ] ) ) + 1 ; if ( ( ( Math . abs ( offset ) ) > 32767 ) && ( ! ( this . codeStream . wideMode ) ) ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE ) ; } if ( this . codeStream . wideMode ) { if ( this . isWide ) { codeStream . writeSignedWord ( forwardReferences [ i ] , offset ) ; } else { codeStream . writeSignedShort ( forwardReferences [ i ] , ( ( short ) ( offset ) ) ) ; } } else { codeStream . writeSignedShort ( forwardReferences [ i ] , ( ( short ) ( offset ) ) ) ; } } if ( isOptimizedBranch ) { for ( int i = 0 ; i < ( codeStream . countLabels ) ; i ++ ) { Label label = codeStream . labels [ i ] ; if ( oldPosition == ( label . position ) ) { label . position = position ; if ( label instanceof CaseLabel ) { int offset = ( position ) - ( ( ( CaseLabel ) ( label ) ) . instructionPosition ) ; for ( int j = 0 ; j < ( label . forwardReferenceCount ) ; j ++ ) { int forwardPosition = label . forwardReferences [ j ] ; codeStream . writeSignedWord ( forwardPosition , offset ) ; } } else { for ( int j = 0 ; j < ( label . forwardReferenceCount ) ; j ++ ) { int forwardPosition = label . forwardReferences [ j ] ; int offset = ( ( position ) - forwardPosition ) + 1 ; if ( ( ( Math . abs ( offset ) ) > 32767 ) && ( ! ( this . codeStream . wideMode ) ) ) { throw new AbortMethod ( CodeStream . RESTART_IN_WIDE_MODE ) ; } if ( this . codeStream . wideMode ) { if ( this . isWide ) { codeStream . writeSignedWord ( forwardPosition , offset ) ; } else { codeStream . writeSignedShort ( forwardPosition , ( ( short ) ( offset ) ) ) ; } } else { codeStream . writeSignedShort ( forwardPosition , ( ( short ) ( offset ) ) ) ; } } } } } } } } public String toString ( ) { } public void resetStateForCodeGeneration ( ) { } }

Fix:
isOptimizedBranch = ( ( ( forwardReferences [ ( ( forwardReferenceCount ) - 1 ) ] ) + 2 ) == ( position ) ) && ( ( codeStream . bCodeStream [ ( ( codeStream . classFileOffset ) - 3 ) ] ) == ( Opcodes . OPC_goto ) ) ;