Program: 80826
Project: 80826
Buggy source:
@Override public void handleGET(CoapExchange exchange){
  Collection<Resource> resources=rdResource.getChildren();
  List<String> query=exchange.getRequestOptions().getUriQuery();
  String result="String_Node_Str";
  String domainQuery="String_Node_Str";
  String endpointQuery="String_Node_Str";
  TreeSet<String> endpointTypeQuery=new TreeSet<String>();
  for (  String q : query) {
    LinkAttribute attr=LinkAttribute.parse(q);
    if (attr.getName().equals(LinkFormat.DOMAIN)) {
      domainQuery=attr.getValue();
    }
    if (attr.getName().equals(LinkFormat.END_POINT)) {
      endpointQuery=attr.getValue();
    }
    if (attr.getName().equals(LinkFormat.END_POINT_TYPE)) {
      Collections.addAll(endpointTypeQuery,attr.getValue().split("String_Node_Str"));
    }
  }
  Iterator<Resource> resIt=resources.iterator();
  while (resIt.hasNext()) {
    Resource res=resIt.next();
    if (res.getClass() == RDNodeResource.class) {
      RDNodeResource node=(RDNodeResource)res;
      if ((domainQuery.isEmpty() || domainQuery.equals(node.getDomain())) && (endpointQuery.isEmpty() || endpointQuery.equals(node.getEndpointIdentifier())) && (endpointTypeQuery.isEmpty() || endpointTypeQuery.contains(node.getEndpointType()))) {
        result+="String_Node_Str" + node.getContext() + "String_Node_Str"+ LinkFormat.END_POINT+ "String_Node_Str"+ node.getEndpointIdentifier()+ "String_Node_Str";
        result+="String_Node_Str" + LinkFormat.DOMAIN + "String_Node_Str"+ node.getDomain()+ "String_Node_Str";
        if (!node.getEndpointType().isEmpty()) {
          result+="String_Node_Str" + LinkFormat.RESOURCE_TYPE + "String_Node_Str"+ node.getEndpointType()+ "String_Node_Str";
        }
        result+="String_Node_Str";
      }
    }
  }
  if (result.isEmpty()) {
    exchange.respond(ResponseCode.NOT_FOUND);
  }
 else {
    exchange.respond(ResponseCode.CONTENT,result.substring(0,result.length() - 1),MediaTypeRegistry.APPLICATION_LINK_FORMAT);
  }
}

Fixed version (ground truth):
@Override public void handleGET(CoapExchange exchange){
  Collection<Resource> resources=rdResource.getChildren();
  String result="String_Node_Str";
  String domainQuery="String_Node_Str";
  String endpointQuery="String_Node_Str";
  TreeSet<String> endpointTypeQuery=new TreeSet<String>();
  List<String> query=exchange.getRequestOptions().getUriQuery();
  for (  String q : query) {
    KeyValuePair kvp=KeyValuePair.parse(q);
    if (LinkFormat.DOMAIN.equals(kvp.getName())) {
      domainQuery=kvp.getValue();
    }
    if (LinkFormat.END_POINT.equals(kvp.getName())) {
      endpointQuery=kvp.getValue();
    }
    if (LinkFormat.END_POINT_TYPE.equals(kvp.getName())) {
      Collections.addAll(endpointTypeQuery,kvp.getValue().split("String_Node_Str"));
    }
  }
  Iterator<Resource> resIt=resources.iterator();
  while (resIt.hasNext()) {
    Resource res=resIt.next();
    if (res.getClass() == RDNodeResource.class) {
      RDNodeResource node=(RDNodeResource)res;
      if ((domainQuery.isEmpty() || domainQuery.equals(node.getDomain())) && (endpointQuery.isEmpty() || endpointQuery.equals(node.getEndpointName())) && (endpointTypeQuery.isEmpty() || endpointTypeQuery.contains(node.getEndpointType()))) {
        result+="String_Node_Str" + node.getContext() + "String_Node_Str"+ LinkFormat.END_POINT+ "String_Node_Str"+ node.getEndpointName()+ "String_Node_Str";
        result+="String_Node_Str" + LinkFormat.DOMAIN + "String_Node_Str"+ node.getDomain()+ "String_Node_Str";
        if (!node.getEndpointType().isEmpty()) {
          result+="String_Node_Str" + LinkFormat.RESOURCE_TYPE + "String_Node_Str"+ node.getEndpointType()+ "String_Node_Str";
        }
        result+="String_Node_Str";
      }
    }
  }
  if (result.isEmpty()) {
    exchange.respond(ResponseCode.NOT_FOUND);
  }
 else {
    exchange.respond(ResponseCode.CONTENT,result.substring(0,result.length() - 1),MediaTypeRegistry.APPLICATION_LINK_FORMAT);
  }
}