Buggy code:
public class StringFromFile extends AbstractFunction implements Serializable , TestListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 232L ; private static final List desc = new LinkedList ( ) ; private static final String KEY = "__StringFromFile" ; static final String ERR_IND = "**ERR**" ; private static final int MIN_PARAM_COUNT = 1 ; private static final int PARAM_NAME = 2 ; private static final int PARAM_START = 3 ; private static final int PARAM_END = 4 ; private static final int MAX_PARAM_COUNT = 4 ; private transient String myValue ; private transient String myName ; private transient Object [ ] values ; private transient BufferedReader myBread = null ; private transient FileReader fis ; private transient boolean firstTime = false ; private transient String fileName ; public StringFromFile ( ) { } private void init ( ) { } private Object readResolve ( ) { } public Object clone ( ) throws CloneNotSupportedException { } private void closeFile ( ) { } private static final int COUNT_UNUSED = - 2 ; private int myStart = StringFromFile . COUNT_UNUSED ; private int myCurrent = StringFromFile . COUNT_UNUSED ; private int myEnd = StringFromFile . COUNT_UNUSED ; private void openFile ( ) { } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { if ( ( values . length ) >= ( StringFromFile . PARAM_NAME ) ) { <START_BUG> myName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ ( ( StringFromFile . PARAM_NAME ) - 1 ) ] ) ) . execute ( ) ; <END_BUG> } myValue = StringFromFile . ERR_IND ; if ( firstTime ) { openFile ( ) ; firstTime = false ; } if ( null != ( myBread ) ) { try { String line = myBread . readLine ( ) ; if ( line == null ) { String tn = Thread . currentThread ( ) . getName ( ) ; StringFromFile . log . info ( ( ( tn + "<seq2seq4repair_space>EOF<seq2seq4repair_space>on<seq2seq4repair_space>file<seq2seq4repair_space>" ) + ( fileName ) ) ) ; closeFile ( ) ; openFile ( ) ; if ( ( myBread ) != null ) { line = myBread . readLine ( ) ; } else { line = StringFromFile . ERR_IND ; if ( ( myEnd ) != ( StringFromFile . COUNT_UNUSED ) ) { StringFromFile . log . info ( ( tn + "<seq2seq4repair_space>Detected<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>sequence." ) ) ; throw new JMeterStopThreadException ( "End<seq2seq4repair_space>of<seq2seq4repair_space>sequence" ) ; } } } myValue = line ; } catch ( IOException e ) { String tn = Thread . currentThread ( ) . getName ( ) ; StringFromFile . log . error ( ( ( tn + "<seq2seq4repair_space>error<seq2seq4repair_space>reading<seq2seq4repair_space>file<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; } } else { if ( ( myEnd ) != ( StringFromFile . COUNT_UNUSED ) ) { String tn = Thread . currentThread ( ) . getName ( ) ; StringFromFile . log . info ( ( tn + "<seq2seq4repair_space>Detected<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>sequence." ) ) ; throw new JMeterStopThreadException ( "End<seq2seq4repair_space>of<seq2seq4repair_space>sequence" ) ; } } if ( ( myName . length ( ) ) > 0 ) { JMeterVariables vars = getVariables ( ) ; vars . put ( myName , myValue ) ; } if ( StringFromFile . log . isDebugEnabled ( ) ) { String tn = Thread . currentThread ( ) . getName ( ) ; StringFromFile . log . debug ( ( ( ( ( tn + "<seq2seq4repair_space>name:" ) + ( myName ) ) + "<seq2seq4repair_space>value:" ) + ( myValue ) ) ) ; } return myValue ; } public synchronized void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } public void testStarted ( ) { } public void testStarted ( String host ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } }

Fix:
myName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ ( ( StringFromFile . PARAM_NAME ) - 1 ) ] ) ) . execute ( ) . trim ( ) ;