Program: 50032
Project: 50032
Buggy source:
public void sendAsyncQuery(RPCElement elem) throws TransportException {
  Reply reply=new Reply();
  Vector<Error> errors=new Vector<Error>();
  if (elem instanceof Hello) {
    ArrayList<Capability> capabilities=((Hello)elem).getCapabilities();
    capabilities.retainAll(this.supportedCapabilities);
    context.setActiveCapabilities(capabilities);
  }
  if (elem instanceof Query) {
    Query query=(Query)elem;
    Operation op=query.getOperation();
    if (op.equals(Operation.COPY_CONFIG)) {
    }
 else     if (op.equals(Operation.DELETE_CONFIG)) {
      reply.setOk(true);
    }
 else     if (op.equals(Operation.EDIT_CONFIG)) {
      reply.setOk(true);
    }
 else     if (op.equals(Operation.GET)) {
      if (query.getFilter() != null && query.getFilterType() != null) {
        if (context.getActiveCapabilities().contains(Capability.XPATH)) {
          if (!(query.getFilterType().equals("String_Node_Str") || query.getFilterType().equals("String_Node_Str")))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
 else           if (query.getFilterType().equals("String_Node_Str"))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
        }
      }
      reply.setMessageId(query.getMessageId());
      reply.setContain(getDataFromFile(fileIPConfiguration));
    }
 else     if (op.equals(Operation.GET_CONFIG)) {
      if (query.getSource() == null)       errors.add(new Error(){
{
          setTag(ErrorTag.MISSING_ELEMENT);
          setType(ErrorType.PROTOCOL);
          setSeverity(ErrorSeverity.ERROR);
          setInfo("String_Node_Str");
        }
      }
);
      if (query.getSource() == null && query.getSource().equals("String_Node_Str")) {
        errors.add(new Error(){
{
            setTag(ErrorTag.BAD_ELEMENT);
            setType(ErrorType.PROTOCOL);
            setSeverity(ErrorSeverity.ERROR);
            setInfo("String_Node_Str");
          }
        }
);
      }
      if (query.getFilter() != null && query.getFilterType() != null) {
        if (context.getActiveCapabilities().contains(Capability.XPATH)) {
          if (!(query.getFilterType().equals("String_Node_Str") || query.getFilterType().equals("String_Node_Str")))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
 else           if (query.getFilterType().equals("String_Node_Str"))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
        }
      }
      reply.setMessageId(query.getMessageId());
      if (!insideLogicalRouter) {
        reply.setContain(getDataFromFile(fileIPConfiguration));
      }
 else {
        reply.setContain(getDataFromFile(fileIPLogicalRouterConfig));
      }
    }
 else     if (op.equals(Operation.KILL_SESSION)) {
      insideLogicalRouter=false;
      disconnect();
      return;
    }
 else     if (op.equals(Operation.CLOSE_SESSION)) {
      reply.setMessageId(query.getMessageId());
      reply.setOk(true);
      insideLogicalRouter=false;
      disconnect();
    }
 else     if (op.equals(Operation.LOCK)) {
      error("String_Node_Str");
    }
 else     if (op.equals(Operation.UNLOCK)) {
      error("String_Node_Str");
    }
 else     if (op.equals(Operation.SET_LOGICAL_ROUTER)) {
      reply.setMessageId(query.getMessageId());
      reply.setContain("String_Node_Str" + query.getIdLogicalRouter() + "String_Node_Str");
      insideLogicalRouter=true;
    }
  }
  if (subsystem.equals("String_Node_Str"))   addErrors(errors);
  if (errors.size() > 0)   reply.setErrors(errors);
  queue.put(reply);
}

Fixed version (ground truth):
public void sendAsyncQuery(RPCElement elem) throws TransportException {
  Reply reply=new Reply();
  Vector<Error> errors=new Vector<Error>();
  if (elem instanceof Hello) {
    ArrayList<Capability> capabilities=((Hello)elem).getCapabilities();
    capabilities.retainAll(this.supportedCapabilities);
    context.setActiveCapabilities(capabilities);
  }
  if (elem instanceof Query) {
    Query query=(Query)elem;
    Operation op=query.getOperation();
    if (op.equals(Operation.COPY_CONFIG)) {
    }
 else     if (op.equals(Operation.DELETE_CONFIG)) {
      reply.setOk(true);
      reply.setMessageId(query.getMessageId());
    }
 else     if (op.equals(Operation.EDIT_CONFIG)) {
      reply.setOk(true);
      reply.setMessageId(query.getMessageId());
    }
 else     if (op.equals(Operation.GET)) {
      if (query.getFilter() != null && query.getFilterType() != null) {
        if (context.getActiveCapabilities().contains(Capability.XPATH)) {
          if (!(query.getFilterType().equals("String_Node_Str") || query.getFilterType().equals("String_Node_Str")))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
 else           if (query.getFilterType().equals("String_Node_Str"))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
        }
      }
      reply.setMessageId(query.getMessageId());
      reply.setContain(getDataFromFile(fileIPConfiguration));
    }
 else     if (op.equals(Operation.GET_CONFIG)) {
      if (query.getSource() == null)       errors.add(new Error(){
{
          setTag(ErrorTag.MISSING_ELEMENT);
          setType(ErrorType.PROTOCOL);
          setSeverity(ErrorSeverity.ERROR);
          setInfo("String_Node_Str");
        }
      }
);
      if (query.getSource() == null && query.getSource().equals("String_Node_Str")) {
        errors.add(new Error(){
{
            setTag(ErrorTag.BAD_ELEMENT);
            setType(ErrorType.PROTOCOL);
            setSeverity(ErrorSeverity.ERROR);
            setInfo("String_Node_Str");
          }
        }
);
      }
      if (query.getFilter() != null && query.getFilterType() != null) {
        if (context.getActiveCapabilities().contains(Capability.XPATH)) {
          if (!(query.getFilterType().equals("String_Node_Str") || query.getFilterType().equals("String_Node_Str")))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
 else           if (query.getFilterType().equals("String_Node_Str"))           errors.add(new Error(){
{
              setTag(ErrorTag.BAD_ATTRIBUTE);
              setType(ErrorType.PROTOCOL);
              setSeverity(ErrorSeverity.ERROR);
              setInfo("String_Node_Str");
            }
          }
);
        }
      }
      reply.setMessageId(query.getMessageId());
      if (!insideLogicalRouter) {
        reply.setContain(getDataFromFile(fileIPConfiguration));
      }
 else {
        reply.setContain(getDataFromFile(fileIPLogicalRouterConfig));
      }
    }
 else     if (op.equals(Operation.KILL_SESSION)) {
      insideLogicalRouter=false;
      disconnect();
      return;
    }
 else     if (op.equals(Operation.CLOSE_SESSION)) {
      reply.setMessageId(query.getMessageId());
      reply.setOk(true);
      insideLogicalRouter=false;
      disconnect();
    }
 else     if (op.equals(Operation.LOCK)) {
      error("String_Node_Str");
    }
 else     if (op.equals(Operation.UNLOCK)) {
      error("String_Node_Str");
    }
 else     if (op.equals(Operation.SET_LOGICAL_ROUTER)) {
      reply.setMessageId(query.getMessageId());
      reply.setContain("String_Node_Str" + query.getIdLogicalRouter() + "String_Node_Str");
      insideLogicalRouter=true;
    }
  }
  if (subsystem.equals("String_Node_Str"))   addErrors(errors);
  if (errors.size() > 0)   reply.setErrors(errors);
  queue.put(reply);
}