Program: 35286
Project: 35286
Buggy source:
@ExceptionHandler(value={HttpRequestMethodNotSupportedException.class,HttpMediaTypeNotSupportedException.class,HttpMediaTypeNotAcceptableException.class,MissingPathVariableException.class,MissingServletRequestParameterException.class,ServletRequestBindingException.class,ConversionNotSupportedException.class,TypeMismatchException.class,HttpMessageNotReadableException.class,HttpMessageNotWritableException.class,MethodArgumentNotValidException.class,MissingServletRequestPartException.class,BindException.class,NoHandlerFoundException.class,AsyncRequestTimeoutException.class}) @ResponseBody public ResponseEntity<Object> handleConflict(Exception ex,HttpServletRequest request){
  String fullParametersString="String_Node_Str";
  String parametersString="String_Node_Str";
  if (!request.getParameterMap().isEmpty()) {
    parametersString=request.getParameterMap().entrySet().stream().map(this::getFormattedEntry).collect(Collectors.joining("String_Node_Str"));
    fullParametersString="String_Node_Str" + parametersString;
  }
  String requestURI=request.getRequestURI();
  HttpStatus status=getStatusForException(ex);
  String message="String_Node_Str" + requestURI + fullParametersString+ "String_Node_Str"+ ex.getMessage();
  if (EXCEPTIONS_LOG_WITHOUT_STACKTRACE.contains(ex.getClass())) {
    logger.warn(message);
  }
 else {
    logger.warn("String_Node_Str" + requestURI + fullParametersString,ex);
  }
  Object bodyOfResponse;
  if (MediaType.APPLICATION_JSON_VALUE.equals(request.getHeader(HttpHeaders.CONTENT_TYPE))) {
    bodyOfResponse=new JsonExceptionResponse(ExceptionUtils.getStackTrace(ex),requestURI,parametersString,status.value(),ex.getMessage());
  }
 else {
    bodyOfResponse=message;
  }
  return new ResponseEntity<>(bodyOfResponse,new HttpHeaders(),status);
}

Fixed version (ground truth):
@ExceptionHandler(value={HttpRequestMethodNotSupportedException.class,HttpMediaTypeNotSupportedException.class,HttpMediaTypeNotAcceptableException.class,MissingPathVariableException.class,MissingServletRequestParameterException.class,ServletRequestBindingException.class,ConversionNotSupportedException.class,TypeMismatchException.class,HttpMessageNotReadableException.class,HttpMessageNotWritableException.class,MethodArgumentNotValidException.class,MissingServletRequestPartException.class,BindException.class,NoHandlerFoundException.class,AsyncRequestTimeoutException.class}) @ResponseBody public ResponseEntity<Object> handleConflict(Exception ex,HttpServletRequest request){
  String fullParametersString="String_Node_Str";
  String parametersString="String_Node_Str";
  if (!request.getParameterMap().isEmpty()) {
    parametersString=request.getParameterMap().entrySet().stream().map(this::getFormattedEntry).collect(Collectors.joining("String_Node_Str"));
    fullParametersString="String_Node_Str" + parametersString;
  }
  String requestURI=request.getRequestURI();
  HttpStatus status=getStatusForException(ex);
  String message="String_Node_Str" + requestURI + fullParametersString+ "String_Node_Str"+ ex.getMessage();
  if (EXCEPTIONS_LOG_WITHOUT_STACKTRACE.contains(ex.getClass())) {
    logger.warn(message);
  }
 else {
    logger.warn("String_Node_Str" + requestURI + fullParametersString,ex);
  }
  Object bodyOfResponse;
  List<MediaType> mediaTypes=new ArrayList<>();
  try {
    mediaTypes=resolveMediaTypes(request);
  }
 catch (  HttpMediaTypeNotAcceptableException e) {
    logger.error("String_Node_Str",e);
  }
  if (mediaTypes.contains(MediaType.APPLICATION_JSON)) {
    bodyOfResponse=new JsonExceptionResponse(ExceptionUtils.getStackTrace(ex),requestURI,parametersString,status.value(),ex.getMessage());
  }
 else {
    bodyOfResponse=message;
  }
  return new ResponseEntity<>(bodyOfResponse,new HttpHeaders(),status);
}