Program: 37429
Project: 37429
Buggy source:
private Responses.ResponseBody evaluate(Requests.EvaluateArguments arguments){
  final boolean showStaticVariables=true;
  boolean showFullyQualifiedNames=true;
  Map<String,Object> options=variableFormatter.getDefaultOptions();
  if (arguments.format != null && arguments.format.hex) {
    options.put(NumericFormatter.NUMERIC_FORMAT_OPTION,NumericFormatEnum.HEX);
  }
  if (showFullyQualifiedNames) {
    options.put(SimpleTypeFormatter.QUALIFIED_CLASS_NAME_OPTION,showFullyQualifiedNames);
  }
  String expression=arguments.expression;
  if (StringUtils.isBlank(expression)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!simpleExprPattern.matcher(expression).matches()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  JdiObjectProxy<StackFrame> stackFrameProxy=(JdiObjectProxy<StackFrame>)this.objectPool.getObjectById(arguments.frameId);
  if (stackFrameProxy == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<String> referenceExpressions=Arrays.stream(StringUtils.split(expression,'.')).filter(StringUtils::isNotBlank).map(StringUtils::trim).collect(Collectors.toList());
  Variable firstLevelValue=null;
  boolean inStaticMethod=!stackFrameProxy.getProxiedObject().location().method().isStatic();
  String firstExpression=referenceExpressions.get(0);
  if (firstExpression.equals("String_Node_Str") && !inStaticMethod) {
    firstLevelValue=VariableUtils.getThisVariable(stackFrameProxy.getProxiedObject());
  }
  if (firstLevelValue == null) {
    try {
      List<Variable> localVariables=VariableUtils.listLocalVariables(stackFrameProxy.getProxiedObject());
      List<Variable> matchedLocal=localVariables.stream().filter(localVariable -> localVariable.name.equals(firstExpression)).collect(Collectors.toList());
      if (!matchedLocal.isEmpty()) {
        firstLevelValue=matchedLocal.get(0);
      }
 else {
        List<Variable> staticVariables=VariableUtils.listStaticVariables(stackFrameProxy.getProxiedObject());
        List<Variable> matchedStatic=staticVariables.stream().filter(staticVariable -> staticVariable.name.equals(firstExpression)).collect(Collectors.toList());
        if (matchedStatic.isEmpty()) {
          throw new IllegalArgumentException(String.format("String_Node_Str",referenceExpressions.get(0)));
        }
        firstLevelValue=matchedStatic.get(0);
      }
    }
 catch (    AbsentInformationException e) {
    }
  }
  if (firstLevelValue == null) {
    throw new IllegalArgumentException(String.format("String_Node_Str",referenceExpressions.get(0)));
  }
  ThreadReference thread=stackFrameProxy.getProxiedObject().thread();
  Value currentValue=firstLevelValue.value;
  for (int i=1; i < referenceExpressions.size(); i++) {
    String fieldName=referenceExpressions.get(i);
    if (currentValue == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (currentValue instanceof PrimitiveValue) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    if (currentValue instanceof ArrayReference) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    ObjectReference obj=(ObjectReference)currentValue;
    Field field=obj.referenceType().fieldByName(fieldName);
    if (field == null) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    if (field.isStatic()) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    currentValue=obj.getValue(field);
  }
  int referenceId=0;
  if (currentValue instanceof ObjectReference && VariableUtils.hasChildren(currentValue,showStaticVariables)) {
    ThreadObjectReference threadObjectReference=new ThreadObjectReference(thread,(ObjectReference)currentValue);
    referenceId=this.objectPool.addObject(thread.uniqueID(),threadObjectReference);
  }
  int indexedVariables=0;
  if (currentValue instanceof ArrayReference) {
    indexedVariables=((ArrayReference)currentValue).length();
  }
  return new Responses.EvaluateResponseBody(variableFormatter.valueToString(currentValue,options),referenceId,variableFormatter.typeToString(currentValue == null ? null : currentValue.type(),options),indexedVariables);
}

Fixed version (ground truth):
private Responses.ResponseBody evaluate(Requests.EvaluateArguments arguments){
  final boolean showStaticVariables=true;
  boolean showFullyQualifiedNames=true;
  Map<String,Object> options=variableFormatter.getDefaultOptions();
  if (arguments.format != null && arguments.format.hex) {
    options.put(NumericFormatter.NUMERIC_FORMAT_OPTION,NumericFormatEnum.HEX);
  }
  if (showFullyQualifiedNames) {
    options.put(SimpleTypeFormatter.QUALIFIED_CLASS_NAME_OPTION,showFullyQualifiedNames);
  }
  String expression=arguments.expression;
  if (StringUtils.isBlank(expression)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!simpleExprPattern.matcher(expression).matches()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  JdiObjectProxy<StackFrame> stackFrameProxy=(JdiObjectProxy<StackFrame>)this.objectPool.getObjectById(arguments.frameId);
  if (stackFrameProxy == null) {
    return new Responses.ErrorResponseBody(convertDebuggerMessageToClient("String_Node_Str"));
  }
  List<String> referenceExpressions=Arrays.stream(StringUtils.split(expression,'.')).filter(StringUtils::isNotBlank).map(StringUtils::trim).collect(Collectors.toList());
  Variable firstLevelValue=null;
  boolean inStaticMethod=!stackFrameProxy.getProxiedObject().location().method().isStatic();
  String firstExpression=referenceExpressions.get(0);
  if (firstExpression.equals("String_Node_Str") && !inStaticMethod) {
    firstLevelValue=VariableUtils.getThisVariable(stackFrameProxy.getProxiedObject());
  }
  if (firstLevelValue == null) {
    try {
      List<Variable> localVariables=VariableUtils.listLocalVariables(stackFrameProxy.getProxiedObject());
      List<Variable> matchedLocal=localVariables.stream().filter(localVariable -> localVariable.name.equals(firstExpression)).collect(Collectors.toList());
      if (!matchedLocal.isEmpty()) {
        firstLevelValue=matchedLocal.get(0);
      }
 else {
        List<Variable> staticVariables=VariableUtils.listStaticVariables(stackFrameProxy.getProxiedObject());
        List<Variable> matchedStatic=staticVariables.stream().filter(staticVariable -> staticVariable.name.equals(firstExpression)).collect(Collectors.toList());
        if (matchedStatic.isEmpty()) {
          throw new IllegalArgumentException(String.format("String_Node_Str",referenceExpressions.get(0)));
        }
        firstLevelValue=matchedStatic.get(0);
      }
    }
 catch (    AbsentInformationException e) {
    }
  }
  if (firstLevelValue == null) {
    throw new IllegalArgumentException(String.format("String_Node_Str",referenceExpressions.get(0)));
  }
  ThreadReference thread=stackFrameProxy.getProxiedObject().thread();
  Value currentValue=firstLevelValue.value;
  for (int i=1; i < referenceExpressions.size(); i++) {
    String fieldName=referenceExpressions.get(i);
    if (currentValue == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (currentValue instanceof PrimitiveValue) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    if (currentValue instanceof ArrayReference) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    ObjectReference obj=(ObjectReference)currentValue;
    Field field=obj.referenceType().fieldByName(fieldName);
    if (field == null) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    if (field.isStatic()) {
      throw new IllegalArgumentException(String.format("String_Node_Str",fieldName));
    }
    currentValue=obj.getValue(field);
  }
  int referenceId=0;
  if (currentValue instanceof ObjectReference && VariableUtils.hasChildren(currentValue,showStaticVariables)) {
    ThreadObjectReference threadObjectReference=new ThreadObjectReference(thread,(ObjectReference)currentValue);
    referenceId=this.objectPool.addObject(thread.uniqueID(),threadObjectReference);
  }
  int indexedVariables=0;
  if (currentValue instanceof ArrayReference) {
    indexedVariables=((ArrayReference)currentValue).length();
  }
  return new Responses.EvaluateResponseBody(variableFormatter.valueToString(currentValue,options),referenceId,variableFormatter.typeToString(currentValue == null ? null : currentValue.type(),options),indexedVariables);
}