Program: 176030
Project: 176030
Buggy source:
/** 
 * assign value to provided entity instance else return value of mapped java type.
 * @param row DS row
 * @param entity JPA entity
 * @param metadata entity's metadata
 * @param dataType data type
 * @param entityType entity type from metamodel
 * @param columnName jpa column name
 * @return modified entity instance with data type value. If entity is nullthen returns value of mapped java class.
 */
static Object assign(Row row,Object entity,EntityMetadata metadata,Name dataType,EntityType entityType,String columnName,Field member){
  String fieldName=null;
  if (metadata.getRelationNames() == null || !metadata.getRelationNames().contains(columnName)) {
    if (!columnName.equalsIgnoreCase("String_Node_Str")) {
      fieldName=metadata.getFieldName(columnName);
      if (fieldName != null) {
        entity=CassandraUtilities.initialize(metadata,entity,null);
        member=(Field)entityType.getAttribute(fieldName).getJavaMember();
      }
    }
 else {
      entity=CassandraUtilities.initialize(metadata,entity,null);
      fieldName=metadata.getIdAttribute().getName();
      member=(Field)metadata.getIdAttribute().getJavaMember();
    }
  }
  Object retVal=null;
switch (dataType) {
case BLOB:
case CUSTOM:
    retVal=row.getBytes(columnName);
  if (retVal != null) {
    PropertyAccessorHelper.set(entity,member,((ByteBuffer)retVal).array());
  }
break;
case BOOLEAN:
retVal=row.getBool(columnName);
setFieldValue(entity,member,retVal);
break;
case BIGINT:
case COUNTER:
retVal=row.getLong(columnName);
setFieldValue(entity,member,retVal);
break;
case DECIMAL:
retVal=row.getDecimal(columnName);
setFieldValue(entity,member,retVal);
break;
case DOUBLE:
retVal=row.getDouble(columnName);
setFieldValue(entity,member,retVal);
break;
case FLOAT:
retVal=row.getFloat(columnName);
setFieldValue(entity,member,retVal);
break;
case INET:
retVal=row.getInet(columnName);
setFieldValue(entity,member,retVal);
break;
case INT:
retVal=row.getInt(columnName);
retVal=setIntValue(member,retVal);
setFieldValue(entity,member,retVal);
break;
case ASCII:
case TEXT:
case VARCHAR:
retVal=row.getString(columnName);
retVal=setTextValue(entity,member,retVal);
setFieldValue(entity,member,retVal);
break;
case TIMESTAMP:
retVal=row.getDate(columnName);
if (retVal != null && member != null) retVal=CassandraDataTranslator.decompose(member.getType(),ByteBufferUtil.bytes(((Date)retVal).getTime()).array(),true);
setFieldValue(entity,member,retVal);
break;
case VARINT:
retVal=row.getVarint(columnName);
setFieldValue(entity,member,retVal);
break;
case UUID:
case TIMEUUID:
retVal=row.getUUID(columnName);
setFieldValue(entity,member,retVal);
break;
case LIST:
retVal=row.getList(columnName,PropertyAccessorHelper.getGenericClass(member));
PropertyAccessorHelper.set(entity,member,retVal);
break;
case SET:
retVal=row.getSet(columnName,PropertyAccessorHelper.getGenericClass(member));
PropertyAccessorHelper.set(entity,member,retVal);
break;
case MAP:
List<Class<?>> mapGenericClasses=PropertyAccessorHelper.getGenericClasses(member);
Class keyClass=CassandraValidationClassMapper.getValidationClassInstance(mapGenericClasses.get(0),true);
Class valueClass=CassandraValidationClassMapper.getValidationClassInstance(mapGenericClasses.get(1),true);
retVal=row.getMap(columnName,keyClass,valueClass);
PropertyAccessorHelper.set(entity,member,retVal);
break;
}
return entity != null ? entity : retVal;
}

Fixed version (ground truth):
/** 
 * assign value to provided entity instance else return value of mapped java type.
 * @param row DS row
 * @param entity JPA entity
 * @param metadata entity's metadata
 * @param dataType data type
 * @param entityType entity type from metamodel
 * @param columnName jpa column name
 * @return modified entity instance with data type value. If entity is nullthen returns value of mapped java class.
 */
static Object assign(Row row,Object entity,EntityMetadata metadata,Name dataType,EntityType entityType,String columnName,Field member){
  String fieldName=null;
  if (metadata != null && (metadata.getRelationNames() == null || !metadata.getRelationNames().contains(columnName))) {
    if (!columnName.equalsIgnoreCase("String_Node_Str")) {
      fieldName=metadata.getFieldName(columnName);
      if (fieldName != null && entityType != null) {
        entity=CassandraUtilities.initialize(metadata,entity,null);
        member=(Field)entityType.getAttribute(fieldName).getJavaMember();
      }
    }
 else {
      entity=CassandraUtilities.initialize(metadata,entity,null);
      fieldName=metadata.getIdAttribute().getName();
      member=(Field)metadata.getIdAttribute().getJavaMember();
    }
  }
  Object retVal=null;
switch (dataType) {
case BLOB:
case CUSTOM:
    retVal=row.getBytes(columnName);
  if (retVal != null) {
    PropertyAccessorHelper.set(entity,member,((ByteBuffer)retVal).array());
  }
break;
case BOOLEAN:
retVal=row.getBool(columnName);
setFieldValue(entity,member,retVal);
break;
case BIGINT:
case COUNTER:
retVal=row.getLong(columnName);
setFieldValue(entity,member,retVal);
break;
case DECIMAL:
retVal=row.getDecimal(columnName);
setFieldValue(entity,member,retVal);
break;
case DOUBLE:
retVal=row.getDouble(columnName);
setFieldValue(entity,member,retVal);
break;
case FLOAT:
retVal=row.getFloat(columnName);
setFieldValue(entity,member,retVal);
break;
case INET:
retVal=row.getInet(columnName);
setFieldValue(entity,member,retVal);
break;
case INT:
retVal=row.getInt(columnName);
retVal=setIntValue(member,retVal);
setFieldValue(entity,member,retVal);
break;
case ASCII:
case TEXT:
case VARCHAR:
retVal=row.getString(columnName);
retVal=setTextValue(entity,member,retVal);
setFieldValue(entity,member,retVal);
break;
case TIMESTAMP:
retVal=row.getDate(columnName);
if (retVal != null && member != null) retVal=CassandraDataTranslator.decompose(member.getType(),ByteBufferUtil.bytes(((Date)retVal).getTime()).array(),true);
setFieldValue(entity,member,retVal);
break;
case VARINT:
retVal=row.getVarint(columnName);
setFieldValue(entity,member,retVal);
break;
case UUID:
case TIMEUUID:
retVal=row.getUUID(columnName);
setFieldValue(entity,member,retVal);
break;
case LIST:
retVal=row.getList(columnName,PropertyAccessorHelper.getGenericClass(member));
PropertyAccessorHelper.set(entity,member,retVal);
break;
case SET:
retVal=row.getSet(columnName,PropertyAccessorHelper.getGenericClass(member));
PropertyAccessorHelper.set(entity,member,retVal);
break;
case MAP:
List<Class<?>> mapGenericClasses=PropertyAccessorHelper.getGenericClasses(member);
Class keyClass=CassandraValidationClassMapper.getValidationClassInstance(mapGenericClasses.get(0),true);
Class valueClass=CassandraValidationClassMapper.getValidationClassInstance(mapGenericClasses.get(1),true);
retVal=row.getMap(columnName,keyClass,valueClass);
PropertyAccessorHelper.set(entity,member,retVal);
break;
}
return entity != null ? entity : retVal;
}