Fixes according latest upgrades

* Add `--add-opens` to `asciidoctor` Gradle task to avoid compilation warning
* Upgrade to Kotlin `1.6.10` and modify its Gradle task respective
* Add empty impl for new `AnnotationMetadataAdapter.getDeclaredMethods()`
* Parse HTTP methods to new `String methodNames` property of the `RequestMapping`
since `HttpMethod` is not an `enum` anymore.
* Ignore JDBC tests which rely on a map property resolution: the `[]` placeholder
is not handled in the latest SF anymore.
* Fix `WebFluxInboundEndpoint` for deprecations
This commit is contained in:
Artem Bilan
2022-01-06 17:24:11 -05:00
parent a80b22638d
commit b3ae24eac6
17 changed files with 205 additions and 163 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 the original author or authors.
* Copyright 2017-2022 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.
@@ -20,7 +20,6 @@ import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -52,6 +51,7 @@ import org.springframework.integration.support.AbstractIntegrationMessageBuilder
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.MultiValueMap;
import org.springframework.web.reactive.HandlerMapping;
import org.springframework.web.reactive.accept.HeaderContentTypeResolver;
@@ -463,7 +463,7 @@ public class WebFluxInboundEndpoint extends BaseHttpInboundEndpoint implements W
}
List<MediaType> result = new ArrayList<>(compatibleMediaTypes);
MediaType.sortBySpecificityAndQuality(result);
MimeTypeUtils.sortBySpecificity(result);
for (MediaType mediaType : result) {
if (mediaType.isConcrete()) {
@@ -517,9 +517,13 @@ public class WebFluxInboundEndpoint extends BaseHttpInboundEndpoint implements W
}
private static MediaType selectMoreSpecificMediaType(MediaType acceptable, MediaType producible) {
MediaType producibleToUse = producible.copyQualityValue(acceptable);
Comparator<MediaType> comparator = MediaType.SPECIFICITY_COMPARATOR;
return (comparator.compare(acceptable, producibleToUse) <= 0 ? acceptable : producibleToUse);
producible = producible.copyQualityValue(acceptable);
if (acceptable.isLessSpecific(producible)) {
return producible;
}
else {
return acceptable;
}
}
}