Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在通过构造函数内部的设置器在我的 DTO 中初始化一些成员变量。
但是下面的 pmd 错误显示了如何消除该 pmd 规则违规?
对象构造期间调用的覆盖方法“setAbc”
class A{ private String x; public getX(){ return x; } public setX(String x){ this.x = x ; } A(){} A(B b){ setX("C"); }
}
如何使方法setX最终?或者也许是整个班级的活动?
setX