Buggy code:
public int getLabelID ( String s ) { } public List < Feature > getFeatures ( Configuration c , Map < Integer , double [ ] > featureEmbedding ) { List < Feature > fWord = new ArrayList < Feature > ( 18 ) ; List < Feature > fPos = new ArrayList < Feature > ( 18 ) ; List < Feature > fLabel = new ArrayList < Feature > ( 12 ) ; List < Feature > fAdditional = new ArrayList < Feature > ( 18 ) ; for ( int j = 2 ; j >= 0 ; -- j ) { int index = c . getStack ( j ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; } for ( int j = 0 ; j <= 2 ; ++ j ) { int index = c . getBuffer ( j ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; } for ( int j = 0 ; j <= 1 ; ++ j ) { int k = c . getStack ( j ) ; int index = c . getLeftChild ( k ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; index = c . getRightChild ( k ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; index = c . getLeftChild ( k , 2 ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; index = c . getRightChild ( k , 2 ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; index = c . getLeftChild ( c . getLeftChild ( k ) ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; index = c . getRightChild ( c . getRightChild ( k ) ) ; fWord . add ( new Feature . WordFeature ( getWordID ( c . getWord ( index ) ) ) ) ; fPos . add ( new Feature . POSFeature ( getPosID ( c . getPOS ( index ) ) ) ) ; fLabel . add ( new Feature . ArcFeature ( getLabelID ( c . getLabel ( index ) ) ) ) ; } List < Feature > features = new ArrayList < > ( 48 ) ; features . addAll ( fWord ) ; features . addAll ( fPos ) ; features . addAll ( fLabel ) ; <START_BUG> if ( ( featureEmbedding != null ) && ( ! ( featureEmbedding . isEmpty ( ) ) ) ) { <END_BUG> Feature . loadEmbeddings ( features , classifier . getE ( ) ) ; if ( config . featureModeReplace ) { for ( Feature feature : features ) { if ( featureEmbedding . containsKey ( feature . getId ( ) ) ) { feature . overWriteEmbedding ( featureEmbedding . get ( feature . getId ( ) ) ) ; } } } else { for ( Feature feature : fWord ) { if ( featureEmbedding . containsKey ( feature . getId ( ) ) ) { fAdditional . add ( new Feature . AdditionalFeature ( featureEmbedding . get ( feature . getId ( ) ) ) ) ; } } features . addAll ( fAdditional ) ; } } return features ; } private static final int POS_OFFSET = 18 ; private static final int DEP_OFFSET = 36 ; private static final int STACK_OFFSET = 6 ; private static final int STACK_NUMBER = 6 ; public Dataset genTrainExamples ( List < CoreMap > sents , List < DependencyTree > trees ) { } private void generateIDs ( ) { } private void genDictionaries ( List < CoreMap > sents , List < DependencyTree > trees ) { } public void writeModelFile ( String modelFile ) { } public static DependencyParser loadFromModelFile ( String modelFile ) { } public static DependencyParser loadFromModelFile ( String modelFile , Properties extraProperties ) { } public void loadModelFile ( String modelFile ) { }

Fix:
if ( featureEmbedding != null ) {