Spring bom使用错误

Spring bom usage error

MDC 的先前实施使用了

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${spring.version}</version>
</dependency>

现在我打算使用

<dependency>
    <groupId>io.spring.platform</groupId>
    <artifactId>platform-bom</artifactId>
    <version>2.0.1.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

但是之前运行的代码:

private final Map<?, ?> parentContext; // initialized in constructor
MDC.setContextMap(parentContext);

上面一行给出了错误:

The method setContextMap(Map<String,String>) in the type MDC is not applicable for the arguments (Map<capture#5-of ?,capture#6-of ?>)

请多多指教。

由于升级,MDC 依赖项已升级,方法签名已更改。所以我基本上改变了变量的实现

private final Map<?, ?> parentContext;

private final Map<String, String> parentContext;

问题已解决。