当前位置: 代码迷 >> J2SE >> 维护效能,看到代码无限头疼
  详细解决方案

维护效能,看到代码无限头疼

热度:97   发布时间:2016-04-24 00:30:03.0
维护功能,看到代码无限头疼
Java code
public Map getMenuAccessMap(long userId) {    if (new Long(userId) == null || "".equals(userId)) {        throw new NullObjectException("用户Id不能为空");    }


你们有什么想说的?

------解决方案--------------------
坑爹的代码
------解决方案--------------------
new Long(userId) == null这永远都不成立
"".equals(userId)判断long为空字符串,这哥们可真有想象力
  相关解决方案