Program: 33237
Project: 33237
Buggy source:
private void handlePrimitiveDispatching(final ODataRequest request,final ODataResponse response,final boolean isCollection) throws ODataApplicationException, ODataLibraryException {
  final HttpMethod method=request.getMethod();
  final RepresentationType representationType=isCollection ? RepresentationType.COLLECTION_PRIMITIVE : RepresentationType.PRIMITIVE;
  if (method == HttpMethod.GET) {
    final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),representationType);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).readPrimitiveCollection(request,response,uriInfo,requestedContentType);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).readPrimitive(request,response,uriInfo,requestedContentType);
    }
  }
 else   if (method == HttpMethod.PUT || method == HttpMethod.PATCH) {
    validatePreconditions(request,false);
    final ContentType requestFormat=ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE));
    checkContentTypeSupport(requestFormat,representationType);
    final ContentType responseFormat=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),representationType);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).updatePrimitiveCollection(request,response,uriInfo,requestFormat,responseFormat);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).updatePrimitive(request,response,uriInfo,requestFormat,responseFormat);
    }
  }
 else   if (method == HttpMethod.DELETE) {
    validatePreconditions(request,false);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).deletePrimitiveCollection(request,response,uriInfo);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).deletePrimitive(request,response,uriInfo);
    }
  }
 else {
    throw new ODataHandlerException("String_Node_Str" + method + "String_Node_Str",ODataHandlerException.MessageKeys.HTTP_METHOD_NOT_ALLOWED,method.toString());
  }
}

Fixed version (ground truth):
private void handlePrimitiveDispatching(final ODataRequest request,final ODataResponse response,final boolean isCollection) throws ODataApplicationException, ODataLibraryException {
  final HttpMethod method=request.getMethod();
  final RepresentationType representationType=isCollection ? RepresentationType.COLLECTION_PRIMITIVE : RepresentationType.PRIMITIVE;
  if (method == HttpMethod.GET) {
    final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),representationType);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).readPrimitiveCollection(request,response,uriInfo,requestedContentType);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).readPrimitive(request,response,uriInfo,requestedContentType);
    }
  }
 else   if (method == HttpMethod.PUT || method == HttpMethod.PATCH) {
    validatePreconditions(request,false);
    final ContentType requestFormat=ContentType.parse(request.getHeader(HttpHeader.CONTENT_TYPE));
    checkContentTypeSupport(requestFormat,representationType);
    final ContentType responseFormat=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),representationType);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).updatePrimitiveCollection(request,response,uriInfo,requestFormat,responseFormat);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).updatePrimitive(request,response,uriInfo,requestFormat,responseFormat);
    }
  }
 else   if (method == HttpMethod.DELETE) {
    validatePreconditions(request,false);
    if (isCollection) {
      handler.selectProcessor(PrimitiveCollectionProcessor.class).deletePrimitiveCollection(request,response,uriInfo);
    }
 else {
      handler.selectProcessor(PrimitiveProcessor.class).deletePrimitive(request,response,uriInfo);
    }
  }
 else {
    throw new ODataHandlerException(getMethodNotAllowedStringMessage(method),ODataHandlerException.MessageKeys.HTTP_METHOD_NOT_ALLOWED,method.toString());
  }
}