Program: 62680
Project: 62680
Buggy source:
@Override public Object intercept(MethodInvocationContext<Object,Object> context){
  Client clientAnnotation=context.getAnnotation(Client.class);
  if (clientAnnotation == null) {
    throw new IllegalStateException("String_Node_Str" + context);
  }
  ClientRegistration reg=getClient(clientAnnotation);
  Optional<Class<? extends Annotation>> httpMethodMapping=context.getAnnotationTypeByStereotype(HttpMethodMapping.class);
  if (httpMethodMapping.isPresent()) {
    String uri=context.getValue(HttpMethodMapping.class,String.class).orElse("String_Node_Str");
    Class<? extends Annotation> annotationType=httpMethodMapping.get();
    HttpMethod httpMethod=HttpMethod.valueOf(annotationType.getSimpleName().toUpperCase());
    ReturnType returnType=context.getReturnType();
    Class<?> javaReturnType=returnType.getType();
    String contextPath=reg.contextPath;
    UriMatchTemplate uriTemplate=UriMatchTemplate.of(contextPath != null ? contextPath : "String_Node_Str");
    if (!(uri.length() == 1 && uri.charAt(0) == '/')) {
      uriTemplate=uriTemplate.nest(uri);
    }
    Map<String,Object> paramMap=context.getParameterValueMap();
    List<String> uriVariables=uriTemplate.getVariables();
    boolean variableSatisfied=uriVariables.isEmpty() || uriVariables.containsAll(paramMap.keySet());
    MutableHttpRequest<Object> request;
    Object body=null;
    Map<String,MutableArgumentValue<?>> parameters=context.getParameters();
    Argument[] arguments=context.getArguments();
    Map<String,String> headers=new LinkedHashMap<>(3);
    List<Argument> bodyArguments=new ArrayList<>();
    for (    Argument argument : arguments) {
      String argumentName=argument.getName();
      if (argument.isAnnotationPresent(Body.class)) {
        body=parameters.get(argumentName).getValue();
        break;
      }
 else       if (argument.isAnnotationPresent(Header.class)) {
        String headerName=argument.getAnnotation(Header.class).value();
        if (StringUtils.isEmpty(headerName)) {
          headerName=NameUtils.hyphenate(argumentName);
        }
        MutableArgumentValue<?> value=parameters.get(argumentName);
        String finalHeaderName=headerName;
        ConversionService.SHARED.convert(value.getValue(),String.class).ifPresent(o -> headers.put(finalHeaderName,o));
      }
 else       if (!uriVariables.contains(argumentName)) {
        bodyArguments.add(argument);
      }
    }
    if (HttpMethod.permitsRequestBody(httpMethod)) {
      if (body == null && !bodyArguments.isEmpty()) {
        Map<String,Object> bodyMap=new LinkedHashMap<>();
        for (        Argument bodyArgument : bodyArguments) {
          String argumentName=bodyArgument.getName();
          MutableArgumentValue<?> value=parameters.get(argumentName);
          bodyMap.put(argumentName,value.getValue());
        }
        body=bodyMap;
      }
      if (body != null) {
        if (!variableSatisfied) {
          if (body instanceof Map) {
            paramMap.putAll((Map)body);
            uri=uriTemplate.expand(paramMap);
            request=HttpRequest.create(httpMethod,uri);
          }
 else {
            paramMap.putAll(BeanMap.of(body));
            uri=uriTemplate.expand(paramMap);
            request=HttpRequest.create(httpMethod,uri);
          }
        }
 else {
          uri=uriTemplate.expand(paramMap);
          request=HttpRequest.create(httpMethod,uri);
        }
        request.body(body);
      }
 else {
        uri=uriTemplate.expand(paramMap);
        request=HttpRequest.create(httpMethod,uri);
      }
    }
 else {
      uri=uriTemplate.expand(paramMap);
      request=HttpRequest.create(httpMethod,uri);
    }
    if (!headers.isEmpty()) {
      for (      Map.Entry<String,String> entry : headers.entrySet()) {
        request.header(entry.getKey(),entry.getValue());
      }
    }
    HttpClient httpClient=reg.httpClient;
    boolean isFuture=CompletableFuture.class.isAssignableFrom(javaReturnType);
    if (Publishers.isPublisher(javaReturnType) || isFuture) {
      Argument<?> publisherArgument=returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
      Class<?> argumentType=publisherArgument.getType();
      Publisher<?> publisher;
      if (HttpResponse.class.isAssignableFrom(argumentType)) {
        publisher=httpClient.exchange(request,returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT));
      }
 else {
        publisher=httpClient.retrieve(request,publisherArgument);
      }
      if (isFuture) {
        CompletableFuture<Object> future=new CompletableFuture<>();
        publisher.subscribe(new CompletionAwareSubscriber<Object>(){
          AtomicReference<Object> reference=new AtomicReference<>();
          @Override protected void doOnSubscribe(          Subscription subscription){
            subscription.request(1);
          }
          @Override protected void doOnNext(          Object message){
            reference.set(message);
          }
          @Override protected void doOnError(          Throwable t){
            if (t instanceof HttpClientResponseException) {
              HttpClientResponseException e=(HttpClientResponseException)t;
              if (e.getStatus() == HttpStatus.NOT_FOUND) {
                future.complete(null);
              }
 else {
                future.completeExceptionally(t);
              }
            }
            future.completeExceptionally(t);
          }
          @Override protected void doOnComplete(){
            future.complete(reference.get());
          }
        }
);
        return future;
      }
 else {
        Object finalPublisher=ConversionService.SHARED.convert(publisher,javaReturnType).orElseThrow(() -> new HttpClientException("String_Node_Str" + javaReturnType));
        for (        ClientPublisherResultTransformer transformer : transformers) {
          finalPublisher=transformer.transform(finalPublisher);
        }
        return finalPublisher;
      }
    }
 else {
      BlockingHttpClient blockingHttpClient=httpClient.toBlocking();
      if (HttpResponse.class.isAssignableFrom(javaReturnType)) {
        return blockingHttpClient.exchange(request,returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT));
      }
 else       if (void.class == javaReturnType) {
        blockingHttpClient.exchange(request);
        return null;
      }
 else {
        try {
          return blockingHttpClient.retrieve(request,returnType.asArgument());
        }
 catch (        HttpClientResponseException e) {
          if (e.getStatus() == HttpStatus.NOT_FOUND) {
            if (javaReturnType == Optional.class) {
              return Optional.empty();
            }
            return null;
          }
          throw e;
        }
      }
    }
  }
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Object intercept(MethodInvocationContext<Object,Object> context){
  Client clientAnnotation=context.getAnnotation(Client.class);
  if (clientAnnotation == null) {
    throw new IllegalStateException("String_Node_Str" + context);
  }
  ClientRegistration reg=getClient(clientAnnotation);
  Optional<Class<? extends Annotation>> httpMethodMapping=context.getAnnotationTypeByStereotype(HttpMethodMapping.class);
  if (httpMethodMapping.isPresent()) {
    String uri=context.getValue(HttpMethodMapping.class,String.class).orElse("String_Node_Str");
    Class<? extends Annotation> annotationType=httpMethodMapping.get();
    HttpMethod httpMethod=HttpMethod.valueOf(annotationType.getSimpleName().toUpperCase());
    ReturnType returnType=context.getReturnType();
    Class<?> javaReturnType=returnType.getType();
    String contextPath=reg.contextPath;
    UriMatchTemplate uriTemplate=UriMatchTemplate.of(contextPath != null ? contextPath : "String_Node_Str");
    if (!(uri.length() == 1 && uri.charAt(0) == '/')) {
      uriTemplate=uriTemplate.nest(uri);
    }
    Map<String,Object> paramMap=context.getParameterValueMap();
    List<String> uriVariables=uriTemplate.getVariables();
    boolean variableSatisfied=uriVariables.isEmpty() || uriVariables.containsAll(paramMap.keySet());
    MutableHttpRequest<Object> request;
    Object body=null;
    Map<String,MutableArgumentValue<?>> parameters=context.getParameters();
    Argument[] arguments=context.getArguments();
    Map<String,String> headers=new LinkedHashMap<>(3);
    List<Argument> bodyArguments=new ArrayList<>();
    for (    Argument argument : arguments) {
      String argumentName=argument.getName();
      if (argument.isAnnotationPresent(Body.class)) {
        body=parameters.get(argumentName).getValue();
        break;
      }
 else       if (argument.isAnnotationPresent(Header.class)) {
        String headerName=argument.getAnnotation(Header.class).value();
        if (StringUtils.isEmpty(headerName)) {
          headerName=NameUtils.hyphenate(argumentName);
        }
        MutableArgumentValue<?> value=parameters.get(argumentName);
        String finalHeaderName=headerName;
        ConversionService.SHARED.convert(value.getValue(),String.class).ifPresent(o -> headers.put(finalHeaderName,o));
      }
 else       if (!uriVariables.contains(argumentName)) {
        bodyArguments.add(argument);
      }
    }
    if (HttpMethod.permitsRequestBody(httpMethod)) {
      if (body == null && !bodyArguments.isEmpty()) {
        Map<String,Object> bodyMap=new LinkedHashMap<>();
        for (        Argument bodyArgument : bodyArguments) {
          String argumentName=bodyArgument.getName();
          MutableArgumentValue<?> value=parameters.get(argumentName);
          bodyMap.put(argumentName,value.getValue());
        }
        body=bodyMap;
      }
      if (body != null) {
        if (!variableSatisfied) {
          if (body instanceof Map) {
            paramMap.putAll((Map)body);
            uri=uriTemplate.expand(paramMap);
            request=HttpRequest.create(httpMethod,uri);
          }
 else {
            paramMap.putAll(BeanMap.of(body));
            uri=uriTemplate.expand(paramMap);
            request=HttpRequest.create(httpMethod,uri);
          }
        }
 else {
          uri=uriTemplate.expand(paramMap);
          request=HttpRequest.create(httpMethod,uri);
        }
        request.body(body);
      }
 else {
        uri=uriTemplate.expand(paramMap);
        request=HttpRequest.create(httpMethod,uri);
      }
    }
 else {
      uri=uriTemplate.expand(paramMap);
      request=HttpRequest.create(httpMethod,uri);
    }
    if (!headers.isEmpty()) {
      for (      Map.Entry<String,String> entry : headers.entrySet()) {
        request.header(entry.getKey(),entry.getValue());
      }
    }
    HttpClient httpClient=reg.httpClient;
    boolean isFuture=CompletableFuture.class.isAssignableFrom(javaReturnType);
    if (Publishers.isPublisher(javaReturnType) || isFuture) {
      Argument<?> publisherArgument=returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
      Class<?> argumentType=publisherArgument.getType();
      Publisher<?> publisher;
      if (HttpResponse.class.isAssignableFrom(argumentType)) {
        publisher=httpClient.exchange(request,returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT));
      }
 else {
        publisher=httpClient.retrieve(request,publisherArgument);
      }
      if (isFuture) {
        CompletableFuture<Object> future=new CompletableFuture<>();
        publisher.subscribe(new CompletionAwareSubscriber<Object>(){
          AtomicReference<Object> reference=new AtomicReference<>();
          @Override protected void doOnSubscribe(          Subscription subscription){
            subscription.request(1);
          }
          @Override protected void doOnNext(          Object message){
            reference.set(message);
          }
          @Override protected void doOnError(          Throwable t){
            if (t instanceof HttpClientResponseException) {
              HttpClientResponseException e=(HttpClientResponseException)t;
              if (e.getStatus() == HttpStatus.NOT_FOUND) {
                future.complete(null);
              }
 else {
                future.completeExceptionally(t);
              }
            }
            future.completeExceptionally(t);
          }
          @Override protected void doOnComplete(){
            future.complete(reference.get());
          }
        }
);
        return future;
      }
 else {
        Object finalPublisher=ConversionService.SHARED.convert(publisher,javaReturnType).orElseThrow(() -> new HttpClientException("String_Node_Str" + javaReturnType));
        for (        ClientPublisherResultTransformer transformer : transformers) {
          finalPublisher=transformer.transform(finalPublisher);
        }
        return finalPublisher;
      }
    }
 else {
      BlockingHttpClient blockingHttpClient=httpClient.toBlocking();
      if (HttpResponse.class.isAssignableFrom(javaReturnType)) {
        return blockingHttpClient.exchange(request,returnType.asArgument().getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT));
      }
 else       if (void.class == javaReturnType) {
        blockingHttpClient.exchange(request);
        return null;
      }
 else {
        try {
          return blockingHttpClient.retrieve(request,returnType.asArgument());
        }
 catch (        HttpClientResponseException e) {
          if (e.getStatus() == HttpStatus.NOT_FOUND) {
            if (javaReturnType == Optional.class) {
              return Optional.empty();
            }
            return null;
          }
          throw e;
        }
      }
    }
  }
  throw new UnsupportedOperationException("String_Node_Str" + context + "String_Node_Str");
}