jersey webtarget总是返回新的引用

mwg9r5ms  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(226)
WebTarget w0 = webTarget;
    WebTarget w1 = webTarget.queryParam("throwException", true);
    WebTarget w2 = webTarget.path(path);

    System.out.println(w0.getClass());

if (w0 == w1) {
    int x = 10;
    x = 20;
}

if (w1 == w2) {
    int x = 10;
    x = 20;
}

所有这些都将永远不会进入。webtarget总是返回新对象。这真的很奇怪。为什么它不返回这个引用?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题