ReferenceType declaringType = method.declaringType(); // org.drools.core.base.mvel.MVELDebugHandler
try {
Object var = method.variables().get( 0 );
LocalVariable v2 = (LocalVariable) var;
JDILocalVariable frameLocal = new JDILocalVariable( this,
v2 );
IValue knownVars = DebugUtil.getValueByExpression( "return getFactory().getKnownVariables().toArray(new String[0]);",
frameLocal.getValue() );
JDIObjectValue vvv = (JDIObjectValue) knownVars;
if ( vvv != null && ((ArrayReference) vvv.getUnderlyingObject()).length() > 0 ) {
ArrayReference arr = (ArrayReference) vvv.getUnderlyingObject();
Iterator<Value> varIter = arr.getValues().iterator();
while ( varIter.hasNext() ) {
final String varName = ((StringReference) varIter.next()).value();
IJavaValue val = (IJavaValue) DebugUtil.getValueByExpression( "return getFactory().getVariableResolver(\"" + varName + "\").getValue();",
frameLocal.getValue() );
if ( val != null ) {
final ObjectReference valRef = ((JDIObjectValue) val).getUnderlyingObject();
VariableWrapper local = new VariableWrapper( varName,
val );