Skip to content

Commit 4b93cdf

Browse files
garyrussellartembilan
authored andcommitted
KafkaAdmin: fix usage of the Map.of()
* Fix `KafkaAdmin` to use `Collections.singletonMap()` instead of `Map.of()` which is not available for Java 8 yet
1 parent 989fb29 commit 4b93cdf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/KafkaAdmin.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2017-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -342,8 +342,9 @@ private void adjustConfigMismatches(AdminClient adminClient, Collection<NewTopic
342342
}
343343
if (alterConfigOperations.size() > 0) {
344344
try {
345-
AlterConfigsResult alterConfigsResult = adminClient
346-
.incrementalAlterConfigs(Map.of(topicConfigResource, alterConfigOperations));
345+
AlterConfigsResult alterConfigsResult =
346+
adminClient.incrementalAlterConfigs(
347+
Collections.singletonMap(topicConfigResource, alterConfigOperations));
347348
alterConfigsResult.all().get(this.operationTimeout, TimeUnit.SECONDS);
348349
}
349350
catch (InterruptedException ie) {

0 commit comments

Comments
 (0)