private static String rerootPath(DataRepository data, String defectPath, Map wbsIdMap) {
SaveableData wbsIdValue = data.getInheritableValue(defectPath, "Project_WBS_ID");
if (wbsIdValue == null)
return defectPath;
SimpleData wbsIdSimpleValue = wbsIdValue.getSimpleValue();
if (wbsIdSimpleValue == null)
return defectPath;
String wbsID = wbsIdSimpleValue.format();
while (wbsID != null && wbsID.length() > 0) {
String result = (String) wbsIdMap.get(wbsID);
if (result != null)
return result;
wbsID = DataRepository.chopPath(wbsID);