} else {
return vm.mirrorOf(Integer.parseInt(expName));
}
}
Value basicExpValue = null;
if (!exp.isMethod()) {
basicExpValue = findValueInFrame(threadRef, expName,thisObj,hasParents);
} else {
List<Expression> params = exp.getParams();
List<Value> arguments = new ArrayList<Value>();
if (params.size() != 0) {
for (Expression param : params) {
Value paramValue = eval(threadRef, param, thisObj,false);
arguments.add(paramValue);
}
}
basicExpValue = invoke((ObjectReference) thisObj, expName, arguments);
}
if (exp.isArrayExp()) {
if (basicExpValue instanceof ArrayReference) {
ArrayReference array = (ArrayReference)basicExpValue;
Value arrayIdxValue = eval(threadRef, exp.getArrayIdxExp(), thisObj,false);
if (arrayIdxValue instanceof IntegerValue ) {
int idx = ((IntegerValue)arrayIdxValue).value();
basicExpValue = array.getValue(idx);
} else {
throw new ExpressionEvalException("eval expression error, array index is not int type.");
}
}
}
List<Expression> members = exp.getMembers();
if (members.size() == 0)
return basicExpValue;
if (exp.isStaticMember()) {
Expression memberExp = members.get(0);
List<Expression> params = memberExp.getParams();
List<Value> arguments = new ArrayList<Value>();
if (params.size() != 0) {
for (Expression param : params) {
Value paramValue = eval(threadRef, param, thisObj,false);
arguments.add(paramValue);
}
}
List<ReferenceType> refTypes = vm.classesByName(exp.getName());
if (refTypes == null || refTypes.size() == 0) {