定义了一个父类一个子类
public class MSGVO {
private long msgId;
public long getMsgId() {
return msgId;
}
public void setMsgId(long msgId) {
this.msgId = msgId;
}
}
public class ParamMsgVO extends MSGVO {
public void setMsgId(String maxId) {
if (StringUtils.isNotEmpty(maxId)) {
setMsgId(Long.parseLong(maxId));
}
}
}
然后在调用paramMsgVO.setMsgId(maxId);的时候偶尔会报
[ERROR][2013-07-26 00:18:16,099]Illegal overloaded setter method for property msgId in class com.hisense.hitv.msgpullservice.service.beans.ParamMsgVO. This breaks the JavaBeans specification and can cause unpredicatble results.
这个写有什么问题吗?为什么不是每次都报错?