Program: 33235
Project: 33235
Buggy source:
private void handleComplexDispatching(final ODataRequest request,final ODataResponse response,final boolean isCollection) throws ODataApplicationException, ODataLibraryException {
  final HttpMethod method=request.getMethod();
  final RepresentationType complexRepresentationType=isCollection ? RepresentationType.COLLECTION_COMPLEX : RepresentationType.COMPLEX;
  if (method == HttpMethod.GET) {
    final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),complexRepresentationType);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).readComplexCollection(request,response,uriInfo,requestedContentType);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).readComplex(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,complexRepresentationType);
    final ContentType responseFormat=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),complexRepresentationType);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).updateComplexCollection(request,response,uriInfo,requestFormat,responseFormat);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).updateComplex(request,response,uriInfo,requestFormat,responseFormat);
    }
  }
 else   if (method == HttpMethod.DELETE) {
    validatePreconditions(request,false);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).deleteComplexCollection(request,response,uriInfo);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).deleteComplex(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 handleComplexDispatching(final ODataRequest request,final ODataResponse response,final boolean isCollection) throws ODataApplicationException, ODataLibraryException {
  final HttpMethod method=request.getMethod();
  final RepresentationType complexRepresentationType=isCollection ? RepresentationType.COLLECTION_COMPLEX : RepresentationType.COMPLEX;
  if (method == HttpMethod.GET) {
    final ContentType requestedContentType=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),complexRepresentationType);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).readComplexCollection(request,response,uriInfo,requestedContentType);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).readComplex(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,complexRepresentationType);
    final ContentType responseFormat=ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),request,handler.getCustomContentTypeSupport(),complexRepresentationType);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).updateComplexCollection(request,response,uriInfo,requestFormat,responseFormat);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).updateComplex(request,response,uriInfo,requestFormat,responseFormat);
    }
  }
 else   if (method == HttpMethod.DELETE) {
    validatePreconditions(request,false);
    if (isCollection) {
      handler.selectProcessor(ComplexCollectionProcessor.class).deleteComplexCollection(request,response,uriInfo);
    }
 else {
      handler.selectProcessor(ComplexProcessor.class).deleteComplex(request,response,uriInfo);
    }
  }
 else {
    throw new ODataHandlerException(getMethodNotAllowedStringMessage(method),ODataHandlerException.MessageKeys.HTTP_METHOD_NOT_ALLOWED,method.toString());
  }
}