nus-yam/ex-repair huggingface dataset:
Program: 176386
Project: 176386
Buggy source:
@Test public void test(){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(Employe.class);
  Assert.assertNotNull(entityMetadata);
  Assert.assertNotNull(entityMetadata.getIndexProperties());
  Assert.assertFalse(entityMetadata.getIndexProperties().isEmpty());
  Assert.assertEquals(2,entityMetadata.getIndexProperties().size());
  Assert.assertNotNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Assert.assertNotNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Assert.assertNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Map<String,PropertyIndex> indexes=IndexProcessor.getIndexesOnEmbeddable(Department.class);
  Assert.assertNotNull(indexes);
  Assert.assertFalse(indexes.isEmpty());
  Assert.assertEquals(2,indexes.size());
  Assert.assertNotNull(indexes.get("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",indexes.get("String_Node_Str").getIndexType());
  Assert.assertEquals(new Integer(Integer.MAX_VALUE),indexes.get("String_Node_Str").getMax());
  Assert.assertEquals(new Integer(Integer.MIN_VALUE),indexes.get("String_Node_Str").getMin());
  Assert.assertNotNull(indexes.get("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",indexes.get("String_Node_Str").getIndexType());
  Assert.assertEquals(new Integer(200),indexes.get("String_Node_Str").getMax());
  Assert.assertEquals(new Integer(-200),indexes.get("String_Node_Str").getMin());
}

Fixed version (ground truth):
@Test public void test(){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(Employe.class);
  Assert.assertNotNull(entityMetadata);
  Assert.assertNotNull(entityMetadata.getIndexProperties());
  Assert.assertFalse(entityMetadata.getIndexProperties().isEmpty());
  Assert.assertEquals(2,entityMetadata.getIndexProperties().size());
  Assert.assertNotNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Assert.assertNotNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Assert.assertNull(entityMetadata.getIndexProperties().get("String_Node_Str"));
  Assert.assertNotNull(entityMetadata.toString());
  Map<String,PropertyIndex> indexes=IndexProcessor.getIndexesOnEmbeddable(Department.class);
  Assert.assertNotNull(indexes);
  Assert.assertFalse(indexes.isEmpty());
  Assert.assertEquals(2,indexes.size());
  Assert.assertNotNull(indexes.get("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",indexes.get("String_Node_Str").getIndexType());
  Assert.assertEquals(new Integer(Integer.MAX_VALUE),indexes.get("String_Node_Str").getMax());
  Assert.assertEquals(new Integer(Integer.MIN_VALUE),indexes.get("String_Node_Str").getMin());
  Assert.assertNotNull(indexes.get("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",indexes.get("String_Node_Str").getIndexType());
  Assert.assertEquals(new Integer(200),indexes.get("String_Node_Str").getMax());
  Assert.assertEquals(new Integer(-200),indexes.get("String_Node_Str").getMin());
}
Program: 176389
Project: 176389
Buggy source:
@Test public void testEmbeddable(){
  LuceneIndexer indexer=LuceneIndexer.getInstance(new StandardAnalyzer(Version.LUCENE_34),LUCENE_DIR_PATH);
  IndexManager ixManager=new IndexManager(indexer);
  EntityMetadata metadata=KunderaMetadataManager.getEntityMetadata(SingularEntityEmbeddable.class);
  SingularEntityEmbeddable entity=new SingularEntityEmbeddable();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setField("String_Node_Str");
  EmbeddableEntity embed1=new EmbeddableEntity();
  embed1.setField("String_Node_Str");
  EmbeddableEntityTwo embed2=new EmbeddableEntityTwo();
  embed1.setField("String_Node_Str");
  entity.setEmbeddableEntity(embed1);
  entity.setEmbeddableEntityTwo(embed2);
  em.persist(entity);
  String luceneQuery="String_Node_Str";
  Map<String,Object> results=ixManager.search(luceneQuery,0,10,false);
  Assert.assertFalse(results.isEmpty());
}

Fixed version (ground truth):
@Test public void testEmbeddable(){
  LuceneIndexer indexer=LuceneIndexer.getInstance(new StandardAnalyzer(Version.LUCENE_34),LUCENE_DIR_PATH);
  IndexManager ixManager=new IndexManager(indexer);
  EntityMetadata metadata=KunderaMetadataManager.getEntityMetadata(SingularEntityEmbeddable.class);
  SingularEntityEmbeddable entity=new SingularEntityEmbeddable();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setField("String_Node_Str");
  EmbeddableEntity embed1=new EmbeddableEntity();
  embed1.setField("String_Node_Str");
  EmbeddableEntityTwo embed2=new EmbeddableEntityTwo();
  embed2.setField(1f);
  embed2.setName("String_Node_Str");
  entity.setEmbeddableEntity(embed1);
  entity.setEmbeddableEntityTwo(embed2);
  em.persist(entity);
  String luceneQuery="String_Node_Str";
  Map<String,Object> results=ixManager.search(luceneQuery,0,10,false);
  Assert.assertFalse(results.isEmpty());
}
Program: 176390
Project: 176390
Buggy source:
@Test public void test(){
  CoreTestClientFactory clientFactory=new CoreTestClientFactory();
  clientFactory.load(PU,null);
  clientFactory.setExternalProperties(new HashMap<String,Object>());
  Assert.assertEquals(PU,clientFactory.getPersistenceUnit());
  Assert.assertNotNull(clientFactory.getClientInstance());
  Assert.assertNotNull(clientFactory.getSchemaManager(null));
  Assert.assertNull(clientFactory.getConnectionPoolOrConnection());
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  try {
    clientFactory.onValidation(null,null);
    Assert.fail("String_Node_Str");
  }
 catch (  IllegalArgumentException iaex) {
    Assert.assertNotNull(iaex.getMessage());
  }
  clientFactory.destroy();
}

Fixed version (ground truth):
@Test public void test(){
  PersistenceUnitMetadata puMetadata=new PersistenceUnitMetadata();
  Map<String,PersistenceUnitMetadata> puMetadataMap=new HashMap<String,PersistenceUnitMetadata>();
  puMetadataMap.put(PU,puMetadata);
  KunderaMetadata.INSTANCE.getApplicationMetadata().addPersistenceUnitMetadata(puMetadataMap);
  CoreTestClientFactory clientFactory=new CoreTestClientFactory();
  clientFactory.load(PU,null);
  clientFactory.setExternalProperties(new HashMap<String,Object>());
  Assert.assertEquals(PU,clientFactory.getPersistenceUnit());
  Assert.assertNotNull(clientFactory.getClientInstance());
  Assert.assertNotNull(clientFactory.getSchemaManager(null));
  Assert.assertNull(clientFactory.getConnectionPoolOrConnection());
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  Assert.assertNotNull(clientFactory.getLoadBalancePolicy("String_Node_Str"));
  try {
    clientFactory.onValidation(null,null);
    Assert.fail("String_Node_Str");
  }
 catch (  IllegalArgumentException iaex) {
    Assert.assertNotNull(iaex.getMessage());
  }
  clientFactory.destroy();
}
Program: 176391
Project: 176391
Buggy source:
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  emf=Persistence.createEntityManagerFactory(PU);
  emf.createEntityManager();
}

Fixed version (ground truth):
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
}
Program: 176393
Project: 176393
Buggy source:
/** 
 * Reads property file which is given in persistence unit
 * @param pu
 */
final public void read(String pu){
  String propertyFileName=externalProperties != null ? (String)externalProperties.get(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
  puMetadata=KunderaMetadataManager.getPersistenceUnitMetadata(pu);
  if (propertyFileName == null) {
    propertyFileName=puMetadata != null ? puMetadata.getProperty(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
  }
  if (propertyFileName != null && PropertyType.value(propertyFileName).equals(PropertyType.xml)) {
    onXml(onParseXML(propertyFileName,puMetadata));
  }
}

Fixed version (ground truth):
/** 
 * Reads property file which is given in persistence unit
 * @param pu
 */
public void read(String pu){
  String propertyFileName=externalProperties != null ? (String)externalProperties.get(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
  puMetadata=KunderaMetadataManager.getPersistenceUnitMetadata(pu);
  if (propertyFileName == null) {
    propertyFileName=puMetadata != null ? puMetadata.getProperty(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
  }
  if (propertyFileName != null && PropertyType.value(propertyFileName) != null && PropertyType.value(propertyFileName).equals(PropertyType.xml)) {
    onXml(onParseXML(propertyFileName,puMetadata));
  }
}
Program: 176394
Project: 176394
Buggy source:
/** 
 * Check for allowed property format.
 * @param propertyFileName
 * @return
 */
static PropertyType value(String propertyFileName){
  if (isXml(propertyFileName)) {
    return xml;
  }
  throw new IllegalArgumentException("String_Node_Str" + propertyFileName);
}

Fixed version (ground truth):
/** 
 * Check for allowed property format.
 * @param propertyFileName
 * @return
 */
public static PropertyType value(String propertyFileName){
  PropertyType type=null;
  if (isValid(propertyFileName,PropertyType.xml)) {
    type=xml;
  }
 else   if (isValid(propertyFileName,PropertyType.properties)) {
    if (log.isWarnEnabled()) {
      log.warn("String_Node_Str");
    }
    type=properties;
  }
 else {
    log.warn("String_Node_Str",propertyFileName);
  }
  return type;
}
Program: 176395
Project: 176395
Buggy source:
/** 
 * Returns collection of column values for given join table. TODO: Method is very much tightly coupled with Join table implementation and does not serve purpose as it is meant for.
 */
@Override public <E>List<E> getColumnsById(String schemaName,String tableName,String pKeyColumnName,String columnName,Object pKeyColumnValue,Class columnJavaType){
  Object connection=null;
  List results=new ArrayList();
  try {
    connection=getConnection();
    String valueAsStr=PropertyAccessorHelper.getString(pKeyColumnValue);
    Double score=getDouble(valueAsStr);
    Set<String> resultKeys=null;
    if (resource != null && resource.isActive()) {
      Response response=((Transaction)connection).zrangeByScore(getHashKey(tableName,valueAsStr),score,score);
      ((Transaction)connection).exec();
      resultKeys=(Set<String>)response.get();
    }
 else {
      resultKeys=((Jedis)connection).zrangeByScore(getHashKey(tableName,valueAsStr),score,score);
    }
    for (    String hashKey : resultKeys) {
      List columnValues=null;
      if (resource != null && resource.isActive()) {
        Response response=((Transaction)connection).hmget(hashKey,columnName);
        ((Transaction)connection).exec();
        columnValues=(List)response.get();
      }
 else {
        columnValues=((Jedis)connection).hmget(hashKey,columnName);
      }
      if (columnValues != null && !columnValues.isEmpty()) {
        results.addAll(columnValues);
      }
    }
    return results;
  }
  finally {
    onCleanup(connection);
  }
}

Fixed version (ground truth):
/** 
 * Returns collection of column values for given join table. TODO: Method is very much tightly coupled with Join table implementation and does not serve purpose as it is meant for.
 */
@Override public <E>List<E> getColumnsById(String schemaName,String tableName,String pKeyColumnName,String columnName,Object pKeyColumnValue,Class columnJavaType){
  Object connection=null;
  List results=new ArrayList();
  try {
    connection=getConnection();
    String valueAsStr=PropertyAccessorHelper.getString(pKeyColumnValue);
    Double score=getDouble(valueAsStr);
    Set<String> resultKeys=null;
    if (resource != null && resource.isActive()) {
      Response response=((Transaction)connection).zrangeByScore(getHashKey(tableName,valueAsStr),score,score);
      ((Transaction)connection).exec();
      resultKeys=(Set<String>)response.get();
    }
 else {
      resultKeys=((Jedis)connection).zrangeByScore(getHashKey(tableName,valueAsStr),score,score);
    }
    results=fetchColumn(columnName,connection,results,resultKeys);
    return results;
  }
  finally {
    onCleanup(connection);
  }
}
Program: 176396
Project: 176396
Buggy source:
public Object[] findIdsByColumn(String tableName,String columnName,Object columnValue){
  Object connection=null;
  try {
    connection=getConnection();
    String valueAsStr=PropertyAccessorHelper.getString(columnValue);
    Set<String> results=null;
    if (resource != null && resource.isActive()) {
      Response response=((Transaction)connection).zrangeByScore(getHashKey(tableName,columnName),getDouble(valueAsStr),getDouble(valueAsStr));
      ((Transaction)connection).exec();
      results=(Set<String>)response.get();
    }
 else {
      results=((Jedis)connection).zrangeByScore(getHashKey(tableName,columnName),getDouble(valueAsStr),getDouble(valueAsStr));
    }
    if (results != null) {
      return results.toArray(new Object[0]);
    }
  }
  finally {
    onCleanup(connection);
  }
  return null;
}

Fixed version (ground truth):
private Object[] findIdsByColumn(String tableName,String columnName,Object columnValue){
  Object connection=null;
  try {
    connection=getConnection();
    String valueAsStr=PropertyAccessorHelper.getString(columnValue);
    Set<String> results=null;
    if (resource != null && resource.isActive()) {
      Response response=((Transaction)connection).zrangeByScore(getHashKey(tableName,columnName),getDouble(valueAsStr),getDouble(valueAsStr));
      ((Transaction)connection).exec();
      results=(Set<String>)response.get();
    }
 else {
      results=((Jedis)connection).zrangeByScore(getHashKey(tableName,columnName),getDouble(valueAsStr),getDouble(valueAsStr));
    }
    if (results != null) {
      return results.toArray(new Object[0]);
    }
  }
  finally {
    onCleanup(connection);
  }
  return null;
}
Program: 176399
Project: 176399
Buggy source:
@Override public void clearProxies(){
  if (proxies != null) {
    for (    KunderaProxy proxy : proxies.values()) {
      proxy.getKunderaLazyInitializer().setOwner(null);
      proxy.getKunderaLazyInitializer().setInitialized(false);
    }
    proxies.clear();
  }
}

Fixed version (ground truth):
@Override public void clearProxies(){
  for (  KunderaProxy proxy : proxies.values()) {
    proxy.getKunderaLazyInitializer().setOwner(null);
    proxy.getKunderaLazyInitializer().setInitialized(false);
  }
  proxies.clear();
}
Program: 176400
Project: 176400
Buggy source:
@Override protected void createSchemaForPERSONNEL() throws SQLException {
  try {
    cli.update("String_Node_Str");
  }
 catch (  Exception e) {
    cli.update("String_Node_Str");
    cli.update("String_Node_Str");
    cli.update("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void createSchemaForPERSONNEL() throws SQLException {
}
Program: 176401
Project: 176401
Buggy source:
@Override protected void createSchemaForHABITAT() throws SQLException {
  try {
    cli.update("String_Node_Str");
  }
 catch (  Exception e) {
    cli.update("String_Node_Str");
    cli.update("String_Node_Str");
    cli.update("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void createSchemaForHABITAT() throws SQLException {
}
Program: 176402
Project: 176402
Buggy source:
/** 
 * Gets the last element collection object count.
 * @param rowKey the row key
 * @return the last element collection object count
 */
public int getLastElementCollectionObjectCount(Object rowKey){
  if (getElementCollectionCache().get(rowKey) == null) {
    log.debug("String_Node_Str" + rowKey);
    return -1;
  }
 else {
    Map<Object,String> elementCollectionMap=getElementCollectionCache().get(rowKey);
    Collection<String> elementCollectionObjectNames=elementCollectionMap.values();
    int max=0;
    for (    String s : elementCollectionObjectNames) {
      String elementCollectionCountStr=s.substring(s.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) + 1);
      int elementCollectionCount=0;
      try {
        elementCollectionCount=Integer.parseInt(elementCollectionCountStr);
      }
 catch (      NumberFormatException e) {
        log.error("String_Node_Str" + s);
        throw new PersistenceException("String_Node_Str" + s);
      }
      if (elementCollectionCount > max) {
        max=elementCollectionCount;
      }
    }
    return max;
  }
}

Fixed version (ground truth):
/** 
 * Gets the last element collection object count.
 * @param rowKey the row key
 * @return the last element collection object count
 */
public int getLastElementCollectionObjectCount(Object rowKey){
  if (getElementCollectionCache().get(rowKey) == null) {
    log.debug("String_Node_Str" + rowKey);
    return -1;
  }
 else {
    Map<Object,String> elementCollectionMap=getElementCollectionCache().get(rowKey);
    Collection<String> elementCollectionObjectNames=elementCollectionMap.values();
    int max=0;
    for (    String s : elementCollectionObjectNames) {
      String elementCollectionCountStr=s.substring(s.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) + 1);
      int elementCollectionCount=0;
      try {
        elementCollectionCount=Integer.parseInt(elementCollectionCountStr);
      }
 catch (      NumberFormatException e) {
        log.error("String_Node_Str" + s);
        throw new CacheException("String_Node_Str" + s,e);
      }
      if (elementCollectionCount > max) {
        max=elementCollectionCount;
      }
    }
    return max;
  }
}
Program: 176403
Project: 176403
Buggy source:
private static void getEmbeddableType(EntityMetadata m,Map<String,Field> columnNameToFieldMap,Map<String,Field> superColumnNameToFieldMap){
  Metamodel metaModel=KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set attributes=entityType.getAttributes();
  Iterator<Attribute> iter=attributes.iterator();
  while (iter.hasNext()) {
    Attribute attribute=iter.next();
    if (((MetamodelImpl)metaModel).isEmbeddable(((AbstractAttribute)attribute).getBindableJavaType())) {
      superColumnNameToFieldMap.put(((AbstractAttribute)attribute).getJPAColumnName(),(Field)attribute.getJavaMember());
      if (columnNameToFieldMap != null) {
        getAttributeOfEmbedddable(columnNameToFieldMap,metaModel,attribute);
      }
    }
 else {
      columnNameToFieldMap.put(((AbstractAttribute)attribute).getJPAColumnName(),(Field)attribute.getJavaMember());
    }
  }
}

Fixed version (ground truth):
private static void getEmbeddableType(EntityMetadata m,Map<String,Field> columnNameToFieldMap,Map<String,Field> superColumnNameToFieldMap){
  Metamodel metaModel=KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set attributes=entityType.getAttributes();
  Iterator<Attribute> iter=attributes.iterator();
  while (iter.hasNext()) {
    Attribute attribute=iter.next();
    if (((MetamodelImpl)metaModel).isEmbeddable(((AbstractAttribute)attribute).getBindableJavaType())) {
      superColumnNameToFieldMap.put(((AbstractAttribute)attribute).getJPAColumnName(),(Field)attribute.getJavaMember());
      if (columnNameToFieldMap != null) {
        getAttributeOfEmbedddable(columnNameToFieldMap,metaModel,attribute);
      }
    }
 else {
      if (columnNameToFieldMap != null) {
        columnNameToFieldMap.put(((AbstractAttribute)attribute).getJPAColumnName(),(Field)attribute.getJavaMember());
      }
    }
  }
}
Program: 176404
Project: 176404
Buggy source:
/** 
 * Retrun map of external properties for given pu;
 * @param pu
 * @param externalProperties
 * @param persistenceUnits
 * @return
 */
public static Map<String,Object> getExternalProperties(String pu,Map<String,Object> externalProperties,String... persistenceUnits){
  Map<String,Object> puProperty;
  if (persistenceUnits.length > 1 && externalProperties != null) {
    puProperty=(Map<String,Object>)externalProperties.get(pu);
    if (puProperty != null) {
      return fetchPropertyMap(puProperty);
    }
    return null;
  }
  return externalProperties;
}

Fixed version (ground truth):
/** 
 * Retrun map of external properties for given pu;
 * @param pu
 * @param externalProperties
 * @param persistenceUnits
 * @return
 */
public static Map<String,Object> getExternalProperties(String pu,Map<String,Object> externalProperties,String... persistenceUnits){
  Map<String,Object> puProperty;
  if (persistenceUnits != null && persistenceUnits.length > 1 && externalProperties != null) {
    puProperty=(Map<String,Object>)externalProperties.get(pu);
    if (puProperty != null) {
      return fetchPropertyMap(puProperty);
    }
    return null;
  }
  return externalProperties;
}
Program: 176405
Project: 176405
Buggy source:
/** 
 * Checks for super "has" in class "in".
 * @param has the has
 * @param in the in
 * @return true, if exists?
 */
public static boolean hasSuperClass(Class<?> has,Class<?> in){
  if (in.equals(has)) {
    return true;
  }
  boolean match=false;
  if (in.getSuperclass().equals(Object.class)) {
    return match;
  }
  match=hasSuperClass(has,in.getSuperclass());
  return match;
}

Fixed version (ground truth):
/** 
 * Checks for super "has" in class "in".
 * @param has the has
 * @param in the in
 * @return true, if exists?
 */
public static boolean hasSuperClass(Class<?> has,Class<?> in){
  if (in.equals(has)) {
    return true;
  }
  boolean match=false;
  if (in.getSuperclass() != null && in.getSuperclass().equals(Object.class)) {
    return match;
  }
  match=in.getSuperclass() != null ? hasSuperClass(has,in.getSuperclass()) : false;
  return match;
}
Program: 176406
Project: 176406
Buggy source:
/** 
 * Adds typed parameter to   {@link TypedParameter}
 * @param type type of parameter(e.g. NAMED/INDEXED)
 * @param parameter parameter name.
 * @param clause filter clause.
 */
private void addTypedParameter(Type type,String parameter,UpdateClause clause){
  if (typedParameter == null) {
    typedParameter=new TypedParameter(type);
  }
  if (typedParameter.getType().equals(type)) {
    typedParameter.addParameters(parameter,clause);
  }
 else {
    logger.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Adds typed parameter to   {@link TypedParameter}
 * @param type type of parameter(e.g. NAMED/INDEXED)
 * @param parameter parameter name.
 * @param clause filter clause.
 */
private void addTypedParameter(Type type,String parameter,UpdateClause clause){
  if (type != null) {
    if (typedParameter == null) {
      typedParameter=new TypedParameter(type);
    }
    if (typedParameter.getType().equals(type)) {
      typedParameter.addParameters(parameter,clause);
    }
 else {
      logger.warn("String_Node_Str");
    }
  }
}
Program: 176407
Project: 176407
Buggy source:
public void addUpdateClause(final String property,final String value){
  UpdateClause updateClause=new UpdateClause(property.trim(),value.trim());
  updateClauseQueue.add(updateClause);
  addTypedParameter(value.trim().startsWith("String_Node_Str") ? Type.INDEXED : Type.NAMED,property,updateClause);
}

Fixed version (ground truth):
public void addUpdateClause(final String property,final String value){
  UpdateClause updateClause=new UpdateClause(property.trim(),value.trim());
  updateClauseQueue.add(updateClause);
  addTypedParameter(value.trim().startsWith("String_Node_Str") ? Type.INDEXED : value.trim().startsWith("String_Node_Str") ? Type.NAMED : null,property,updateClause);
}
Program: 176408
Project: 176408
Buggy source:
@Override public List<?> getResultList(){
  if (log.isDebugEnabled())   log.info("String_Node_Str" + query);
  List results=new ArrayList();
  EntityMetadata m=getEntityMetadata();
  Client client=persistenceDelegeator.getClient(m);
  if (!m.isRelationViaJoinTable() && (m.getRelationNames() == null || (m.getRelationNames().isEmpty()))) {
    results=populateEntities(m,client);
  }
 else {
    results=recursivelyPopulateEntities(m,client);
  }
  if (kunderaQuery.isDeleteUpdate()) {
    onDeleteOrUpdate(results);
  }
  return results != null ? results : new ArrayList();
}

Fixed version (ground truth):
@Override public List<?> getResultList(){
  if (log.isDebugEnabled())   log.info("String_Node_Str" + query);
  List results=new ArrayList();
  EntityMetadata m=getEntityMetadata();
  Client client=persistenceDelegeator.getClient(m);
  if (!m.isRelationViaJoinTable() && (m.getRelationNames() == null || (m.getRelationNames().isEmpty()))) {
    results=populateEntities(m,client);
  }
 else {
    results=recursivelyPopulateEntities(m,client);
  }
  if (kunderaQuery.isDeleteUpdate()) {
    onDeleteOrUpdate(results);
  }
  if (results != null) {
    for (    Object obj : results) {
      KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().setProxyOwners(m,obj);
    }
  }
  return results != null ? results : new ArrayList();
}
Program: 176409
Project: 176409
Buggy source:
/** 
 * On id attribute.
 * @param builder the builder
 * @param entityMetadata the entity metadata
 * @param clazz the clazz
 * @param f the f
 */
private void onIdAttribute(final MetaModelBuilder builder,EntityMetadata entityMetadata,final Class clazz,Field f){
  EntityType entity=(EntityType)builder.getManagedTypes().get(clazz);
  Attribute attrib=entity.getAttribute(f.getName());
  if (!attrib.isCollection() && ((SingularAttribute)attrib).isId()) {
    entityMetadata.setIdAttribute((SingularAttribute)attrib);
  }
}

Fixed version (ground truth):
/** 
 * On id attribute.
 * @param builder the builder
 * @param entityMetadata the entity metadata
 * @param clazz the clazz
 * @param f the f
 */
private void onIdAttribute(final MetaModelBuilder builder,EntityMetadata entityMetadata,final Class clazz,Field f){
  EntityType entity=(EntityType)builder.getManagedTypes().get(clazz);
  Attribute attrib=entity.getAttribute(f.getName());
  if (!attrib.isCollection() && ((SingularAttribute)attrib).isId()) {
    entityMetadata.setIdAttribute((SingularAttribute)attrib);
    populateIdAccessorMethods(entityMetadata,clazz,f);
  }
}
Program: 176410
Project: 176410
Buggy source:
protected boolean add(final Object object){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection == null) {
    Class<?> collectionClass=getRelation().getProperty().getType();
    if (collectionClass.isAssignableFrom(Set.class)) {
      dataCollection=new HashSet();
    }
 else     if (collectionClass.isAssignableFrom(List.class)) {
      dataCollection=new ArrayList();
    }
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && !dataCollection.contains(object) && object != null) {
    dataCollection.add(object);
    PropertyAccessorHelper.set(getOwner(),getRelation().getProperty(),dataCollection);
    result=true;
  }
  return result;
}

Fixed version (ground truth):
protected boolean add(final Object object){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection == null) {
    createEmptyDataCollection();
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && !dataCollection.contains(object) && object != null) {
    dataCollection.add(object);
    PropertyAccessorHelper.set(getOwner(),getRelation().getProperty(),dataCollection);
    result=true;
  }
  return result;
}
Program: 176411
Project: 176411
Buggy source:
protected boolean removeAll(final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    for (    Object o : collection) {
      if (o != null) {
        getPersistenceDelegator().remove(o);
      }
    }
    dataCollection.removeAll(collection);
    result=true;
  }
  return result;
}

Fixed version (ground truth):
protected boolean removeAll(final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection == null) {
    createEmptyDataCollection();
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    dataCollection.removeAll(collection);
    result=true;
  }
  return result;
}
Program: 176412
Project: 176412
Buggy source:
protected boolean addAll(final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    for (    Object o : collection) {
      if (!dataCollection.contains(o) && o != null) {
        getPersistenceDelegator().persist(o);
        dataCollection.add(o);
      }
    }
    result=true;
  }
  return result;
}

Fixed version (ground truth):
protected boolean addAll(final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection == null) {
    createEmptyDataCollection();
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    dataCollection.addAll(collection);
    result=true;
  }
  return result;
}
Program: 176413
Project: 176413
Buggy source:
protected boolean remove(final Object object){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && object != null) {
    getPersistenceDelegator().remove(object);
    if (dataCollection.contains(object)) {
      dataCollection.remove(object);
    }
    result=true;
  }
  return result;
}

Fixed version (ground truth):
protected boolean remove(final Object object){
  eagerlyLoadDataCollection();
  boolean result=false;
  if (dataCollection == null) {
    createEmptyDataCollection();
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && object != null) {
    dataCollection.remove(object);
    result=true;
  }
  return result;
}
Program: 176414
Project: 176414
Buggy source:
protected boolean retainAll(final Collection collection){
  boolean result=false;
  eagerlyLoadDataCollection();
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    result=dataCollection.retainAll(collection);
  }
  return result;
}

Fixed version (ground truth):
protected boolean retainAll(final Collection collection){
  boolean result=false;
  eagerlyLoadDataCollection();
  if (dataCollection == null) {
    createEmptyDataCollection();
  }
  if (dataCollection != null && !(dataCollection instanceof ProxyCollection) && collection != null && !collection.isEmpty()) {
    result=dataCollection.retainAll(collection);
  }
  return result;
}
Program: 176415
Project: 176415
Buggy source:
@Override public void add(final int arg0,final Object arg1){
  eagerlyLoadDataCollection();
  List dataList=(List)dataCollection;
  if (dataList != null && !dataList.contains(arg1) && arg1 != null) {
    getPersistenceDelegator().persist(arg1);
    dataList.add(arg0,arg1);
  }
}

Fixed version (ground truth):
@Override public void add(final int arg0,final Object arg1){
  eagerlyLoadDataCollection();
  List dataList=(List)dataCollection;
  if (dataList == null) {
    dataList=new ArrayList();
  }
  if (arg1 != null && !dataList.contains(arg1)) {
    dataList.add(arg0,arg1);
  }
}
Program: 176416
Project: 176416
Buggy source:
@Override public Object remove(final int arg0){
  eagerlyLoadDataCollection();
  Object result=null;
  List dataList=(List)dataCollection;
  if (dataList != null && !dataList.isEmpty() && dataList.contains(arg0)) {
    getPersistenceDelegator().remove(arg0);
    result=dataList.remove(arg0);
  }
  return result;
}

Fixed version (ground truth):
@Override public Object remove(final int arg0){
  eagerlyLoadDataCollection();
  Object result=null;
  List dataList=(List)dataCollection;
  if (dataList != null && !dataList.isEmpty() && dataList.contains(arg0)) {
    result=dataList.remove(arg0);
  }
  return result;
}
Program: 176417
Project: 176417
Buggy source:
@Override public boolean addAll(final int index,final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  List dataList=(List)dataCollection;
  if (dataList != null && collection != null && !collection.isEmpty()) {
    int position=0;
    for (    Object o : collection) {
      if (!dataList.contains(o) && o != null) {
        getPersistenceDelegator().persist(o);
        dataList.add(index + position++,o);
      }
    }
    result=true;
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean addAll(final int index,final Collection collection){
  eagerlyLoadDataCollection();
  boolean result=false;
  List dataList=(List)dataCollection;
  if (dataList == null) {
    dataList=new ArrayList();
  }
  if (collection != null && !collection.isEmpty()) {
    int position=0;
    for (    Object o : collection) {
      if (o != null && !dataList.contains(o)) {
        dataList.add(index + position++,o);
      }
    }
    result=true;
  }
  return result;
}
Program: 176418
Project: 176418
Buggy source:
/** 
 * Handles find by range query for given start and end row key range values.
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata
 * @param startRow start row.
 * @param endRow end row.
 * @return collection holding results.
 */
public <E>List<E> findByRange(Class<E> entityClass,EntityMetadata metadata,byte[] startRow,byte[] endRow,String[] columns){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  String tableName=entityMetadata.getTableName();
  List results=new ArrayList();
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    addFilter(tableName,new KeyOnlyFilter());
  }
  try {
    results=handler.readDataByRange(tableName,entityClass,metadata,startRow,endRow,columns);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Handles find by range query for given start and end row key range values.
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata
 * @param startRow start row.
 * @param endRow end row.
 * @return collection holding results.
 */
public <E>List<E> findByRange(Class<E> entityClass,EntityMetadata metadata,byte[] startRow,byte[] endRow,String[] columns,Filter f){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  String tableName=entityMetadata.getTableName();
  List results=new ArrayList();
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readDataByRange(tableName,entityClass,metadata,startRow,endRow,columns,filter);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}
Program: 176419
Project: 176419
Buggy source:
@Override public <E>List<E> find(Class<E> entityClass,Map<String,String> col){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(getPersistenceUnit(),entityClass);
  List<E> entities=new ArrayList<E>();
  Map<String,Field> columnFamilyNameToFieldMap=MetadataUtils.createSuperColumnsFieldMap(entityMetadata);
  for (  String columnFamilyName : col.keySet()) {
    String entityId=col.get(columnFamilyName);
    if (entityId != null) {
      E e=null;
      try {
        List results=handler.readData(entityMetadata.getTableName(),entityMetadata.getEntityClazz(),entityMetadata,entityId,null);
        if (results != null) {
          e=(E)results.get(0);
        }
      }
 catch (      IOException ioex) {
        log.error("String_Node_Str",ioex);
        throw new KunderaException(ioex);
      }
      Field columnFamilyField=columnFamilyNameToFieldMap.get(columnFamilyName.substring(0,columnFamilyName.indexOf("String_Node_Str")));
      Object columnFamilyValue=PropertyAccessorHelper.getObject(e,columnFamilyField);
      if (Collection.class.isAssignableFrom(columnFamilyField.getType())) {
        entities.addAll((Collection)columnFamilyValue);
      }
 else {
        entities.add((E)columnFamilyValue);
      }
    }
  }
  return entities;
}

Fixed version (ground truth):
@Override public <E>List<E> find(Class<E> entityClass,Map<String,String> col){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(getPersistenceUnit(),entityClass);
  List<E> entities=new ArrayList<E>();
  Map<String,Field> columnFamilyNameToFieldMap=MetadataUtils.createSuperColumnsFieldMap(entityMetadata);
  for (  String columnFamilyName : col.keySet()) {
    String entityId=col.get(columnFamilyName);
    if (entityId != null) {
      E e=null;
      try {
        List results=handler.readData(entityMetadata.getTableName(),entityMetadata.getEntityClazz(),entityMetadata,entityId,null,null);
        if (results != null) {
          e=(E)results.get(0);
        }
      }
 catch (      IOException ioex) {
        log.error("String_Node_Str",ioex);
        throw new KunderaException(ioex);
      }
      Field columnFamilyField=columnFamilyNameToFieldMap.get(columnFamilyName.substring(0,columnFamilyName.indexOf("String_Node_Str")));
      Object columnFamilyValue=PropertyAccessorHelper.getObject(e,columnFamilyField);
      if (Collection.class.isAssignableFrom(columnFamilyField.getType())) {
        entities.addAll((Collection)columnFamilyValue);
      }
 else {
        entities.add((E)columnFamilyValue);
      }
    }
  }
  return entities;
}
Program: 176420
Project: 176420
Buggy source:
/** 
 * Method to find entities using JPQL(converted into FilterList.)
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata.
 * @return list of entities.
 */
public <E>List<E> findByQuery(Class<E> entityClass,EntityMetadata metadata,String... columns){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  List<String> relationNames=entityMetadata.getRelationNames();
  String tableName=entityMetadata.getTableName();
  List results=null;
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    addFilter(tableName,new KeyOnlyFilter());
  }
  try {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,null,relationNames,columns);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results != null ? results : new ArrayList();
}

Fixed version (ground truth):
/** 
 * Method to find entities using JPQL(converted into FilterList.)
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata.
 * @return list of entities.
 */
public <E>List<E> findByQuery(Class<E> entityClass,EntityMetadata metadata,Filter f,String... columns){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  List<String> relationNames=entityMetadata.getRelationNames();
  String tableName=entityMetadata.getTableName();
  List results=null;
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,null,relationNames,filter,columns);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results != null ? results : new ArrayList();
}
Program: 176421
Project: 176421
Buggy source:
/** 
 * Populates data for give column family, column name, and HBase table name.
 * @param tableName the table name
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param relationNames the relation names
 * @return the object
 * @throws IOException Signals that an I/O exception has occurred.
 */
List readData(String tableName,Class clazz,EntityMetadata m,Object rowKey,List<String> relatationNames,String... columns) throws IOException ;

Fixed version (ground truth):
/** 
 * Populates data for give column family, column name, and HBase table name.
 * @param tableName the table name
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param f 
 * @param relationNames the relation names
 * @return the object
 * @throws IOException Signals that an I/O exception has occurred.
 */
List readData(String tableName,Class clazz,EntityMetadata m,Object rowKey,List<String> relatationNames,FilterList f,String... columns) throws IOException ;
Program: 176422
Project: 176422
Buggy source:
/** 
 * @param tableName
 * @param clazz
 * @param m
 * @param relationNames
 * @param startRow
 * @param endRow
 * @param columns
 * @return
 */
List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns) throws IOException ;

Fixed version (ground truth):
/** 
 * @param tableName
 * @param clazz
 * @param m
 * @param relationNames
 * @param startRow
 * @param endRow
 * @param columns
 * @param f 
 * @return
 */
List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns,FilterList f) throws IOException ;
Program: 176423
Project: 176423
Buggy source:
public Object next(EntityMetadata m){
  Object entity=null;
  HBaseData result=((HBaseReader)hbaseReader).next();
  List<HBaseData> results=new ArrayList<HBaseData>();
  List output=new ArrayList();
  results.add(result);
  try {
    output=onRead(m.getTableName(),m.getEntityClazz(),m,output,gethTable(m.getTableName()),entity,m.getRelationNames(),results);
  }
 catch (  IOException e) {
  }
  return output != null && !output.isEmpty() ? output.get(0) : output;
}

Fixed version (ground truth):
public Object next(EntityMetadata m){
  Object entity=null;
  HBaseData result=((HBaseReader)hbaseReader).next();
  List<HBaseData> results=new ArrayList<HBaseData>();
  List output=new ArrayList();
  results.add(result);
  try {
    output=onRead(m.getTableName(),m.getEntityClazz(),m,output,gethTable(m.getTableName()),entity,m.getRelationNames(),results);
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException(e);
  }
  return output != null && !output.isEmpty() ? output.get(0) : output;
}
Program: 176424
Project: 176424
Buggy source:
@Override public List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns) throws IOException {
  List output=new ArrayList();
  HTableInterface hTable=null;
  Object entity=null;
  List<String> relationNames=m.getRelationNames();
  hTable=gethTable(tableName);
  List<HBaseData> results=hbaseReader.loadAll(hTable,getFilter(tableName),startRow,endRow,m.getTableName(),null,columns);
  output=onRead(tableName,clazz,m,output,hTable,entity,relationNames,results);
  return output;
}

Fixed version (ground truth):
@Override public List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns,FilterList f) throws IOException {
  List output=new ArrayList();
  HTableInterface hTable=null;
  Object entity=null;
  List<String> relationNames=m.getRelationNames();
  if (getFilter(tableName) != null) {
    if (f == null) {
      f=new FilterList();
    }
    f.addFilter(getFilter(tableName));
  }
  hTable=gethTable(tableName);
  List<HBaseData> results=hbaseReader.loadAll(hTable,f,startRow,endRow,m.getTableName(),null,columns);
  output=onRead(tableName,clazz,m,output,hTable,entity,relationNames,results);
  return output;
}
Program: 176425
Project: 176425
Buggy source:
@Override public List readData(final String tableName,Class clazz,EntityMetadata m,final Object rowKey,List<String> relationNames,String... columns) throws IOException {
  List output=null;
  Object entity=null;
  HTableInterface hTable=null;
  hTable=gethTable(tableName);
  List<HBaseData> results=hbaseReader.LoadData(hTable,rowKey,getFilter(tableName),columns);
  output=onRead(tableName,clazz,m,output,hTable,entity,relationNames,results);
  return output;
}

Fixed version (ground truth):
@Override public List readData(final String tableName,Class clazz,EntityMetadata m,final Object rowKey,List<String> relationNames,FilterList f,String... columns) throws IOException {
  List output=null;
  Object entity=null;
  HTableInterface hTable=null;
  hTable=gethTable(tableName);
  if (getFilter(tableName) != null) {
    if (f == null) {
      f=new FilterList();
    }
    f.addFilter(getFilter(tableName));
  }
  List<HBaseData> results=hbaseReader.LoadData(hTable,rowKey,f,columns);
  output=onRead(tableName,clazz,m,output,hTable,entity,relationNames,results);
  return output;
}
Program: 176426
Project: 176426
Buggy source:
/** 
 * Set filter to data handler.
 * @param filter hbase filter.
 */
public void setFilter(Filter filter){
  if (this.filter == null) {
    this.filter=new FilterList();
  }
  this.filter.addFilter(filter);
}

Fixed version (ground truth):
/** 
 * Set filter to data handler.
 * @param filter hbase filter.
 */
public void setFilter(Filter filter){
  if (this.filter == null) {
    this.filter=new FilterList();
  }
  if (filter != null) {
    this.filter.addFilter(filter);
  }
}
Program: 176427
Project: 176427
Buggy source:
public void addFilter(final String columnFamily,Filter filter){
  FilterList filterList=this.filters.get(columnFamily);
  if (filterList == null) {
    filterList=new FilterList();
  }
  filterList.addFilter(filter);
  this.filters.put(columnFamily,filterList);
}

Fixed version (ground truth):
public void addFilter(final String columnFamily,Filter filter){
  FilterList filterList=this.filters.get(columnFamily);
  if (filterList == null) {
    filterList=new FilterList();
  }
  if (filter != null) {
    filterList.addFilter(filter);
  }
  this.filters.put(columnFamily,filterList);
}
Program: 176428
Project: 176428
Buggy source:
public void reset(){
  ((HBaseReader)hbaseReader).reset();
}

Fixed version (ground truth):
public void reset(){
  resetFilter();
  ((HBaseReader)hbaseReader).reset();
}
Program: 176431
Project: 176431
Buggy source:
/** 
 */
protected void eagerlyLoadDataCollection(){
  if (getDataCollection() == null || getDataCollection() instanceof ProxyCollection) {
    EntityMetadata m=KunderaMetadataManager.getEntityMetadata(getOwner().getClass());
    getPersistenceDelegator().getClient(m).getReader().recursivelyFindEntities(getOwner(),relationsMap,m,getPersistenceDelegator(),true);
    dataCollection=(Collection)PropertyAccessorHelper.getObject(getOwner(),getRelation().getProperty());
    if (dataCollection instanceof ProxyCollection) {
      dataCollection=null;
    }
    PropertyAccessorHelper.set(getOwner(),getRelation().getProperty(),dataCollection);
  }
}

Fixed version (ground truth):
/** 
 */
protected void eagerlyLoadDataCollection(){
  if (getDataCollection() == null || getDataCollection() instanceof ProxyCollection) {
    EntityMetadata m=KunderaMetadataManager.getEntityMetadata(getOwner().getClass());
    if (!getPersistenceDelegator().isOpen()) {
      throw new LazyInitializationException("String_Node_Str" + "String_Node_Str");
    }
    getPersistenceDelegator().getClient(m).getReader().recursivelyFindEntities(getOwner(),relationsMap,m,getPersistenceDelegator(),true);
    if (getRelation().getProperty().getType().isAssignableFrom(Map.class)) {
      dataCollection=(Map)PropertyAccessorHelper.getObject(getOwner(),getRelation().getProperty());
    }
 else {
      dataCollection=(Collection)PropertyAccessorHelper.getObject(getOwner(),getRelation().getProperty());
    }
    if (dataCollection instanceof ProxyCollection) {
      dataCollection=null;
    }
    PropertyAccessorHelper.set(getOwner(),getRelation().getProperty(),dataCollection);
  }
}