Program: 18587
Project: 18587
Buggy source:
/** 
 * Gets the service operations json.
 * @param serviceMap the service map
 * @param callback the callback
 * @return the service operations json
 */
public void getServiceOperationsJSON(final Map<String,Set<String>> serviceMap,final AsyncCallback<Map<String,Set<String>>> callback){
  final String url=MetricsMetaDataRequest.getJSONUrl();
  final String json=MetricsMetaDataRequest.getJSON("String_Node_Str",serviceMap.keySet(),"String_Node_Str");
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,URL.encode(url));
  try {
    builder.sendRequest(json,new RequestCallback(){
      public void onError(      Request request,      Throwable 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.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):
/** 
 * Gets the service operations json.
 * @param serviceMap the service map
 * @param callback the callback
 * @return the service operations json
 */
public void getServiceOperationsJSON(final Map<String,Set<String>> serviceMap,final AsyncCallback<Map<String,Set<String>>> callback){
  final String url=MetricsMetaDataRequest.getJSONUrl();
  final String json=MetricsMetaDataRequest.getJSON("String_Node_Str",serviceMap.keySet(),"String_Node_Str");
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,URL.encode(url));
  try {
    builder.sendRequest(json,new RequestCallback(){
      public void onError(      Request request,      Throwable 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.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);
  }
}