Program: 5823
Project: 5823
Buggy source:
/** 
 * Check if entity has changed since last save point
 * @param entity entity to check
 * @param propName property name
 * @param value
 * @return entity is dirty
 */
@SuppressWarnings("String_Node_Str") public boolean isEntityChanged(Object entity,Object embedded,String propName,Object value){
  boolean saveTracking=trackingContext.isEnabled();
  try {
    trackingContext.setEnabled(false);
    boolean dirty=false;
    Map<String,Object> pval=dataManager.getPropertyValues(entity,true,false);
    Map<String,Object> save=savedProperties.get(entity);
    if (embedded == null)     embedded=entity;
    for (    String p : pval.keySet()) {
      Object val=(entity == embedded && p.equals(propName)) ? value : 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[])))) {
        dirty=true;
        break;
      }
 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))) {
          dirty=true;
          break;
        }
      }
 else       if (save != null && (isEntity(val) || isEntity(saveval))) {
        if (saveval != null && val != save.get(p)) {
          dirty=true;
          break;
        }
      }
 else       if ((val instanceof List<?> || val instanceof Map<?,?>) && !(val instanceof LazyableCollection && !((LazyableCollection)val).isInitialized())) {
        List<Change> savedArray=(List<Change>)saveval;
        if (savedArray != null && !savedArray.isEmpty()) {
          dirty=true;
          break;
        }
      }
 else       if (val != null && !(isEntity(val) || ObjectUtil.isSimple(val) || val instanceof Enum|| val instanceof Value|| val instanceof byte[]) && isEntityChanged(val)) {
        dirty=true;
        break;
      }
    }
    return dirty;
  }
  finally {
    trackingContext.setEnabled(saveTracking);
  }
}

Fixed version (ground truth):
/** 
 * Check if entity has changed since last save point
 * @param entity entity to check
 * @param propName property name
 * @param value
 * @return entity is dirty
 */
@SuppressWarnings("String_Node_Str") public boolean isEntityChanged(Object entity,Object embedded,String propName,Object value){
  if (!dataManager.isInitialized(entity))   return false;
  boolean saveTracking=trackingContext.isEnabled();
  try {
    trackingContext.setEnabled(false);
    boolean dirty=false;
    Map<String,Object> pval=dataManager.getPropertyValues(entity,true,false);
    Map<String,Object> save=savedProperties.get(entity);
    if (embedded == null)     embedded=entity;
    for (    String p : pval.keySet()) {
      Object val=(entity == embedded && p.equals(propName)) ? value : 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[])))) {
        dirty=true;
        break;
      }
 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))) {
          dirty=true;
          break;
        }
      }
 else       if (save != null && (isEntity(val) || isEntity(saveval))) {
        if (saveval != null && val != save.get(p)) {
          dirty=true;
          break;
        }
      }
 else       if ((val instanceof List<?> || val instanceof Map<?,?>)) {
        if (!dataManager.isInitialized(val))         continue;
        List<Change> savedArray=(List<Change>)saveval;
        if (savedArray != null && !savedArray.isEmpty()) {
          dirty=true;
          break;
        }
      }
 else       if (val != null && !(isEntity(val) || ObjectUtil.isSimple(val) || val instanceof Enum|| val instanceof Value|| val instanceof byte[]) && isEntityChanged(val)) {
        dirty=true;
        break;
      }
    }
    return dirty;
  }
  finally {
    trackingContext.setEnabled(saveTracking);
  }
}