Program: 112284
Project: 112284
Buggy source:
private IBaseOperationOutcome createOperationOutcome(Throwable theException,FhirContext ctx) throws ServletException {
  IBaseOperationOutcome oo=null;
  if (theException instanceof BaseServerResponseException) {
    oo=((BaseServerResponseException)theException).getOperationOutcome();
  }
  if (oo == null) {
    try {
      oo=OperationOutcomeUtil.newInstance(ctx);
      if (theException instanceof InternalErrorException) {
        ourLog.error("String_Node_Str",theException);
        populateDetails(ctx,theException,oo);
      }
 else       if (theException instanceof BaseServerResponseException) {
        ourLog.warn("String_Node_Str",theException);
        BaseServerResponseException baseServerResponseException=(BaseServerResponseException)theException;
        populateDetails(ctx,theException,oo);
        if (baseServerResponseException.getAdditionalMessages() != null) {
          for (          String next : baseServerResponseException.getAdditionalMessages()) {
            OperationOutcomeUtil.addIssue(ctx,oo,"String_Node_Str",next);
          }
        }
      }
 else {
        ourLog.error("String_Node_Str" + theException.toString(),theException);
        populateDetails(ctx,theException,oo);
      }
    }
 catch (    Exception e1) {
      ourLog.error("String_Node_Str",e1);
      throw new ServletException("String_Node_Str",e1);
    }
  }
 else {
    ourLog.error("String_Node_Str",theException);
  }
  return oo;
}

Fixed version (ground truth):
private IBaseOperationOutcome createOperationOutcome(Throwable theException,FhirContext ctx) throws ServletException {
  IBaseOperationOutcome oo=null;
  if (theException instanceof BaseServerResponseException) {
    oo=((BaseServerResponseException)theException).getOperationOutcome();
  }
  if (oo == null) {
    try {
      oo=OperationOutcomeUtil.newInstance(ctx);
      if (theException instanceof InternalErrorException) {
        ourLog.error("String_Node_Str",theException);
        populateDetails(ctx,theException,oo);
      }
 else       if (theException instanceof BaseServerResponseException) {
        int statusCode=((BaseServerResponseException)theException).getStatusCode();
        if (statusCode < 500) {
          ourLog.warn("String_Node_Str",theException.toString());
        }
 else {
          ourLog.warn("String_Node_Str",theException);
        }
        BaseServerResponseException baseServerResponseException=(BaseServerResponseException)theException;
        populateDetails(ctx,theException,oo);
        if (baseServerResponseException.getAdditionalMessages() != null) {
          for (          String next : baseServerResponseException.getAdditionalMessages()) {
            OperationOutcomeUtil.addIssue(ctx,oo,"String_Node_Str",next,null,PROCESSING);
          }
        }
      }
 else {
        ourLog.error("String_Node_Str" + theException.toString(),theException);
        populateDetails(ctx,theException,oo);
      }
    }
 catch (    Exception e1) {
      ourLog.error("String_Node_Str",e1);
      throw new ServletException("String_Node_Str",e1);
    }
  }
 else {
    ourLog.error("String_Node_Str",theException);
  }
  return oo;
}