public void saveMultiplexCfgSrc(MultiplexCfgSrc multiplexCfgSrc)
{
if (multiplexCfgSrc == null)
{
LOGGER.runtime.error("");
throw new WFException("");
} if (StringUtils.isBlank(multiplexCfgSrc.getId()))
{
try
{
multiplexCfgSrcDAO.createMultiplexCfgSrc(multiplexCfgSrc);
}
catch (BMEException e)
{
LOGGER.runtime.error(
WFELogCodeConst.O_CREATE_MULTIPLEX_CFG_SRC_FAILED,
e,
multiplexCfgSrc.toString());
throw new WFException(
WFEErrorCodeConst.E_CREATE_MULTIPLEX_CFG_SRC_FAILED, e);
}
}
只要传一个null就可以报第一个异常!MultiplexCfgSrc multiplexCfgSrc = null;dao.saveMultiplexCfgSrc(multiplexCfgSrc) ;
把代码中的Try块去掉,异常不就出现了吗?
}catch(Exception e) {
e.printStackTrace();
}
public void saveMultiplexCfgSrc(MultiplexCfgSrc multiplexCfgSrc){
try {
if (multiplexCfgSrc == null) {
LOGGER.runtime.error("");
throw new WFException("");
}
if (StringUtils.isBlank(multiplexCfgSrc.getId())){
multiplexCfgSrcDAO.createMultiplexCfgSrc(multiplexCfgSrc);
}
}catch (BMEException e) {
LOGGER.runtime.error(
WFELogCodeConst.O_CREATE_MULTIPLEX_CFG_SRC_FAILED, e,
multiplexCfgSrc.toString());
throw new WFException(
WFEErrorCodeConst.E_CREATE_MULTIPLEX_CFG_SRC_FAILED, e);
}
}