diff --git a/spring-web/src/main/java/org/springframework/http/RequestEntity.java b/spring-web/src/main/java/org/springframework/http/RequestEntity.java index 30dd315d37c..c0caca3706e 100644 --- a/spring-web/src/main/java/org/springframework/http/RequestEntity.java +++ b/spring-web/src/main/java/org/springframework/http/RequestEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,6 +65,8 @@ import org.springframework.util.ObjectUtils; * @param the body type * @see #getMethod() * @see #getUrl() + * @see org.springframework.web.client.RestOperations#exchange(RequestEntity, Class) + * @see ResponseEntity */ public class RequestEntity extends HttpEntity { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java index b1edc344e4f..b2d6508bd99 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -398,7 +398,7 @@ class DefaultWebClient implements WebClient { private static class DefaultResponseSpec implements ResponseSpec { - private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400; + private static final IntPredicate STATUS_CODE_ERROR = (value -> value >= 400); private static final StatusHandler DEFAULT_STATUS_HANDLER = new StatusHandler(STATUS_CODE_ERROR, DefaultResponseSpec::createResponseException); @@ -418,6 +418,7 @@ class DefaultWebClient implements WebClient { @Override public ResponseSpec onStatus(Predicate statusPredicate, Function> exceptionFunction) { + return onRawStatus(toIntPredicate(statusPredicate), exceptionFunction); }