Program: 59641
Project: 59641
Buggy source:
private void applyOLinks(EntityManager em,EntityType<?> jpaEntityType,List<OLink> links,Object jpaEntity){
  try {
    for (    final OLink link : links) {
      String[] propNameSplit=link.getRelation().split("String_Node_Str");
      String propName=propNameSplit[propNameSplit.length - 1];
      if (link instanceof ORelatedEntitiesLinkInline) {
        CollectionAttribute<?,?> att=jpaEntityType.getCollection(propName);
        Member member=att.getJavaMember();
        EntityType<?> collJpaEntityType=(EntityType<?>)att.getElementType();
        OneToMany oneToMany=getAnnotation(member,OneToMany.class);
        Member backRef=null;
        if (oneToMany != null && oneToMany.mappedBy() != null && !oneToMany.mappedBy().isEmpty()) {
          backRef=collJpaEntityType.getAttribute(oneToMany.mappedBy()).getJavaMember();
        }
        @SuppressWarnings("String_Node_Str") Collection<Object> coll=(Collection<Object>)getValue(jpaEntity,member);
        for (        OEntity oentity : ((ORelatedEntitiesLinkInline)link).getRelatedEntities()) {
          Object collJpaEntity=createNewJPAEntity(em,collJpaEntityType,oentity,true);
          if (backRef != null) {
            setValue(collJpaEntity,backRef,jpaEntity);
          }
          coll.add(collJpaEntity);
        }
      }
 else       if (link instanceof ORelatedEntityLink) {
      }
 else {
        Attribute<?,?> att=jpaEntityType.getAttribute(propName);
        Member member=att.getJavaMember();
        WebResource webResource=httpClient.resource(link.getHref());
        String requestEntity=webResource.get(String.class);
        OEntity relOEntity=BaseResource.convertFromString(requestEntity);
        String term=((AtomInfo)relOEntity).getCategoryTerm();
        EdmEntitySet ees=metadata.getEdmEntitySet(term.split("String_Node_Str")[1]);
        EntityType<?> jpaRelType=findJPAEntityType(em,ees.type.name);
        Object relEntity=createNewJPAEntity(em,jpaRelType,relOEntity,false);
        setValue(jpaEntity,member,relEntity);
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void applyOLinks(EntityManager em,EntityType<?> jpaEntityType,List<OLink> links,Object jpaEntity){
  try {
    for (    final OLink link : links) {
      String[] propNameSplit=link.getRelation().split("String_Node_Str");
      String propName=propNameSplit[propNameSplit.length - 1];
      if (link instanceof ORelatedEntitiesLinkInline) {
        CollectionAttribute<?,?> att=jpaEntityType.getCollection(propName);
        Member member=att.getJavaMember();
        EntityType<?> collJpaEntityType=(EntityType<?>)att.getElementType();
        OneToMany oneToMany=getAnnotation(member,OneToMany.class);
        Member backRef=null;
        if (oneToMany != null && oneToMany.mappedBy() != null && !oneToMany.mappedBy().isEmpty()) {
          backRef=collJpaEntityType.getAttribute(oneToMany.mappedBy()).getJavaMember();
        }
        @SuppressWarnings("String_Node_Str") Collection<Object> coll=(Collection<Object>)getValue(jpaEntity,member);
        for (        OEntity oentity : ((ORelatedEntitiesLinkInline)link).getRelatedEntities()) {
          Object collJpaEntity=createNewJPAEntity(em,collJpaEntityType,oentity,true);
          if (backRef != null) {
            setValue(collJpaEntity,backRef,jpaEntity);
          }
          coll.add(collJpaEntity);
        }
      }
 else       if (link instanceof ORelatedEntityLinkInline) {
      }
 else {
        Attribute<?,?> att=jpaEntityType.getAttribute(propName);
        Member member=att.getJavaMember();
        WebResource webResource=httpClient.resource(link.getHref());
        String requestEntity=webResource.get(String.class);
        OEntity relOEntity=BaseResource.convertFromString(requestEntity);
        String term=((AtomInfo)relOEntity).getCategoryTerm();
        EdmEntitySet ees=metadata.getEdmEntitySet(term.split("String_Node_Str")[1]);
        EntityType<?> jpaRelType=findJPAEntityType(em,ees.type.name);
        Object relEntity=createNewJPAEntity(em,jpaRelType,relOEntity,false);
        setValue(jpaEntity,member,relEntity);
      }
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}