Program: 5822
Project: 5822
Buggy source:
private boolean isEntityDeepChanged(Object entity,Object embedded,IdentityHashMap<Object,Boolean> cache){
  if (cache == null)   cache=new IdentityHashMap<Object,Boolean>();
  if (cache.containsKey(entity))   return false;
  cache.put(entity,true);
  boolean saveTracking=trackingContext.isEnabled();
  try {
    trackingContext.setEnabled(false);
    Map<String,Object> pval=dataManager.getPropertyValues(entity,true,false);
    if (embedded == null)     embedded=entity;
    Map<String,Object> save=savedProperties.get(entity);
    for (    String p : pval.keySet()) {
      Object val=pval.get(p);
      Object saveval=save != null ? save.get(p) : null;
      if (save != null && ((val != null && (ObjectUtil.isSimple(val) || val instanceof byte[])) || (saveval != null && (ObjectUtil.isSimple(saveval) || saveval instanceof byte[])))) {
        return true;
      }
 else       if (save != null && (val instanceof Value || saveval instanceof Value || val instanceof Enum|| saveval instanceof Enum)) {
        if (saveval != null && ((val == null && saveval != null) || !val.equals(saveval))) {
          return true;
        }
      }
 else       if (save != null && (isEntity(val) || isEntity(saveval))) {
        if (saveval != null && val != save.get(p))         return true;
        if (isEntityDeepChanged(val,null,cache))         return true;
      }
 else       if (val instanceof List<?> || val instanceof Map<?,?>) {
        if (!dataManager.isInitialized(val))         return false;
        @SuppressWarnings("String_Node_Str") List<Change> savedArray=(List<Change>)saveval;
        if (savedArray != null && !savedArray.isEmpty())         return true;
        if (val instanceof List<?>) {
          for (          Object elt : (List<?>)val) {
            if (isEntityDeepChanged(elt,null,cache))             return true;
          }
        }
 else         if (val instanceof Map<?,?>) {
          for (          Entry<?,?> me : ((Map<?,?>)val).entrySet()) {
            if (isEntityDeepChanged(me.getKey(),null,cache))             return true;
            if (isEntityDeepChanged(me.getValue(),null,cache))             return true;
          }
        }
      }
 else       if (val != null && !(isEntity(val) || ObjectUtil.isSimple(val) || val instanceof Enum|| val instanceof Value|| val instanceof byte[]) && isEntityDeepChanged(val,embedded,cache)) {
        return true;
      }
    }
  }
  finally {
    trackingContext.setEnabled(saveTracking);
  }
  return false;
}

Fixed version (ground truth):
private boolean isEntityDeepChanged(Object entity,Object embedded,IdentityHashMap<Object,Boolean> cache){
  if (cache == null)   cache=new IdentityHashMap<Object,Boolean>();
  if (cache.containsKey(entity))   return false;
  cache.put(entity,true);
  if (!dataManager.isInitialized(entity))   return false;
  boolean saveTracking=trackingContext.isEnabled();
  try {
    trackingContext.setEnabled(false);
    Map<String,Object> pval=dataManager.getPropertyValues(entity,true,false);
    if (embedded == null)     embedded=entity;
    Map<String,Object> save=savedProperties.get(entity);
    for (    String p : pval.keySet()) {
      Object val=pval.get(p);
      Object saveval=save != null ? save.get(p) : null;
      if (save != null && ((val != null && (ObjectUtil.isSimple(val) || val instanceof byte[])) || (saveval != null && (ObjectUtil.isSimple(saveval) || saveval instanceof byte[])))) {
        return true;
      }
 else       if (save != null && (val instanceof Value || saveval instanceof Value || val instanceof Enum|| saveval instanceof Enum)) {
        if (saveval != null && ((val == null && saveval != null) || !val.equals(saveval))) {
          return true;
        }
      }
 else       if (save != null && (isEntity(val) || isEntity(saveval))) {
        if (saveval != null && val != save.get(p))         return true;
        if (isEntityDeepChanged(val,null,cache))         return true;
      }
 else       if (val instanceof List<?> || val instanceof Map<?,?>) {
        if (!dataManager.isInitialized(val))         continue;
        @SuppressWarnings("String_Node_Str") List<Change> savedArray=(List<Change>)saveval;
        if (savedArray != null && !savedArray.isEmpty())         return true;
        if (val instanceof List<?>) {
          for (          Object elt : (List<?>)val) {
            if (isEntityDeepChanged(elt,null,cache))             return true;
          }
        }
 else         if (val instanceof Map<?,?>) {
          for (          Entry<?,?> me : ((Map<?,?>)val).entrySet()) {
            if (isEntityDeepChanged(me.getKey(),null,cache))             return true;
            if (isEntityDeepChanged(me.getValue(),null,cache))             return true;
          }
        }
      }
 else       if (val != null && !(isEntity(val) || ObjectUtil.isSimple(val) || val instanceof Enum|| val instanceof Value|| val instanceof byte[]) && isEntityDeepChanged(val,embedded,cache)) {
        return true;
      }
    }
  }
  finally {
    trackingContext.setEnabled(saveTracking);
  }
  return false;
}