Program: 84902
Project: 84902
Buggy source:
/** 
 * note, that beans must be detached.
 */
public <T>Collection<T> translateBeans(Collection<T> beans,String languageCode,boolean deep){
  System.err.println("String_Node_Str");
  Iterator<T> it=beans.iterator();
  if (!it.hasNext()) {
    return beans;
  }
  String lc=languageCode.toUpperCase();
  Class<T> entityClass;
{
    T bean=it.next();
    entityClass=JpaHelper.findSameOrSuperJpaEntity(bean.getClass());
    if (entityClass == null) {
      return beans;
    }
  }
  EntityCacheEntry<T> metaDataEntry=getOrCreateEntityCacheEntry(entityClass.getName());
  if (metaDataEntry == null) {
    throw new IllegalArgumentException("String_Node_Str" + entityClass + "String_Node_Str");
  }
  Map<String,BundleInfo> bis=new TreeMap<String,BundleInfo>();
  for (  JpaEntityProperty<T,String> p : metaDataEntry.stringPropertiesByName.values()) {
    String poName=p.getEntityClass().getName();
    EntityCacheEntry poEntry=getOrCreateEntityCacheEntry(poName);
    if (!bis.containsKey(poName)) {
      if (poEntry.tt != null) {
        BundleInfo bi=poEntry.tt.getBundle();
        boolean supportedLanguageFound=false;
        for (        LanguageInfo li : bi.getSupportedLanguages()) {
          if (li.getCode().equalsIgnoreCase(languageCode)) {
            supportedLanguageFound=true;
            break;
          }
        }
        if (!supportedLanguageFound) {
          throw new IllegalArgumentException("String_Node_Str" + languageCode + "String_Node_Str");
        }
        bis.put(poName,bi);
      }
    }
  }
  List<Object> ids=new ArrayList<Object>();
  for (  T bean : beans) {
    ids.add(metaDataEntry.idProperty.getValue(bean));
  }
  Map<String,List<List<String>>> translatedPerClass=new TreeMap<String,List<List<String>>>();
  Map<String,List<JpaEntityProperty<? super T,String>>> propertiesPerClass=new TreeMap<String,List<JpaEntityProperty<? super T,String>>>();
  for (  Map.Entry<String,EntityCacheEntry<? super T>> e : metaDataEntry.slicedEntries.entrySet()) {
    TranslationTable tt=e.getValue().tt;
    if (tt == null)     continue;
    List<JpaEntityProperty<? super T,String>> fieldProperties=new ArrayList<JpaEntityProperty<? super T,String>>();
    for (    TranslationTableColumn tc : tt.getTranslatedColumns()) {
      JpaEntityProperty<? super T,String> fieldProperty=e.getValue().stringPropertiesByNormalizedColumnName.get(tc.getColumnName());
      if (fieldProperty == null) {
        throw new IllegalStateException("String_Node_Str" + tc.getColumnName());
      }
      fieldProperties.add(fieldProperty);
    }
    List<List<String>> translatedForKey=translateFieldsByIds(languageCode,e.getValue(),ids,fieldProperties);
    translatedPerClass.put(e.getKey(),translatedForKey);
    propertiesPerClass.put(e.getKey(),fieldProperties);
  }
  it=beans.iterator();
  for (int i=0; it.hasNext(); ++i) {
    T bean=it.next();
    for (    Map.Entry<String,List<List<String>>> e : translatedPerClass.entrySet()) {
      if (e.getValue().size() == 0) {
        continue;
      }
      List<String> translatedRow=e.getValue().get(i);
      List<JpaEntityProperty<? super T,String>> fieldProperties=propertiesPerClass.get(e.getKey());
      for (int j=0; j < fieldProperties.size(); ++j) {
        System.err.print("String_Node_Str" + fieldProperties.get(j).getName() + "String_Node_Str"+ translatedRow.get(j));
        fieldProperties.get(j).setValue(bean,translatedRow.get(j));
      }
    }
    if (deep) {
      for (      JpaEntityProperty p : JpaHelper.getAllJpaProperties(entityClass)) {
        Class propertyClass=p.getPropertyClass();
        if (!propertyClass.isPrimitive()) {
          Object v=p.getValue(bean);
          Object tv=translateBean(v,languageCode,deep);
          p.setValue(bean,tv);
        }
      }
    }
  }
  return beans;
}

Fixed version (ground truth):
/** 
 * note, that beans must be detached.
 */
public <T>Collection<T> translateBeans(Collection<T> beans,String languageCode,boolean deep){
  System.err.println("String_Node_Str");
  Iterator<T> it=beans.iterator();
  if (!it.hasNext()) {
    return beans;
  }
  String lc=languageCode.toUpperCase();
  Class<T> entityClass;
{
    T bean=it.next();
    entityClass=JpaHelper.findSameOrSuperJpaEntity(bean.getClass());
    if (entityClass == null) {
      return beans;
    }
  }
  EntityCacheEntry<T> metaDataEntry=getOrCreateEntityCacheEntry(entityClass.getName());
  if (metaDataEntry == null) {
    throw new IllegalArgumentException("String_Node_Str" + entityClass + "String_Node_Str");
  }
  Map<String,BundleInfo> bis=new TreeMap<String,BundleInfo>();
  for (  JpaEntityProperty<T,String> p : metaDataEntry.stringPropertiesByName.values()) {
    String poName=p.getEntityClass().getName();
    EntityCacheEntry poEntry=getOrCreateEntityCacheEntry(poName);
    if (!bis.containsKey(poName)) {
      if (poEntry.tt != null) {
        BundleInfo bi=poEntry.tt.getBundle();
        boolean supportedLanguageFound=false;
        for (        LanguageInfo li : bi.getSupportedLanguages()) {
          if (li.getCode().equalsIgnoreCase(languageCode)) {
            supportedLanguageFound=true;
            break;
          }
        }
        if (!supportedLanguageFound) {
          throw new IllegalArgumentException("String_Node_Str" + languageCode + "String_Node_Str");
        }
        bis.put(poName,bi);
      }
    }
  }
  List<Object> ids=new ArrayList<Object>();
  for (  T bean : beans) {
    ids.add(metaDataEntry.idProperty.getValue(bean));
  }
  Map<String,List<List<String>>> translatedPerClass=new TreeMap<String,List<List<String>>>();
  Map<String,List<JpaEntityProperty<? super T,String>>> propertiesPerClass=new TreeMap<String,List<JpaEntityProperty<? super T,String>>>();
  for (  Map.Entry<String,EntityCacheEntry<? super T>> e : metaDataEntry.slicedEntries.entrySet()) {
    TranslationTable tt=e.getValue().tt;
    if (tt == null)     continue;
    List<JpaEntityProperty<? super T,String>> fieldProperties=new ArrayList<JpaEntityProperty<? super T,String>>();
    for (    TranslationTableColumn tc : tt.getTranslatedColumns()) {
      JpaEntityProperty<? super T,String> fieldProperty=e.getValue().stringPropertiesByNormalizedColumnName.get(tc.getColumnName());
      if (fieldProperty == null) {
        throw new IllegalStateException("String_Node_Str" + tc.getColumnName());
      }
      fieldProperties.add(fieldProperty);
    }
    List<List<String>> translatedForKey=translateFieldsByIds(languageCode,e.getValue(),ids,fieldProperties);
    translatedPerClass.put(e.getKey(),translatedForKey);
    propertiesPerClass.put(e.getKey(),fieldProperties);
  }
  System.err.println("String_Node_Str" + languageCode);
  it=beans.iterator();
  for (int i=0; it.hasNext(); ++i) {
    T bean=it.next();
    for (    Map.Entry<String,List<List<String>>> e : translatedPerClass.entrySet()) {
      if (e.getValue().size() == 0) {
        continue;
      }
      List<String> translatedRow=e.getValue().get(i);
      List<JpaEntityProperty<? super T,String>> fieldProperties=propertiesPerClass.get(e.getKey());
      for (int j=0; j < fieldProperties.size(); ++j) {
        System.err.println("String_Node_Str" + fieldProperties.get(j).getName() + "String_Node_Str"+ translatedRow.get(j));
        fieldProperties.get(j).setValue(bean,translatedRow.get(j));
      }
    }
    if (deep) {
      System.err.println("String_Node_Str");
      for (      JpaEntityProperty p : JpaHelper.getAllJpaProperties(entityClass)) {
        Class propertyClass=p.getPropertyClass();
        if (!propertyClass.isPrimitive()) {
          Object v=p.getValue(bean);
          Object tv=translateBean(v,languageCode,deep);
          p.setValue(bean,tv);
        }
      }
      System.err.println("String_Node_Str");
    }
  }
  System.err.println("String_Node_Str");
  return beans;
}