Program: 147725
Project: 147725
Buggy source:
private Map<TreeObject,ConsistencyData> initConsistencyData(MDMServerDef serverDef,List<TreeObject> treeObjs){
  Map<TreeObject,ConsistencyData> map=new HashMap<TreeObject,TreeObjectCheckTreeViewer.ConsistencyData>();
  try {
    ConsistencyService consistencyService=ConsistencyService.getInstance();
    Map<TreeObject,WSDigestValueTimeStamp> serverDigestValues=consistencyService.queryServerDigestValue(serverDef,treeObjs);
    for (    TreeObject treeObject : treeObjs) {
      ConsistencyData consistencyData=new ConsistencyData();
      WSDigestValueTimeStamp serverDigestTime=serverDigestValues.get(treeObject);
      consistencyData.setServerDigestTime(serverDigestTime);
      String objName=treeObject.getDisplayName();
      ERepositoryObjectType viewType=RepositoryQueryService.getRepositoryObjectType(treeObject.getType());
      if (viewType == null) {
        continue;
      }
      IRepositoryViewObject viewObj=RepositoryResourceUtil.findViewObjectByName(viewType,objName);
      if (viewObj == null) {
        consistencyData.setCompareResult(CompareResultEnum.NOT_EXIST_IN_LOCAL);
      }
 else {
        Item item=viewObj.getProperty().getItem();
        consistencyService.updateLocalDigestValue(viewObj);
        String digestValue=consistencyService.getLocalDigestValue(item);
        long localTimestamp=consistencyService.getLocalTimestamp(item);
        consistencyData.setLocalDigestTime(new WSDigestValueTimeStamp(digestValue,localTimestamp));
        CompareResultEnum result;
        if (serverDigestTime == null) {
          result=CompareResultEnum.NOT_EXIST_IN_SERVER;
        }
 else {
          if (serverDigestTime.getDigestValue().equals(digestValue)) {
            result=CompareResultEnum.SAME;
          }
 else {
            result=CompareResultEnum.DIFFERENT;
          }
        }
        consistencyData.setCompareResult(result);
      }
      map.put(treeObject,consistencyData);
    }
  }
 catch (  RemoteException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
  return map;
}

Fixed version (ground truth):
private Map<TreeObject,ConsistencyData> initConsistencyData(MDMServerDef serverDef,List<TreeObject> treeObjs){
  Map<TreeObject,ConsistencyData> map=new HashMap<TreeObject,TreeObjectCheckTreeViewer.ConsistencyData>();
  try {
    ConsistencyService consistencyService=ConsistencyService.getInstance();
    Map<TreeObject,WSDigest> serverDigestValues=consistencyService.queryServerDigestValue(serverDef,treeObjs);
    for (    TreeObject treeObject : treeObjs) {
      ConsistencyData consistencyData=new ConsistencyData();
      WSDigest serverDigestTime=serverDigestValues.get(treeObject);
      consistencyData.setServerDigestTime(serverDigestTime);
      String objName=treeObject.getDisplayName();
      ERepositoryObjectType viewType=RepositoryQueryService.getRepositoryObjectType(treeObject.getType());
      if (viewType == null) {
        continue;
      }
      IRepositoryViewObject viewObj=RepositoryResourceUtil.findViewObjectByName(viewType,objName);
      if (viewObj == null) {
        consistencyData.setCompareResult(CompareResultEnum.NOT_EXIST_IN_LOCAL);
      }
 else {
        Item item=viewObj.getProperty().getItem();
        consistencyService.updateLocalDigestValue(viewObj);
        String digestValue=consistencyService.getLocalDigestValue(item);
        long localTimestamp=consistencyService.getLocalTimestamp(item);
        String type=viewObj.getRepositoryObjectType().getKey();
        String objectName=viewObj.getLabel();
        WSDigestKey key=new WSDigestKey(type,objectName);
        consistencyData.setLocalDigestTime(new WSDigest(key,digestValue,localTimestamp));
        CompareResultEnum result;
        if (serverDigestTime == null) {
          result=CompareResultEnum.NOT_EXIST_IN_SERVER;
        }
 else {
          if (serverDigestTime.getDigestValue().equals(digestValue)) {
            result=CompareResultEnum.SAME;
          }
 else {
            result=CompareResultEnum.DIFFERENT;
          }
        }
        consistencyData.setCompareResult(result);
      }
      map.put(treeObject,consistencyData);
    }
  }
 catch (  RemoteException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
  return map;
}