spring webflux - Spotbugs + Java: EI_EXPOSE_REP2 may expose internal representation by storing an externally mutable object into

Small question regarding a Spotbugs finding I am having a hard time fixing.In this super simple class:

Small question regarding a Spotbugs finding I am having a hard time fixing.

In this super simple class:

import .springframework.web.reactive.function.client.WebClient;

@Service
public final class MyService {
    
    private final WebClient webClient;
    
    public MyService(final WebClient client) {
        this.webClient = client;
    }

I am getting flagged on the observationRegistry with

may expose internal representation by storing an externally mutable object into MyService.webClient

I tried invoking a possible clone() method on the web client, but no luck.

How do I fix this?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744015640a4543921.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信