诡异:代码执行到哪去了?
一个项目XP上运行正常,移到一台win7上却出现问题,经排查最终确定了问题范围,但出现的现像却让我无法理解:
static void check(String name,String key) throws EasyWebException
{
Element el = null;
try {
System.out.println("-------------start");
el = (Element)XPath.selectSingleNode(root, "client[@name='" + name + "']");
System.out.println("-------------ok");
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("==============="+e.getMessage());
//e.printStackTrace();
}
if(el == null){
throw new EasyWebException(100100,"Client:check 名称不存在");
}
else{
String md5 = el.getAttributeValue("key");
String t = Safety.encryptToMD5(key);
if(!md5.equals(t)){
throw new EasyWebException(100101,"Client:check 密码不正确");
}
}
}
el = (Element)XPath.selectSingleNode(root, "client[@name='" + name + "']");