Buggy code:
public class NLPToolsContextPreprocessor extends BaseContextPreprocessor implements IAsyncContextPreprocessor { private static final Logger log = LoggerFactory . getLogger ( NLPToolsContextPreprocessor . class ) ; private final ILabelPipeline pipeline ; private final DefaultContextPreprocessor dcp ; private int fallbackCount ; public NLPToolsContextPreprocessor ( ILabelPipeline pipeline , ILinguisticOracle linguisticOracle ) { } public NLPToolsContextPreprocessor ( ILabelPipeline pipeline , IContext context , ILinguisticOracle linguisticOracle ) { } public NLPToolsContextPreprocessor ( ILabelPipeline pipeline , DefaultContextPreprocessor dcp , ILinguisticOracle linguisticOracle ) { } public NLPToolsContextPreprocessor ( ILabelPipeline pipeline , DefaultContextPreprocessor dcp , IContext context , ILinguisticOracle linguisticOracle ) { } public void preprocess ( IContext context ) throws ContextPreprocessorException { } @ Override public AsyncTask < Void , INode > asyncPreprocess ( IContext context ) { } private ILabel processNode ( INode currentNode , List < ILabel > pathToRootPhrases ) throws ContextPreprocessorException { NLPToolsContextPreprocessor . log . trace ( ( ( ( "preprocessing<seq2seq4repair_space>node:<seq2seq4repair_space>" + ( currentNode . nodeData ( ) . getId ( ) ) ) + ",<seq2seq4repair_space>label:<seq2seq4repair_space>" ) + ( currentNode . nodeData ( ) . getName ( ) ) ) ) ; currentNode . nodeData ( ) . setLabelFormula ( "" ) ; currentNode . nodeData ( ) . setNodeFormula ( "" ) ; currentNode . nodeData ( ) . getConcepts ( ) . clear ( ) ; String label = currentNode . nodeData ( ) . getName ( ) ; ILabel result = new Label ( label ) ; result . setContext ( pathToRootPhrases ) ; try { result . setLanguage ( currentNode . getLanguage ( ) ) ; pipeline . process ( result ) ; String formula = result . getFormula ( ) ; currentNode . nodeData ( ) . setIsPreprocessed ( true ) ; String [ ] tokenIndexes = formula . split ( "[<seq2seq4repair_space>()&|~]" ) ; Set < String > indexes = new HashSet < > ( Arrays . asList ( tokenIndexes ) ) ; List < IToken > tokens = result . getTokens ( ) ; for ( int i = 0 ; i < ( tokens . size ( ) ) ; i ++ ) { IToken token = tokens . get ( i ) ; String tokenIdx = Integer . toString ( i ) ; if ( indexes . contains ( tokenIdx ) ) { IAtomicConceptOfLabel acol = currentNode . nodeData ( ) . createConcept ( ) ; acol . setId ( i ) ; acol . setToken ( token . getText ( ) ) ; acol . setLemma ( token . getLemma ( ) ) ; acol . setSenses ( token . getSenses ( ) ) ; currentNode . nodeData ( ) . getConcepts ( ) . add ( acol ) ; } } <START_BUG> formula = formula . replaceAll ( "(\\d+)" , ( ( currentNode . nodeData ( ) . getId ( ) ) + ".$1" ) ) ; <END_BUG> formula = formula . trim ( ) ; currentNode . nodeData ( ) . setLabelFormula ( formula ) ; } catch ( PipelineComponentException e ) { if ( NLPToolsContextPreprocessor . log . isWarnEnabled ( ) ) { NLPToolsContextPreprocessor . log . warn ( ( ( ( "Falling<seq2seq4repair_space>back<seq2seq4repair_space>to<seq2seq4repair_space>heuristic<seq2seq4repair_space>parser<seq2seq4repair_space>for<seq2seq4repair_space>label<seq2seq4repair_space>(" + ( result . getText ( ) ) ) + "):<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ; ( fallbackCount ) ++ ; dcp . processNode ( currentNode , new HashSet < String > ( ) ) ; } } return result ; } No newline ; at end ; of file ; }

Fix:
formula = formula . replaceAll ( "(\\d+)" , ( ( currentNode . nodeData ( ) . getId ( ) ) + "_$1" ) ) ;