nus-yam/ex-repair huggingface dataset:
Program: 17432
Project: 17432
Buggy source:
/** 
 * @param lastInstanceToken - Long token representing the position of the previous row key
 * @return CQLStatement of the single CQL statement required to get the next update token
 */
public static CQLStatement makeGetNextEligibleIndexUpdate(Long lastInstanceToken){
  return CQLStatement.make(TEMPLATE_SELECT_NEXT_ELIGIBLE_INDEX_UPDATE,Arrays.asList(lastInstanceToken,getTimeUUIDAtEndOfConsistencyHorizion()).toArray());
}

Fixed version (ground truth):
/** 
 * @param lastInstanceToken - Long token representing the position of the previous row key
 * @return CQLStatement of the single CQL statement required to get the next update token
 */
public CQLStatement makeGetNextEligibleIndexUpdate(Long lastInstanceToken){
  return CQLStatement.make(TEMPLATE_SELECT_NEXT_ELIGIBLE_INDEX_UPDATE,Arrays.asList(lastInstanceToken,getTimeUUIDAtEndOfConsistencyHorizion()).toArray());
}
Program: 17433
Project: 17433
Buggy source:
/** 
 * @return CQLStatement of single CQL statement required to get the first update token
 */
public static CQLStatement makeGetFirstEligibleIndexUpdate(){
  return CQLStatement.make(TEMPLATE_SELECT_FIRST_ELIGIBLE_INDEX_UPDATE,Arrays.asList(getTimeUUIDAtEndOfConsistencyHorizion()).toArray());
}

Fixed version (ground truth):
/** 
 * @return CQLStatement of single CQL statement required to get the first update token
 */
public CQLStatement makeGetFirstEligibleIndexUpdate(){
  return CQLStatement.make(TEMPLATE_SELECT_FIRST_ELIGIBLE_INDEX_UPDATE,Arrays.asList(getTimeUUIDAtEndOfConsistencyHorizion()).toArray());
}
Program: 17434
Project: 17434
Buggy source:
public void testMakeWideTableCreate() throws CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeWideTableCreate();
}

Fixed version (ground truth):
public void testMakeWideTableCreate() throws CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeWideTableCreate();
}
Program: 17435
Project: 17435
Buggy source:
public void testMakeCQLforDelete() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforDelete();
}

Fixed version (ground truth):
public void testMakeCQLforDelete() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeCQLforDelete();
}
Program: 17436
Project: 17436
Buggy source:
public void testMakeCQLforInsert() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforInsert();
}

Fixed version (ground truth):
public void testMakeCQLforInsert() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeCQLforInsert();
}
Program: 17437
Project: 17437
Buggy source:
public void testMakeCQLforUpdate() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforUpdate();
}

Fixed version (ground truth):
public void testMakeCQLforUpdate() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeCQLforUpdate();
}
Program: 17438
Project: 17438
Buggy source:
public void testMakeCQLforCreate() throws CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforCreate();
}

Fixed version (ground truth):
public void testMakeCQLforCreate() throws CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeCQLforCreate();
}
Program: 17439
Project: 17439
Buggy source:
public void testMakeStaticTableCreate() throws CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeStaticTableCreate();
}

Fixed version (ground truth):
public void testMakeStaticTableCreate() throws CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeStaticTableCreate();
}
Program: 17440
Project: 17440
Buggy source:
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforGet();
}

Fixed version (ground truth):
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeCQLforGet();
}
Program: 17441
Project: 17441
Buggy source:
public void testMakeIndexTableName() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeIndexTableName();
}

Fixed version (ground truth):
public void testMakeIndexTableName() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject(0);
  s.testMakeIndexTableName();
}
Program: 17444
Project: 17444
Buggy source:
public public ObjectMapper getObjectMapper(){
  return objectMapper;
}

Fixed version (ground truth):
public ObjectMapper getObjectMapper(){
  return objectMapper;
}
Program: 17445
Project: 17445
Buggy source:
public public ObjectMapper getObjectMapper(){
  return objectMapper;
}

Fixed version (ground truth):
public ObjectMapper getObjectMapper(){
  return objectMapper;
}
Program: 17446
Project: 17446
Buggy source:
private String getFieldValue(Row row,CField field){
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    fieldValue=row.getString(field.getName());
  break;
case BIGINT:
case COUNTER:
fieldValue=row.getLong(field.getName());
break;
case BLOB:
fieldValue=row.getBytes(field.getName());
break;
case BOOLEAN:
fieldValue=row.getBool(field.getName());
break;
case DECIMAL:
fieldValue=row.getDecimal(field.getName());
break;
case DOUBLE:
fieldValue=row.getDouble(field.getName());
break;
case FLOAT:
fieldValue=row.getFloat(field.getName());
break;
case INT:
fieldValue=row.getInt(field.getName());
break;
case TIMESTAMP:
fieldValue=row.getDate(field.getName());
if (fieldValue != null) {
fieldValue=((Date)fieldValue).getTime();
}
break;
case UUID:
case TIMEUUID:
fieldValue=row.getUUID(field.getName());
break;
case VARINT:
fieldValue=row.getVarint(field.getName());
break;
default :
fieldValue=null;
}
return (fieldValue == null ? null : fieldValue.toString());
}

Fixed version (ground truth):
private Object getFieldValue(Row row,CField field){
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    fieldValue=row.getString(field.getName());
  break;
case BIGINT:
case COUNTER:
fieldValue=row.getLong(field.getName());
break;
case BLOB:
fieldValue=row.getBytes(field.getName());
break;
case BOOLEAN:
fieldValue=row.getBool(field.getName());
break;
case DECIMAL:
fieldValue=row.getDecimal(field.getName());
break;
case DOUBLE:
fieldValue=row.getDouble(field.getName());
break;
case FLOAT:
fieldValue=row.getFloat(field.getName());
break;
case INT:
fieldValue=row.getInt(field.getName());
break;
case TIMESTAMP:
fieldValue=row.getDate(field.getName());
if (fieldValue != null) {
fieldValue=((Date)fieldValue).getTime();
}
break;
case UUID:
case TIMEUUID:
fieldValue=row.getUUID(field.getName());
break;
case VARINT:
fieldValue=row.getVarint(field.getName());
break;
default :
fieldValue=null;
}
return (fieldValue == null ? null : fieldValue);
}
Program: 17447
Project: 17447
Buggy source:
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery());
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  values.add(Long.valueOf(numberRemaining));
  ret.setValues(values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery());
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  ret.setValues(values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17448
Project: 17448
Buggy source:
protected static CQLStatement makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,Long timestamp){
  Object[] values={timestamp,uuid};
  return CQLStatement.make(String.format(TEMPLATE_DELETE,makeTableName(def,null),"String_Node_Str"),values);
}

Fixed version (ground truth):
protected static CQLStatement makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,Long timestamp){
  Object[] values={uuid};
  return CQLStatement.make(String.format(TEMPLATE_DELETE,makeTableName(def,null),timestamp,"String_Node_Str"),values);
}
Program: 17449
Project: 17449
Buggy source:
protected static CQLStatement makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,Object> indexValues,Long timestamp){
  List values=Lists.newArrayList(uuid,Long.valueOf(index.getShardingStrategy().getShardKey(uuid)));
  CQLStatement wheres=makeAndedEqualList(def,indexValues);
  values.addAll(Arrays.asList(wheres.getValues()));
  String whereCQL=String.format("String_Node_Str",wheres.getQuery());
  String query=String.format(TEMPLATE_DELETE,makeTableName(def,index),whereCQL);
  values.add(0,timestamp);
  return CQLStatement.make(query,values.toArray());
}

Fixed version (ground truth):
protected static CQLStatement makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,Object> indexValues,Long timestamp){
  List values=Lists.newArrayList(uuid,Long.valueOf(index.getShardingStrategy().getShardKey(uuid)));
  CQLStatement wheres=makeAndedEqualList(def,indexValues);
  values.addAll(Arrays.asList(wheres.getValues()));
  String whereCQL=String.format("String_Node_Str",wheres.getQuery());
  String query=String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
  return CQLStatement.make(query,values.toArray());
}
Program: 17450
Project: 17450
Buggy source:
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  values.add(Long.valueOf(numberRemaining));
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery(),values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery(),values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17451
Project: 17451
Buggy source:
private static Object typedObjectFromValueAndField(Object jsonValue,CField field){
  if (jsonValue == null) {
    return null;
  }
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    Preconditions.checkArgument(String.class.isAssignableFrom(jsonValue.getClass()));
  fieldValue=jsonValue;
break;
case BIGINT:
case COUNTER:
fieldValue=longFromNumber(jsonValue);
break;
case BLOB:
throw new IllegalArgumentException();
case BOOLEAN:
fieldValue=booleanFromNumber(jsonValue);
break;
case DECIMAL:
fieldValue=jsonValue.getDecimal(field.getName());
break;
case DOUBLE:
fieldValue=jsonValue.getDouble(field.getName());
break;
case FLOAT:
fieldValue=jsonValue.getFloat(field.getName());
break;
case INT:
fieldValue=jsonValue.getInt(field.getName());
break;
case TIMESTAMP:
fieldValue=jsonValue.getDate(field.getName());
if (fieldValue != null) {
fieldValue=((Date)fieldValue).getTime();
}
break;
case UUID:
case TIMEUUID:
fieldValue=jsonValue.getUUID(field.getName());
break;
case VARINT:
fieldValue=jsonValue.getVarint(field.getName());
break;
default :
fieldValue=null;
}
return (fieldValue == null ? null : fieldValue.toString());
}

Fixed version (ground truth):
private static Object typedObjectFromValueAndField(Object jsonValue,CField field){
  if (jsonValue == null) {
    return null;
  }
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    Preconditions.checkArgument(String.class.isAssignableFrom(jsonValue.getClass()));
  return jsonValue;
case BIGINT:
case COUNTER:
return longFromNumber(jsonValue);
case BLOB:
throw new IllegalArgumentException();
case BOOLEAN:
if (jsonValue instanceof Boolean) {
return jsonValue;
}
 else {
throw new IllegalArgumentException();
}
case DECIMAL:
if (jsonValue instanceof Float) {
return BigDecimal.valueOf(((Float)jsonValue).floatValue());
}
 else if (jsonValue instanceof Double) {
return BigDecimal.valueOf(((Double)jsonValue).doubleValue());
}
 else {
throw new IllegalArgumentException();
}
case DOUBLE:
if (jsonValue instanceof Double) {
return Double.valueOf(((Float)jsonValue).floatValue());
}
 else {
throw new IllegalArgumentException();
}
case FLOAT:
if (jsonValue instanceof Double) {
return Float.valueOf(((Float)jsonValue).floatValue());
}
 else {
throw new IllegalArgumentException();
}
case INT:
return intFromNumber(jsonValue);
case TIMESTAMP:
if (jsonValue instanceof Integer) {
return new Date(((Integer)jsonValue).longValue());
}
 else if (jsonValue instanceof Long) {
return new Date(((Long)jsonValue).longValue());
}
 else {
throw new IllegalArgumentException("String_Node_Str" + jsonValue + "String_Node_Str"+ jsonValue.getClass()+ "String_Node_Str");
}
case UUID:
case TIMEUUID:
if (jsonValue instanceof String) {
return UUID.fromString((String)jsonValue);
}
 else {
throw new IllegalArgumentException();
}
case VARINT:
if (jsonValue instanceof String) {
return BigInteger.valueOf(Long.parseLong((String)jsonValue));
}
 else {
throw new IllegalArgumentException();
}
default :
return null;
}
}
Program: 17454
Project: 17454
Buggy source:
/** 
 * This should never be used outside of testing
 * @param cql String of cql to execute
 */
public ResultSet executeCql(CQLStatement cql){
  if (logCql) {
    logger.debug("String_Node_Str",cql.getQuery());
  }
  if (cql.isPreparable()) {
    BoundStatement bs=boundStatementMap.get(cql.getQuery());
    if (bs == null) {
      PreparedStatement statement=session.prepare(cql.getQuery());
      bs=new BoundStatement(statement);
      boundStatementMap.put(cql.getQuery(),bs);
    }
    return session.execute(bs.bind(cql.getValues()));
  }
 else {
    return session.execute(cql.getQuery());
  }
}

Fixed version (ground truth):
/** 
 * This should never be used outside of testing
 * @param cql String of cql to execute
 */
public ResultSet executeCql(CQLStatement cql){
  if (logCql) {
    logger.debug("String_Node_Str",cql.getQuery());
  }
  if (cql.isPreparable()) {
    BoundStatement bs=boundStatementCache.get(cql.getQuery());
    if (bs == null) {
      PreparedStatement statement=session.prepare(cql.getQuery());
      bs=new BoundStatement(statement);
      if (cql.isCacheable()) {
        boundStatementCache.put(cql.getQuery(),bs);
      }
    }
    return session.execute(bs.bind(cql.getValues()));
  }
 else {
    return session.execute(cql.getQuery());
  }
}
Program: 17455
Project: 17455
Buggy source:
public ObjectMapper(Session session,CKeyspaceDefinition keyspaceDefinition){
  this.boundStatementMap=Maps.newHashMap();
  this.session=session;
  this.keyspaceDefinition=keyspaceDefinition;
  this.cqlGenerator=new CObjectCQLGenerator(keyspaceDefinition.getDefinitions(),null);
}

Fixed version (ground truth):
public ObjectMapper(Session session,CKeyspaceDefinition keyspaceDefinition){
  this.boundStatementCache=Maps.newHashMap();
  this.session=session;
  this.keyspaceDefinition=keyspaceDefinition;
  this.cqlGenerator=new CObjectCQLGenerator(keyspaceDefinition.getDefinitions(),null);
}
Program: 17456
Project: 17456
Buggy source:
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery());
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  values.add(Long.valueOf(numberRemaining));
  ret.setValues(values.toArray());
  return ret;
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery());
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  values.add(Long.valueOf(numberRemaining));
  ret.setValues(values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17457
Project: 17457
Buggy source:
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  values.add(Long.valueOf(numberRemaining));
  return CQLStatement.make(CQLTemplate.getQuery(),values.toArray());
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  values.add(Long.valueOf(numberRemaining));
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery(),values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17458
Project: 17458
Buggy source:
private Object getFieldValue(Row row,CField field){
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    fieldValue=row.getString(field.getName());
  break;
case BIGINT:
case COUNTER:
fieldValue=row.getLong(field.getName());
break;
case BLOB:
fieldValue=row.getBytes(field.getName());
break;
case BOOLEAN:
fieldValue=row.getBool(field.getName());
break;
case DECIMAL:
fieldValue=row.getDecimal(field.getName());
break;
case DOUBLE:
fieldValue=row.getDouble(field.getName());
break;
case FLOAT:
fieldValue=row.getFloat(field.getName());
break;
case INT:
fieldValue=row.getInt(field.getName());
break;
case TIMESTAMP:
fieldValue=row.getDate(field.getName());
if (fieldValue != null) {
fieldValue=((Date)fieldValue).getTime();
}
break;
case UUID:
case TIMEUUID:
fieldValue=row.getUUID(field.getName());
break;
case VARINT:
fieldValue=row.getVarint(field.getName());
break;
default :
fieldValue=null;
}
return (fieldValue == null ? null : fieldValue);
}

Fixed version (ground truth):
private Object getFieldValue(Row row,CField field){
  Object fieldValue;
switch (field.getType()) {
case ASCII:
case VARCHAR:
case TEXT:
    fieldValue=row.getString(field.getName());
  break;
case BIGINT:
case COUNTER:
fieldValue=row.getLong(field.getName());
break;
case BLOB:
fieldValue=row.getBytes(field.getName());
break;
case BOOLEAN:
fieldValue=row.getBool(field.getName());
break;
case DECIMAL:
fieldValue=row.getDecimal(field.getName());
break;
case DOUBLE:
fieldValue=row.getDouble(field.getName());
break;
case FLOAT:
fieldValue=row.getFloat(field.getName());
break;
case INT:
fieldValue=row.getInt(field.getName());
break;
case TIMESTAMP:
fieldValue=row.getDate(field.getName());
break;
case UUID:
case TIMEUUID:
fieldValue=row.getUUID(field.getName());
break;
case VARINT:
fieldValue=row.getVarint(field.getName());
break;
default :
fieldValue=null;
}
return (fieldValue == null ? null : fieldValue);
}
Program: 17459
Project: 17459
Buggy source:
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery());
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  ret.setValues(values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  CQLStatement ret=CQLStatement.make(String.format(CQLTemplate.getQuery(),numberRemaining));
  List values=Lists.newArrayList(ret.getValues());
  values.add(0,this.shardIdIterator.next());
  ret.setValues(values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17460
Project: 17460
Buggy source:
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  CQLStatement ret=CQLStatement.make(CQLTemplate.getQuery(),values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}

Fixed version (ground truth):
@Override public CQLStatement next(){
  List values=Lists.newArrayList(CQLTemplate.getValues());
  values.add(0,this.keyIterator.next());
  CQLStatement ret=CQLStatement.make(String.format(CQLTemplate.getQuery(),numberRemaining),values.toArray());
  ret.setCacheable(CQLTemplate.isCacheable());
  return ret;
}
Program: 17461
Project: 17461
Buggy source:
@Test public void testObjectTypes() throws Exception {
  logger.debug("String_Node_Str");
  ConnectionManager cm=getConnectionManager();
  CKeyspaceDefinition definition=JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class,this.getClass().getClassLoader(),"String_Node_Str");
  assertNotNull(definition);
  cm.buildKeyspace(definition,true);
  cm.setDefaultKeyspace(definition);
  ObjectMapper om=cm.getObjectMapper();
  List<Map<String,Object>> values=JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(),"String_Node_Str");
  Map<String,Object> data=JsonUtil.rhombusMapFromJsonMap(values.get(0),definition.getDefinitions().get("String_Node_Str"));
  UUID uuid=om.insert("String_Node_Str",data);
  assertNotNull(uuid);
  Map<String,Object> returnedValues=om.getByKey("String_Node_Str",uuid);
  assertNotNull(returnedValues.get("String_Node_Str"));
  logger.debug("String_Node_Str",returnedValues);
  for (  String returnedKey : returnedValues.keySet()) {
    if (!returnedKey.equals("String_Node_Str")) {
      Object insertValue=values.get(0).get(returnedKey);
      Object returnValue=returnedValues.get(returnedKey);
      assertEquals(insertValue,returnValue);
    }
  }
}

Fixed version (ground truth):
@Test public void testObjectTypes() throws Exception {
  logger.debug("String_Node_Str");
  ConnectionManager cm=getConnectionManager();
  CKeyspaceDefinition definition=JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class,this.getClass().getClassLoader(),"String_Node_Str");
  assertNotNull(definition);
  cm.buildKeyspace(definition,true);
  cm.setDefaultKeyspace(definition);
  ObjectMapper om=cm.getObjectMapper();
  List<Map<String,Object>> values=JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(),"String_Node_Str");
  Map<String,Object> data=JsonUtil.rhombusMapFromJsonMap(values.get(0),definition.getDefinitions().get("String_Node_Str"));
  UUID uuid=om.insert("String_Node_Str",data);
  assertNotNull(uuid);
  Map<String,Object> returnedValues=om.getByKey("String_Node_Str",uuid);
  assertNotNull(returnedValues.get("String_Node_Str"));
  logger.debug("String_Node_Str",returnedValues);
  for (  String returnedKey : returnedValues.keySet()) {
    if (!returnedKey.equals("String_Node_Str")) {
      Object insertValue=data.get(returnedKey);
      Object returnValue=returnedValues.get(returnedKey);
      assertEquals(insertValue,returnValue);
    }
  }
}
Program: 17462
Project: 17462
Buggy source:
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
}

Fixed version (ground truth):
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforGet();
}
Program: 17463
Project: 17463
Buggy source:
protected static Map<String,ArrayList<String>> makeFieldAndValueList(CDefinition def,Map<String,String> data){
  ArrayList<String> fieldList=new ArrayList<String>(def.getFields().size());
  ArrayList<String> valueList=new ArrayList<String>(def.getFields().size());
  for (  CField f : def.getFields().values()) {
    fieldList.add(f.getName());
    valueList.add(getCQLValueString(f,data.get(f.getName())));
  }
  Map<String,ArrayList<String>> ret=Maps.newHashMap();
  ret.put("String_Node_Str",fieldList);
  ret.put("String_Node_Str",valueList);
  return ret;
}

Fixed version (ground truth):
protected static Map<String,ArrayList<String>> makeFieldAndValueList(CDefinition def,Map<String,String> data){
  ArrayList<String> fieldList=new ArrayList<String>(def.getFields().size());
  ArrayList<String> valueList=new ArrayList<String>(def.getFields().size());
  for (  CField f : def.getFields().values()) {
    if (data.get(f.getName()) != null) {
      fieldList.add(f.getName());
      valueList.add(getCQLValueString(f,data.get(f.getName())));
    }
  }
  Map<String,ArrayList<String>> ret=Maps.newHashMap();
  ret.put("String_Node_Str",fieldList);
  ret.put("String_Node_Str",valueList);
  return ret;
}
Program: 17464
Project: 17464
Buggy source:
public Range<Long> getShardKeyRange(long timestampStart,long timestampEnd) throws ShardStrategyException {
  if (timestampStart == 0) {
    if (timestampEnd == 0) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.atMost(end);
    }
  }
 else {
    long start=getShardKey(timestampStart);
    if (timestampEnd == 0) {
      return Range.atLeast(start);
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.closed(start,end);
    }
  }
}

Fixed version (ground truth):
public Range<Long> getShardKeyRange(long timestampStart,long timestampEnd) throws ShardStrategyException {
  if (timestampStart == 0) {
    if (timestampEnd == 0) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      return Range.closed(1L,getShardKey(timestampEnd));
    }
  }
 else {
    long start=getShardKey(timestampStart);
    if (timestampEnd == 0) {
      return Range.closed(start,this.getShardKey(DateTime.now().getMillis()));
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.closed(start,end);
    }
  }
}
Program: 17465
Project: 17465
Buggy source:
/** 
 * Update objectType with key using values
 * @param objectType
 * @param key
 * @param values
 * @return new UUID of the object
 * @throws CQLGenerationException
 */
public UUID update(String objectType,UUID key,Map<String,String> values) throws CQLGenerationException {
  UUID newKey=UUIDs.startOf(key.timestamp());
  delete(objectType,key);
  return insert(objectType,values,newKey);
}

Fixed version (ground truth):
/** 
 * Update objectType with key using values
 * @param objectType
 * @param key
 * @param values
 * @return new UUID of the object
 * @throws CQLGenerationException
 */
public UUID update(String objectType,UUID key,Map<String,String> values) throws CQLGenerationException {
  UUID newKey=UUIDs.startOf(UUIDs.unixTimestamp(key));
  delete(objectType,key);
  return insert(objectType,values,newKey);
}
Program: 17466
Project: 17466
Buggy source:
/** 
 * Delete objecttype with id key
 * @param objectType
 * @param key
 */
public void delete(String objectType,UUID key){
  CDefinition def=keyspaceDefinition.getDefinitions().get(objectType);
  Map<String,String> values=getByKey(objectType,key);
  CQLStatementIterator statementIterator=cqlGenerator.makeCQLforDelete(objectType,key,values,0);
  mapResults(statementIterator,def,0L);
}

Fixed version (ground truth):
/** 
 * Delete objecttype with id key
 * @param objectType
 * @param key
 */
public void delete(String objectType,UUID key){
  CDefinition def=keyspaceDefinition.getDefinitions().get(objectType);
  Map<String,String> values=getByKey(objectType,key);
  CQLStatementIterator statementIterator=cqlGenerator.makeCQLforDelete(objectType,key,values,null);
  mapResults(statementIterator,def,0L);
}
Program: 17467
Project: 17467
Buggy source:
protected static CQLStatementIterator makeCQLforDelete(CDefinition def,UUID key,Map<String,String> data,long timestamp){
  if (timestamp == 0) {
    timestamp=System.currentTimeMillis();
  }
  List<String> ret=Lists.newArrayList();
  ret.add(makeCQLforDeleteUUIDFromStaticTable(def,key,timestamp));
  for (  CIndex i : def.getIndexes().values()) {
    ret.add(makeCQLforDeleteUUIDFromIndex(def,i,key,i.getIndexKeyAndValues(data),timestamp));
  }
  return new BoundedCQLStatementIterator(ret);
}

Fixed version (ground truth):
protected static CQLStatementIterator makeCQLforDelete(CDefinition def,UUID key,Map<String,String> data,Long timestamp){
  if (timestamp == null) {
    timestamp=Long.valueOf(System.currentTimeMillis());
  }
  List<String> ret=Lists.newArrayList();
  ret.add(makeCQLforDeleteUUIDFromStaticTable(def,key,timestamp));
  for (  CIndex i : def.getIndexes().values()) {
    ret.add(makeCQLforDeleteUUIDFromIndex(def,i,key,i.getIndexKeyAndValues(data),timestamp));
  }
  return new BoundedCQLStatementIterator(ret);
}
Program: 17468
Project: 17468
Buggy source:
protected static String makeInsertStatementStatic(String tableName,String fields,String values,UUID uuid,long timestamp,int ttl){
  return String.format(TEMPLATE_INSERT_STATIC,tableName,fields,uuid.toString(),values,timestamp + "String_Node_Str",(ttl == 0) ? "String_Node_Str" : ("String_Node_Str" + ttl));
}

Fixed version (ground truth):
protected static String makeInsertStatementStatic(String tableName,String fields,String values,UUID uuid,Long timestamp,Integer ttl){
  return String.format(TEMPLATE_INSERT_STATIC,tableName,fields,uuid.toString(),values,timestamp + "String_Node_Str",(ttl == null) ? "String_Node_Str" : ("String_Node_Str" + ttl));
}
Program: 17469
Project: 17469
Buggy source:
protected static String makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,long timestamp){
  return String.format(TEMPLATE_DELETE,makeTableName(def,null),timestamp,"String_Node_Str" + uuid.toString());
}

Fixed version (ground truth):
protected static String makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,Long timestamp){
  return String.format(TEMPLATE_DELETE,makeTableName(def,null),timestamp,"String_Node_Str" + uuid.toString());
}
Program: 17470
Project: 17470
Buggy source:
protected static CQLStatementIterator makeCQLforGet(CObjectShardList shardList,CDefinition def,SortedMap<String,String> indexvalues,CObjectOrdering ordering,long starttimestamp,long endtimestamp,long limit) throws CQLGenerationException {
  return makeCQLforGet(shardList,def,indexvalues,ordering,UUIDs.startOf(starttimestamp),UUIDs.endOf(endtimestamp),limit,true);
}

Fixed version (ground truth):
protected static CQLStatementIterator makeCQLforGet(CObjectShardList shardList,CDefinition def,SortedMap<String,String> indexvalues,CObjectOrdering ordering,Long starttimestamp,Long endtimestamp,Long limit) throws CQLGenerationException {
  UUID startUUID=(starttimestamp == null) ? null : UUIDs.startOf(starttimestamp.longValue());
  UUID endUUID=(endtimestamp == null) ? null : UUIDs.endOf(endtimestamp.longValue());
  return makeCQLforGet(shardList,def,indexvalues,ordering,startUUID,endUUID,limit,true);
}
Program: 17471
Project: 17471
Buggy source:
protected static String makeInsertStatementWideIndex(String tableName,String targetTableName,Long shardId,List<String> indexValues,long timestamp){
  String indexValuesString=Joiner.on("String_Node_Str").join(indexValues);
  return String.format(TEMPLATE_INSERT_WIDE_INDEX,tableName,targetTableName,indexValuesString,shardId,shardId + "String_Node_Str" + indexValuesString,timestamp);
}

Fixed version (ground truth):
protected static String makeInsertStatementWideIndex(String tableName,String targetTableName,long shardId,List<String> indexValues,Long timestamp){
  String indexValuesString=Joiner.on("String_Node_Str").join(indexValues);
  return String.format(TEMPLATE_INSERT_WIDE_INDEX,tableName,targetTableName,indexValuesString,shardId,shardId + "String_Node_Str" + indexValuesString,timestamp);
}
Program: 17472
Project: 17472
Buggy source:
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid),makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
}

Fixed version (ground truth):
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,Long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid),makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
}
Program: 17473
Project: 17473
Buggy source:
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,long timestamp,int ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=System.currentTimeMillis();
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def,null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    long shardId=i.getShardingStrategy().getShardKey(uuid);
    ret.add(makeInsertStatementWide(makeTableName(def,i),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
    if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
      ret.add(makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def,i),shardId,i.getIndexValues(data),timestamp));
    }
  }
  return new BoundedCQLStatementIterator(ret);
}

Fixed version (ground truth):
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,Long timestamp,Integer ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=System.currentTimeMillis();
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def,null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    long shardId=i.getShardingStrategy().getShardKey(uuid);
    ret.add(makeInsertStatementWide(makeTableName(def,i),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
    if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
      ret.add(makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def,i),shardId,i.getIndexValues(data),timestamp));
    }
  }
  return new BoundedCQLStatementIterator(ret);
}
Program: 17474
Project: 17474
Buggy source:
protected static String makeInsertStatementWide(String tableName,String fields,String values,UUID uuid,long shardid,long timestamp,int ttl){
  return String.format(TEMPLATE_INSERT_WIDE,tableName,fields,uuid.toString(),shardid,values,timestamp + "String_Node_Str",(ttl == 0) ? "String_Node_Str" : ("String_Node_Str" + ttl));
}

Fixed version (ground truth):
protected static String makeInsertStatementWide(String tableName,String fields,String values,UUID uuid,long shardid,Long timestamp,Integer ttl){
  return String.format(TEMPLATE_INSERT_WIDE,tableName,fields,uuid.toString(),shardid,values,timestamp + "String_Node_Str",(ttl == null) ? "String_Node_Str" : ("String_Node_Str" + ttl));
}
Program: 17475
Project: 17475
Buggy source:
public Range<Long> getShardKeyRange(long timestampStart,long timestampEnd) throws ShardStrategyException {
  if (timestampStart == 0) {
    if (timestampEnd == 0) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      return Range.closed(1L,getShardKey(timestampEnd));
    }
  }
 else {
    long start=getShardKey(timestampStart);
    if (timestampEnd == 0) {
      return Range.closed(start,this.getShardKey(DateTime.now().getMillis()));
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.closed(start,end);
    }
  }
}

Fixed version (ground truth):
public Range<Long> getShardKeyRange(Long timestampStart,Long timestampEnd) throws ShardStrategyException {
  if (timestampStart == null) {
    if (timestampEnd == null) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      return Range.closed(1L,getShardKey(Long.valueOf(timestampEnd)));
    }
  }
 else {
    long start=getShardKey(Long.valueOf(timestampStart));
    if (timestampEnd == null) {
      return Range.closed(start,this.getShardKey(DateTime.now().getMillis()));
    }
 else {
      long end=getShardKey(Long.valueOf(timestampEnd));
      return Range.closed(start,end);
    }
  }
}
Program: 17476
Project: 17476
Buggy source:
public void testShardingStrategyMonthly() throws ShardStrategyException {
  ShardingStrategyMonthly subject=new ShardingStrategyMonthly();
  DateTime d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  long actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",158,actual);
  subject=new ShardingStrategyMonthly();
  subject.setOffset(20);
  d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",178,actual);
  subject=new ShardingStrategyMonthly();
  DateTime d1=new DateTime(2013,2,22,2,0,0,DateTimeZone.UTC);
  DateTime d2=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  Range<Long> range=subject.getShardKeyRange(d1.getMillis(),d2.getMillis());
  assertEquals("String_Node_Str",158L,range.lowerEndpoint().longValue());
  assertEquals("String_Node_Str",170L,range.upperEndpoint().longValue());
  subject=new ShardingStrategyMonthly();
  d1=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  range=subject.getShardKeyRange(d1.getMillis(),0);
  assertEquals("String_Node_Str",170L,range.lowerEndpoint().longValue());
  assertTrue("String_Node_Str",!range.hasUpperBound());
  assertTrue("String_Node_Str",range.hasLowerBound());
}

Fixed version (ground truth):
public void testShardingStrategyMonthly() throws ShardStrategyException {
  ShardingStrategyMonthly subject=new ShardingStrategyMonthly();
  DateTime d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  long actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",158,actual);
  subject=new ShardingStrategyMonthly();
  subject.setOffset(20);
  d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",178,actual);
  subject=new ShardingStrategyMonthly();
  DateTime d1=new DateTime(2013,2,22,2,0,0,DateTimeZone.UTC);
  DateTime d2=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  Range<Long> range=subject.getShardKeyRange(d1.getMillis(),d2.getMillis());
  assertEquals("String_Node_Str",158L,range.lowerEndpoint().longValue());
  assertEquals("String_Node_Str",170L,range.upperEndpoint().longValue());
  subject=new ShardingStrategyMonthly();
  d1=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  range=subject.getShardKeyRange(Long.valueOf(d1.getMillis()),Long.valueOf(0));
  assertEquals("String_Node_Str",170L,range.lowerEndpoint().longValue());
  assertTrue("String_Node_Str",!range.hasUpperBound());
  assertTrue("String_Node_Str",range.hasLowerBound());
}
Program: 17477
Project: 17477
Buggy source:
public void testShardingStrategyNone() throws ShardStrategyException {
  ShardingStrategyNone subject=new ShardingStrategyNone();
  DateTime d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  long actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",1L,actual);
  subject=new ShardingStrategyNone();
  subject.setOffset(20);
  d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",21L,actual);
  subject=new ShardingStrategyNone();
  DateTime d1=new DateTime(2013,2,22,2,0,0,DateTimeZone.UTC);
  DateTime d2=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  Range<Long> range=subject.getShardKeyRange(d1.getMillis(),d2.getMillis());
  assertEquals("String_Node_Str",1L,range.lowerEndpoint().longValue());
  assertEquals("String_Node_Str",1L,range.upperEndpoint().longValue());
  subject=new ShardingStrategyNone();
  d1=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  range=subject.getShardKeyRange(d1.getMillis(),0);
  assertEquals("String_Node_Str",1L,range.lowerEndpoint().longValue());
  assertTrue("String_Node_Str",!range.hasUpperBound());
  assertTrue("String_Node_Str",range.hasLowerBound());
}

Fixed version (ground truth):
public void testShardingStrategyNone() throws ShardStrategyException {
  ShardingStrategyNone subject=new ShardingStrategyNone();
  DateTime d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  long actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",1L,actual);
  subject=new ShardingStrategyNone();
  subject.setOffset(20);
  d=new DateTime(2013,2,22,1,0,0,DateTimeZone.UTC);
  actual=subject.getShardKey(d.getMillis());
  assertEquals("String_Node_Str",21L,actual);
  subject=new ShardingStrategyNone();
  DateTime d1=new DateTime(2013,2,22,2,0,0,DateTimeZone.UTC);
  DateTime d2=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  Range<Long> range=subject.getShardKeyRange(d1.getMillis(),d2.getMillis());
  assertEquals("String_Node_Str",1L,range.lowerEndpoint().longValue());
  assertEquals("String_Node_Str",1L,range.upperEndpoint().longValue());
  subject=new ShardingStrategyNone();
  d1=new DateTime(2014,2,22,2,0,0,DateTimeZone.UTC);
  range=subject.getShardKeyRange(Long.valueOf(d1.getMillis()),Long.valueOf(0));
  assertEquals("String_Node_Str",1L,range.lowerEndpoint().longValue());
  assertTrue("String_Node_Str",!range.hasUpperBound());
  assertTrue("String_Node_Str",range.hasLowerBound());
}
Program: 17478
Project: 17478
Buggy source:
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid) + "String_Node_Str",makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
}

Fixed version (ground truth):
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid),makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
}
Program: 17479
Project: 17479
Buggy source:
/** 
 * @param def - CIndex for the index for which to pull the shard list
 * @param indexValues - Values identifing the specific index for which to pull the shard list
 * @param ordering - ASC or DESC
 * @param start - Start UUID for bounding
 * @param end - End UUID for bounding
 * @return Single CQL statement needed to retrieve the list of shardids
 */
public static String makeCQLforGetShardIndexList(CDefinition def,SortedMap<String,String> indexValues,CObjectOrdering ordering,@Nullable UUID start,@Nullable UUID end){
  CIndex i=def.getIndex(indexValues);
  String indexValueString=Joiner.on(':').join(indexValues.values());
  String whereCQL="String_Node_Str";
  if (start != null) {
    whereCQL+="String_Node_Str" + i.getShardingStrategy().getShardKey(start);
  }
  if (end != null) {
    whereCQL+="String_Node_Str" + i.getShardingStrategy().getShardKey(end);
  }
  return String.format(TEMPLATE_SELECT_WIDE_INDEX,CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def.getName(),i.getName()),indexValueString,whereCQL,ordering);
}

Fixed version (ground truth):
/** 
 * @param def - CIndex for the index for which to pull the shard list
 * @param indexValues - Values identifing the specific index for which to pull the shard list
 * @param ordering - ASC or DESC
 * @param start - Start UUID for bounding
 * @param end - End UUID for bounding
 * @return Single CQL statement needed to retrieve the list of shardids
 */
public static String makeCQLforGetShardIndexList(CDefinition def,SortedMap<String,String> indexValues,CObjectOrdering ordering,@Nullable UUID start,@Nullable UUID end){
  CIndex i=def.getIndex(indexValues);
  String indexValueString=Joiner.on(':').join(indexValues.values());
  String whereCQL="String_Node_Str";
  if (start != null) {
    whereCQL+="String_Node_Str" + i.getShardingStrategy().getShardKey(start);
  }
  if (end != null) {
    whereCQL+="String_Node_Str" + i.getShardingStrategy().getShardKey(end);
  }
  return String.format(TEMPLATE_SELECT_WIDE_INDEX,CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def,i),indexValueString,whereCQL,ordering);
}
Program: 17480
Project: 17480
Buggy source:
protected static String makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,long timestamp){
  return String.format(TEMPLATE_DELETE,makeTableName(def.getName(),null),timestamp,"String_Node_Str" + uuid.toString());
}

Fixed version (ground truth):
protected static String makeCQLforDeleteUUIDFromStaticTable(CDefinition def,UUID uuid,long timestamp){
  return String.format(TEMPLATE_DELETE,makeTableName(def,null),timestamp,"String_Node_Str" + uuid.toString());
}
Program: 17481
Project: 17481
Buggy source:
protected static String makeWideTableCreate(CDefinition def,CIndex index){
  return String.format(TEMPLATE_CREATE_WIDE,def.getName() + "String_Node_Str" + index.getName(),makeFieldList(def.getFields().values(),true),makeCommaList(index.getCompositeKeyList()));
}

Fixed version (ground truth):
protected static String makeWideTableCreate(CDefinition def,CIndex index){
  return String.format(TEMPLATE_CREATE_WIDE,makeTableName(def,index),makeFieldList(def.getFields().values(),true),makeCommaList(index.getCompositeKeyList()));
}
Program: 17482
Project: 17482
Buggy source:
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid) + "String_Node_Str",makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def.getName(),index.getName()),timestamp,whereCQL);
}

Fixed version (ground truth):
protected static String makeCQLforDeleteUUIDFromIndex(CDefinition def,CIndex index,UUID uuid,Map<String,String> indexValues,long timestamp){
  String whereCQL=String.format("String_Node_Str",uuid.toString(),index.getShardingStrategy().getShardKey(uuid) + "String_Node_Str",makeAndedEqualList(def,indexValues));
  return String.format(TEMPLATE_DELETE,makeTableName(def,index),timestamp,whereCQL);
}
Program: 17483
Project: 17483
Buggy source:
protected static String makeTableName(String objName,@Nullable String indexName){
  if (indexName == null) {
    return objName;
  }
 else {
    return objName + "String_Node_Str" + indexName;
  }
}

Fixed version (ground truth):
protected static String makeTableName(CDefinition def,@Nullable CIndex index){
  String objName=def.getName();
  if (index == null) {
    return objName;
  }
 else {
    String indexName=Joiner.on('_').join(index.getCompositeKeyList());
    return objName + "String_Node_Str" + indexName;
  }
}