use of org.evosuite.symbolic.expr.token.NextTokenizerExpr in project evosuite by EvoSuite.
the class NextToken method executeFunction.
@Override
public Object executeFunction() {
ReferenceConstant symb_receiver = this.getSymbReceiver();
StringTokenizer conc_receiver = (StringTokenizer) this.getConcReceiver();
TokenizerExpr tokenizerExpr = (TokenizerExpr) env.heap.getField(Types.JAVA_UTIL_STRING_TOKENIZER, SymbolicHeap.$STRING_TOKENIZER_VALUE, conc_receiver, symb_receiver);
if (tokenizerExpr != null && tokenizerExpr.containsSymbolicVariable()) {
ReferenceConstant symb_ret_val = (ReferenceConstant) this.getSymbRetVal();
String conc_ret_val = (String) this.getConcRetVal();
// create new NEXT_TOKEN string expression
StringNextTokenExpr string_next_token_expr = new StringNextTokenExpr(tokenizerExpr, conc_ret_val);
env.heap.putField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_ret_val, symb_ret_val, string_next_token_expr);
// update StringTokenizer's symbolic state
NextTokenizerExpr nextTokenizerExpr = new NextTokenizerExpr(tokenizerExpr);
env.heap.putField(Types.JAVA_UTIL_STRING_TOKENIZER, SymbolicHeap.$STRING_TOKENIZER_VALUE, conc_receiver, symb_receiver, nextTokenizerExpr);
}
return this.getSymbRetVal();
}
Aggregations