Program: 73676
Project: 73676
Buggy source:
private VMVariable[] getMembersImpl(Context cx){
  Object valObj=value;
  if (value instanceof NativeJavaObject) {
    valObj=((NativeJavaObject)value).unwrap();
  }
  if (valObj == null || valObj.getClass().isPrimitive() || isPrimitive) {
    return NO_CHILD;
  }
  List children=new ArrayList();
  if (valObj.getClass().isArray()) {
    int len=Array.getLength(valObj);
    boolean primitive=valObj.getClass().getComponentType().isPrimitive();
    for (int i=0; i < len; i++) {
      Object aobj=Array.get(valObj,i);
      if (isValidJsValue(aobj)) {
        children.add(new JsVariable(aobj,"String_Node_Str" + children.size() + "String_Node_Str",primitive));
      }
    }
  }
 else   if (valObj instanceof Scriptable) {
    Object[] ids;
    if (valObj instanceof DebuggableObject) {
      ids=((DebuggableObject)valObj).getAllIds();
    }
 else {
      ids=((Scriptable)valObj).getIds();
    }
    if (ids == null || ids.length == 0) {
      return NO_CHILD;
    }
    for (int i=0; i < ids.length; i++) {
      if (ids[i] instanceof String) {
        Object val=ScriptableObject.getProperty((Scriptable)valObj,(String)ids[i]);
        if (val instanceof NativeJavaObject) {
          val=((NativeJavaObject)val).unwrap();
        }
        if (isValidJsValue(val)) {
          children.add(new JsVariable(val,(String)ids[i]));
        }
      }
    }
  }
 else {
    reflectMembers(valObj,children);
  }
  if (children.size() == 0) {
    return NO_CHILD;
  }
  Collections.sort(children);
  return (VMVariable[])children.toArray(new VMVariable[children.size()]);
}

Fixed version (ground truth):
private VMVariable[] getMembersImpl(Context cx){
  if (reservedValueType != null) {
    return NO_CHILD;
  }
  Object valObj=value;
  if (value instanceof NativeJavaObject) {
    valObj=((NativeJavaObject)value).unwrap();
  }
  if (valObj == null || valObj.getClass().isPrimitive() || isPrimitive) {
    return NO_CHILD;
  }
  List children=new ArrayList();
  if (valObj.getClass().isArray()) {
    int len=Array.getLength(valObj);
    boolean primitive=valObj.getClass().getComponentType().isPrimitive();
    for (int i=0; i < len; i++) {
      Object aobj=Array.get(valObj,i);
      if (isValidJsValue(aobj)) {
        children.add(new JsVariable(aobj,"String_Node_Str" + children.size() + "String_Node_Str",primitive));
      }
    }
  }
 else   if (valObj instanceof Scriptable) {
    Object[] ids;
    if (valObj instanceof DebuggableObject) {
      ids=((DebuggableObject)valObj).getAllIds();
    }
 else {
      ids=((Scriptable)valObj).getIds();
    }
    if (ids == null || ids.length == 0) {
      return NO_CHILD;
    }
    for (int i=0; i < ids.length; i++) {
      if (ids[i] instanceof String) {
        Object val=ScriptableObject.getProperty((Scriptable)valObj,(String)ids[i]);
        if (val instanceof NativeJavaObject) {
          val=((NativeJavaObject)val).unwrap();
        }
        if (isValidJsValue(val)) {
          children.add(new JsVariable(val,(String)ids[i]));
        }
      }
    }
  }
 else {
    reflectMembers(valObj,children);
  }
  if (children.size() == 0) {
    return NO_CHILD;
  }
  Collections.sort(children);
  return (VMVariable[])children.toArray(new VMVariable[children.size()]);
}