Program: 18591
Project: 18591
Buggy source:
/** 
 * Talk to the remote server to obtain a list of all operations for the given services.
 * @param serviceMap keys are the list of services for which to obtain the operations
 * @param callback the callback
 * @return the service operations
 */
public void getServiceOperations(final Map<String,Set<String>> serviceMap,final AsyncCallback<Map<String,Set<String>>> callback){
  final String url=MetricsMetaDataRequest.getRestURL("String_Node_Str",serviceMap.keySet(),"String_Node_Str");
  RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,URL.encode(url));
  try {
    builder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable err){
        errorLogger.log(Level.SEVERE,"String_Node_Str",err);
        callback.onFailure(err);
      }
      public void onResponseReceived(      final Request request,      final Response response){
        if (response.getStatusCode() != Response.SC_OK) {
          errorLogger.log(Level.SEVERE,"String_Node_Str" + url + "String_Node_Str"+ response.getStatusCode()+ "String_Node_Str"+ response.getText());
          callback.onFailure(getErrorAsThrowable(response));
        }
 else         if (response.getHeader(ERROR_HEADER) != null) {
          errorLogger.log(Level.SEVERE,"String_Node_Str" + url + "String_Node_Str"+ response.getStatusCode()+ "String_Node_Str"+ response.getText());
          callback.onFailure(getErrorAsThrowable(response));
        }
 else {
          MetricsMetaDataResponse metaDataResponse=MetricsMetaDataResponse.fromJSON(response.getText());
          if (metaDataResponse == null)           callback.onFailure(new Throwable(ConsoleUtil.messages.badOrMissingResponseData()));
 else {
            Set<String> operationNames=metaDataResponse.getOrderedResourceEntityResponseNames();
            String error=null;
            Iterator<String> itor=operationNames.iterator();
            while (itor.hasNext() && error == null) {
              String s=itor.next();
              int dot=s.indexOf("String_Node_Str");
              if (dot < 0) {
                error=s;
              }
 else {
                Set<String> operations=serviceMap.get(s.substring(0,dot));
                if (operations != null)                 operations.add(s.substring(dot + 1));
              }
            }
            if (error != null)             callback.onFailure(new Throwable(error));
 else             callback.onSuccess(serviceMap);
          }
        }
      }
    }
);
  }
 catch (  RequestException x) {
    errorLogger.log(Level.SEVERE,"String_Node_Str",x);
    callback.onFailure(x);
  }
}

Fixed version (ground truth):
/** 
 * Talk to the remote server to obtain a list of all operations for the given services.
 * @param serviceMap keys are the list of services for which to obtain the operations
 * @param callback the callback
 * @return the service operations
 */
public void getServiceOperations(final Map<String,Set<String>> serviceMap,final AsyncCallback<Map<String,Set<String>>> callback){
  final String url=MetricsMetaDataRequest.getRestURL("String_Node_Str",serviceMap.keySet(),"String_Node_Str");
  RequestBuilder builder=new RequestBuilder(RequestBuilder.GET,URL.encode(url));
  try {
    builder.sendRequest(null,new RequestCallback(){
      public void onError(      Request request,      Throwable err){
        errorLogger.log(Level.SEVERE,"String_Node_Str",err);
        callback.onFailure(err);
      }
      public void onResponseReceived(      final Request request,      final Response response){
        if (response.getStatusCode() != Response.SC_OK) {
          errorLogger.log(Level.SEVERE,"String_Node_Str" + url + "String_Node_Str"+ response.getStatusCode()+ "String_Node_Str"+ response.getText());
          callback.onFailure(getErrorAsThrowable(response));
        }
 else         if (response.getHeader(ERROR_HEADER) != null && response.getHeader(ERROR_HEADER).length() > 0) {
          errorLogger.log(Level.SEVERE,"String_Node_Str" + url + "String_Node_Str"+ response.getStatusCode()+ "String_Node_Str"+ response.getText());
          callback.onFailure(getErrorAsThrowable(response));
        }
 else {
          MetricsMetaDataResponse metaDataResponse=MetricsMetaDataResponse.fromJSON(response.getText());
          if (metaDataResponse == null)           callback.onFailure(new Throwable(ConsoleUtil.messages.badOrMissingResponseData()));
 else {
            Set<String> operationNames=metaDataResponse.getOrderedResourceEntityResponseNames();
            String error=null;
            Iterator<String> itor=operationNames.iterator();
            while (itor.hasNext() && error == null) {
              String s=itor.next();
              int dot=s.indexOf("String_Node_Str");
              if (dot < 0) {
                error=s;
              }
 else {
                Set<String> operations=serviceMap.get(s.substring(0,dot));
                if (operations != null)                 operations.add(s.substring(dot + 1));
              }
            }
            if (error != null)             callback.onFailure(new Throwable(error));
 else             callback.onSuccess(serviceMap);
          }
        }
      }
    }
);
  }
 catch (  RequestException x) {
    errorLogger.log(Level.SEVERE,"String_Node_Str",x);
    callback.onFailure(x);
  }
}