Groovy脚本 - 错误解组返回

时间:2017-01-05 09:40:20

标签: groovy

我正在研究这个功能:

void SetHouseName(House house)
{
  PlayerHouse = house.Name;
}

我收到了这个错误:

if ( (myFsName != null)  ) {
    try {
        s_log.trace("Process >         >> setAdminGroup > RelCI is Node > FS event > checking FS name is null > NOT null");
        s_log.trace("Process >         >> setAdminGroup > RelCI is Node > FS event > checking FS name is null > NOT null" + relCiID + myFsName + myNodeNameHint);
        String adminGrp = ucmdbCache.get(myNodeNameHint).get(myFsName);
        s_log.trace("Process >         >> setAdminGroup > RelCI is Node > FS event > checking admingrp >" + adminGrp);
        if(adminGrp == null){
            s_log.trace("Process >         >> setAdminGroup > RelCI is Node > FS event > checking ADMIN GROUP is null > IS null");
            adminGrp = dataSHM.get(relCiID).get(adminGroupAttrName); 
        }
        evt.addCustomAttribute (adminGroupCaName,adminGrp);
        s_log.trace("Process >         >> setAdminGroup > RelCI is Node > FS event > Added Custom attribute" + adminGroupCaName + adminGrp);
        return; // nothing else to do
    } catch (Exception e) {
        s_log.error("        >> setAdminGroup > Error: " + e.getMessage());
    }
} else {
// if I was not able to extract FS name I don\'t return: fall back to node
}

我认为与 return 命令有关,请对此有任何建议吗?

谢谢, 的Fabrizio

1 个答案:

答案 0 :(得分:0)

我想通知您,我已经解决了以前的错误,主要是更改了我的脚本并计算了现在 ucmdbCache hashmap而没有使用外部函数,而是在主函数上使用它。

此致 的Fabrizio