Program: 147709
Project: 147709
Buggy source:
private synchronized ConsistencyData getConsistencyData(MDMServerDef serverDef,IRepositoryViewObject viewObj){
  ConsistencyData consistencyData=consistencyMap.get(viewObj);
  if (consistencyData != null) {
    return consistencyData;
  }
  try {
    ConsistencyService consistencyService=ConsistencyService.getInstance();
    consistencyData=new ConsistencyData();
    ERepositoryObjectType viewType=viewObj.getRepositoryObjectType();
    if (viewType == null) {
      return null;
    }
    if (viewType == IServerObjectRepositoryType.TYPE_RESOURCE || viewType == IServerObjectRepositoryType.TYPE_JOB || viewType == IServerObjectRepositoryType.TYPE_WORKFLOW) {
      consistencyData.setCompareResult(CompareResultEnum.NOT_SUPPORT);
    }
 else {
      ArrayList<IRepositoryViewObject> viewObjs=new ArrayList<IRepositoryViewObject>();
      viewObjs.add(viewObj);
      Map<IRepositoryViewObject,WSDigest> digestValueResult=consistencyService.queryServerDigestValue(serverDef,viewObjs);
      WSDigest serverDigestTime=digestValueResult.get(viewObj);
      consistencyData.setServerDigestTime(serverDigestTime);
      consistencyService.updateCurrentDigestValue(viewObj);
      Item item=viewObj.getProperty().getItem();
      String ld=consistencyService.getLocalDigestValue(item);
      String cd=consistencyService.getCurrentDigestValue(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,ld,localTimestamp));
      CompareResultEnum result;
      if (serverDigestTime == null || serverDigestTime.getDigestValue() == null) {
        result=CompareResultEnum.NOT_EXIST_IN_SERVER;
      }
 else {
        String rd=serverDigestTime.getDigestValue();
        result=consistencyService.getCompareResult(cd,ld,rd);
      }
      consistencyData.setCompareResult(result);
    }
    consistencyMap.put(viewObj,consistencyData);
  }
 catch (  RemoteException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
  return consistencyData;
}

Fixed version (ground truth):
private synchronized ConsistencyData getConsistencyData(MDMServerDef serverDef,IRepositoryViewObject viewObj){
  ConsistencyData consistencyData=consistencyMap.get(viewObj);
  if (consistencyData != null) {
    return consistencyData;
  }
  try {
    ConsistencyService consistencyService=ConsistencyService.getInstance();
    consistencyData=new ConsistencyData();
    ERepositoryObjectType viewType=viewObj.getRepositoryObjectType();
    if (viewType == null) {
      return null;
    }
    if (viewType == IServerObjectRepositoryType.TYPE_RESOURCE || viewType == IServerObjectRepositoryType.TYPE_JOB || viewType == IServerObjectRepositoryType.TYPE_WORKFLOW) {
      consistencyData.setCompareResult(CompareResultEnum.NOT_SUPPORT);
    }
 else {
      List<IRepositoryViewObject> viewObjs=new ArrayList<IRepositoryViewObject>();
      viewObjs.add(viewObj);
      Map<IRepositoryViewObject,WSDigest> digestValueResult=consistencyService.queryServerDigestValue(serverDef,viewObjs);
      WSDigest serverDigestTime=digestValueResult.get(viewObj);
      consistencyData.setServerDigestTime(serverDigestTime);
      consistencyService.updateCurrentDigestValue(viewObj);
      Item item=viewObj.getProperty().getItem();
      String ld=consistencyService.getLocalDigestValue(item);
      String cd=consistencyService.getCurrentDigestValue(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,ld,localTimestamp));
      CompareResultEnum result;
      if (serverDigestTime == null || serverDigestTime.getDigestValue() == null) {
        result=CompareResultEnum.NOT_EXIST_IN_SERVER;
      }
 else {
        String rd=serverDigestTime.getDigestValue();
        result=consistencyService.getCompareResult(cd,ld,rd);
      }
      consistencyData.setCompareResult(result);
    }
    consistencyMap.put(viewObj,consistencyData);
  }
 catch (  RemoteException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
  return consistencyData;
}