Buggy code:
public class SyntacticFeatureFactory implements Serializable { private static final long serialVersionUID = 1L ; public int TOKEN_START = 1 ; public int TOKEN_END = 2 ; public int TOKEN_MID = 3 ; public int TOKEN_QUOTE = 4 ; public int TOKEN_RRB = 5 ; public int TOKEN_LRB = 6 ; public Options options ; public double [ ] [ ] wordVectors = null ; public double [ ] unknownWv = null ; public int tagNumBits ; public int wordNumBits ; public int depNumBits ; public int disNumBits = 4 ; public int labelNumBits ; public int flagBits ; public int ccDepType ; public final int numArcFeats = 115911564 ; public final int numLabeledArcFeats = 115911564 ; public int numWordFeats ; private boolean stoppedGrowth ; private TLongHashSet featureHashSet ; private Alphabet wordAlphabet ; public SyntacticFeatureFactory ( Options options ) { } public void closeAlphabets ( ) { } public void initFeatureAlphabets ( DependencyInstance inst ) { int n = inst . length ; for ( int i = 0 ; i < n ; ++ i ) createWordFeatures ( inst , i ) ; int [ ] heads = inst . heads ; int [ ] deplbids = inst . deplbids ; DependencyArcList arcLis = new DependencyArcList ( heads , options . useHO ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( ( heads [ i ] ) == ( - 1 ) ) continue ; int parent = heads [ i ] ; createArcFeatures ( inst , parent , i ) ; if ( options . learnLabel ) { int type = deplbids [ i ] ; boolean toRight = parent < i ; <START_BUG> createLabelFeatures ( inst , arcLis , i , type ) ; <END_BUG> } } if ( ( options . learningMode ) != ( LearningMode . Basic ) ) { for ( int h = 0 ; h < n ; ++ h ) { int st = arcLis . startIndex ( h ) ; int ed = arcLis . endIndex ( h ) ; for ( int p = st ; ( p + 1 ) < ed ; ++ p ) { int m = arcLis . get ( p ) ; int s = arcLis . get ( ( p + 1 ) ) ; if ( options . useCS ) { createTripsFeatureVector ( inst , h , m , s ) ; createSibFeatureVector ( inst , m , s ) ; } int gp = heads [ h ] ; if ( ( options . useGS ) && ( gp >= 0 ) ) { createGPSibFeatureVector ( inst , gp , h , m , s ) ; } if ( ( options . useTS ) && ( ( p + 2 ) < ed ) ) { int s2 = arcLis . get ( ( p + 2 ) ) ; createTriSibFeatureVector ( inst , h , m , s , s2 ) ; } if ( options . usePSC ) { int mst = arcLis . startIndex ( m ) ; int med = arcLis . endIndex ( m ) ; for ( int mp = mst ; mp < med ; ++ mp ) { int c = arcLis . get ( mp ) ; createPSCFeatureVector ( inst , h , m , c , s ) ; } int sst = arcLis . startIndex ( s ) ; int sed = arcLis . endIndex ( s ) ; for ( int sp = sst ; sp < sed ; ++ sp ) { int c = arcLis . get ( sp ) ; createPSCFeatureVector ( inst , h , s , c , m ) ; } } } } for ( int m = 1 ; m < n ; ++ m ) { int h = heads [ m ] ; Utils . Assert ( ( h >= 0 ) ) ; int gp = heads [ h ] ; if ( ( options . useGP ) && ( gp != ( - 1 ) ) ) { createGPCFeatureVector ( inst , gp , h , m ) ; } if ( ( options . useHB ) && ( ( m + 1 ) < n ) ) { int h2 = heads [ ( m + 1 ) ] ; Utils . Assert ( ( h2 >= 0 ) ) ; createHeadBiFeatureVector ( inst , m , h , h2 ) ; } if ( ( ( options . useGGP ) && ( gp != ( - 1 ) ) ) && ( ( heads [ gp ] ) != ( - 1 ) ) ) { int ggp = heads [ gp ] ; createGGPCFeatureVector ( inst , ggp , gp , h , m ) ; } } if ( options . useHO ) { FeatureVector fv = new FeatureVector ( numArcFeats ) ; int [ ] toks = inst . formids ; int [ ] pos = inst . postagids ; int [ ] posA = inst . cpostagids ; SpecialPos [ ] specialPos = inst . specialPos ; int [ ] spanLeft = arcLis . left ; int [ ] spanRight = arcLis . right ; long code = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( ( SpecialPos . P ) == ( specialPos [ i ] ) ) { int par = heads [ i ] ; int [ ] c = findPPArg ( inst . heads , inst . specialPos , arcLis , i ) ; for ( int z = 0 ; z < ( c . length ) ;

Fix:
createLabelFeatures ( inst , arcLis , heads , i , type ) ;