Buggy code:
public class RegexExtractor extends AbstractScopedTestElement implements Serializable , PostProcessor { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String MATCH_AGAINST = "RegexExtractor.useHeaders" ; public static final String USE_HDRS = "true" ; public static final String USE_BODY = "false" ; public static final String USE_BODY_UNESCAPED = "unescaped" ; public static final String USE_URL = "URL" ; public static final String USE_CODE = "code" ; public static final String USE_MESSAGE = "message" ; private static final String REGEX = "RegexExtractor.regex" ; private static final String REFNAME = "RegexExtractor.refname" ; private static final String MATCH_NUMBER = "RegexExtractor.match_number" ; private static final String DEFAULT = "RegexExtractor.default" ; private static final String TEMPLATE = "RegexExtractor.template" ; private static final String REF_MATCH_NR = "_matchNr" ; private static final String UNDERSCORE = "_" ; private transient List < Object > template ; public void process ( ) { } private String getInputString ( SampleResult result ) { } private List < MatchResult > processMatches ( String regex , SampleResult result , int matchNumber , JMeterVariables vars ) { } private int matchStrings ( int matchNumber , Perl5Matcher matcher , Pattern pattern , List < MatchResult > matches , int found , String inputString ) { } private void saveGroups ( JMeterVariables vars , String basename , MatchResult match ) { } private void removeGroups ( JMeterVariables vars , String basename ) { } private String generateResult ( MatchResult match ) { } private void initTemplate ( ) { if ( ( template ) != null ) { return ; } List < Object > combined = new ArrayList < Object > ( ) ; String rawTemplate = getTemplate ( ) ; PatternMatcher matcher = JMeterUtils . getMatcher ( ) ; Pattern templatePattern = JMeterUtils . getPatternCache ( ) . getPattern ( "\\$(\\d+)\\$" , ( ( Perl5Compiler . READ_ONLY_MASK ) & ( Perl5Compiler . SINGLELINE_MASK ) ) ) ; if ( RegexExtractor . log . isDebugEnabled ( ) ) { RegexExtractor . log . debug ( ( "Pattern<seq2seq4repair_space>=<seq2seq4repair_space>" + ( templatePattern . getPattern ( ) ) ) ) ; RegexExtractor . log . debug ( ( "template<seq2seq4repair_space>=<seq2seq4repair_space>" + rawTemplate ) ) ; } int beginOffset = 0 ; MatchResult currentResult ; PatternMatcherInput pinput = new PatternMatcherInput ( rawTemplate ) ; while ( matcher . contains ( pinput , templatePattern ) ) { currentResult = matcher . getMatch ( ) ; final int beginMatch = currentResult . beginOffset ( 0 ) ; if ( beginMatch > beginOffset ) { combined . add ( rawTemplate . substring ( beginOffset , beginMatch ) ) ; } <START_BUG> combined . add ( new Integer ( currentResult . group ( 1 ) ) ) ; <END_BUG> beginOffset = currentResult . endOffset ( 0 ) ; } if ( beginOffset < ( rawTemplate . length ( ) ) ) { combined . add ( rawTemplate . substring ( beginOffset , rawTemplate . length ( ) ) ) ; } if ( RegexExtractor . log . isDebugEnabled ( ) ) { RegexExtractor . log . debug ( ( "Template<seq2seq4repair_space>item<seq2seq4repair_space>count:<seq2seq4repair_space>" + ( combined . size ( ) ) ) ) ; for ( Object o : combined ) { RegexExtractor . log . debug ( ( ( ( ( o . getClass ( ) . getSimpleName ( ) ) + "<seq2seq4repair_space>'" ) + ( o . toString ( ) ) ) + "'" ) ) ; } } template = combined ; } private MatchResult getCorrectMatch ( List < MatchResult > matches , int entry ) { } public void setRegex ( String regex ) { } public String getRegex ( ) { } public void setRefName ( String refName ) { } public String getRefName ( ) { } public void setMatchNumber ( int matchNumber ) { } public void setMatchNumber ( String matchNumber ) { } public int getMatchNumber ( ) { } public String getMatchNumberAsString ( ) { } public void setDefaultValue ( String defaultValue ) { } public String getDefaultValue ( ) { } public void setTemplate ( String template ) { } public String getTemplate ( ) { } public boolean useHeaders ( ) { } public boolean useBody ( ) { } public boolean useUnescapedBody ( ) { } public boolean useUrl ( ) { } public boolean useCode ( ) { } public boolean useMessage ( ) { } public void setUseField ( String actionCommand ) { } }

Fix:
combined . add ( Integer . valueOf ( currentResult . group ( 1 ) ) ) ;