Buggy code:
public void setTopHypo ( ) { } public void keepKBest ( Set < Socket > leftSktSet , Set < Socket > rightSktSet , Map < List < Socket > , List < Hypothesis > > skt2hypos , boolean training ) { } private void addSocket ( Socket newskt , List < Socket > vec ) { } private void topKHypo ( Hypothesis [ ] toparr , List < Hypothesis > hypov ) { } private void genCandFeat ( Hypothesis onehypo , TagSample sen , int posi , Label lbl , Socket leftContextSkt , Socket rightContextSkt , Socket leftBoundSkt , Socket rigthBoundSkt ) { } private void genAdwaitFeatures ( Hypothesis onehypo , TagSample sen , int posi , Label lbl , Socket leftContextSkt , Socket rightContextSkt ) { } @ SuppressWarnings ( "unused" ) private void genExtraFeatures ( Hypothesis onehypo , TagSample sen , int posi , Label lbl , Socket leftContextSkt , Socket rightContextSkt ) { } private void genAdditionalFeatures ( Hypothesis onehypo , TagSample sen , int posi , Label lbl , Socket leftContextSkt , Socket rightContextSkt ) { } private void genAdditionalFeature ( Hypothesis onehypo , TagSample sen , int posi , Label lbl , Socket leftContextSkt , Socket rightContextSkt , FeatureDetail [ ] featDet ) { final StringBuilder lex = new StringBuilder ( 40 ) . append ( lbl . lbl ) ; int posiOffset ; boolean completed = true ; String detailString ; for ( FeatureDetail fd : featDet ) { completed = true ; posiOffset = posi + ( fd . offset ) ; lex . append ( fd . positionAndTagName ) ; if ( ( posiOffset >= ( sen . words . length ) ) || ( posiOffset < 0 ) ) { if ( ( fd . featureProperty ) == null ) { lex . append ( "@" ) ; } else { completed = false ; break ; } } else if ( fd . isWord ) { if ( ( fd . featureProperty ) == null ) { lex . append ( sen . words [ posiOffset ] . toLowerCase ( ) ) ; } else { detailString = fd . applyProperty ( sen . words [ posiOffset ] . toLowerCase ( ) ) ; if ( detailString == null ) { completed = false ; break ; } else { lex . append ( detailString ) ; } } } else if ( fd . isMainTag ) { if ( fd . isOnLeft ) { if ( ( leftContextSkt != null ) && ( ( leftContextSkt . sktLabel . size ( ) ) >= ( fd . distance ) ) ) { if ( ( fd . featureProperty ) == null ) { lex . append ( leftContextSkt . sktLabel . get ( ( ( leftContextSkt . sktLabel . size ( ) ) - ( fd . distance ) ) ) ) ; } else { detailString = fd . applyProperty ( leftContextSkt . sktLabel . get ( ( ( leftContextSkt . sktLabel . size ( ) ) - ( fd . distance ) ) ) . toString ( ) ) ; if ( detailString == null ) { completed = false ; break ; } else { lex . append ( detailString ) ; } } } else { completed = false ; break ; } } else { if ( ( rightContextSkt != null ) && ( ( rightContextSkt . sktLabel . size ( ) ) >= ( fd . distance ) ) ) { if ( ( fd . featureProperty ) == null ) { lex . append ( rightContextSkt . sktLabel . get ( ( ( fd . distance ) - 1 ) ) ) ; } else { detailString = fd . applyProperty ( rightContextSkt . sktLabel . get ( ( ( fd . distance ) - 1 ) ) . toString ( ) ) ; if ( detailString == null ) { completed = false ; break ; } else { lex . append ( detailString ) ; } } } else { completed = false ; break ; } } } else { if ( ( fd . featureProperty ) == null ) { lex . append ( fd . applyProperty ( sen . addTags [ fd . addFeatIndex ] [ posiOffset ] ) ) ; } else { <START_BUG> detailString = fd . applyProperty ( fd . applyProperty ( sen . addTags [ fd . addFeatIndex ] [ posiOffset ] ) ) ; <END_BUG> if ( detailString == null ) { completed = false ; break ; } else { lex . append ( detailString ) ; } } } } if ( completed ) { onehypo . features . add ( lex . toString ( ) ) ; } } private void genGazetteersFeatures ( Hypothesis onehypo , TagSample sen , int posi , Label lbl ) { } private void genDocumentLevelFeatures ( Hypothesis onehypo , TagSample sen , int posi , Label lbl ) { } private void genBarrierFeatures ( Hypothesis onehypo , Label lbl , Socket leftBoundSkt , Socket rigthBoundSkt ) { } private class SortedList { List < String > sortedList = new ArrayList < String > ( ) ; void add ( String element ) { } int size ( ) { } public String toString ( ) { } } public void display ( Appendable sb ) throws IOException { } public void retrieve ( Label [ ] tags , int leftBdSktID , int rightBdSktID ) { } private int getCompLeftSktID ( List < Socket > childLeftSkts , Socket parentLeftSkt ) { } private int getCompRightSktID ( List < Socket > childRightSkts , Socket parentRightSkt ) { } }

Fix:
detailString = fd . applyProperty ( sen . addTags [ fd . addFeatIndex ] [ posiOffset ] ) ;