nus-yam/ex-repair huggingface dataset:
Program: 168604
Project: 168604
Buggy source:
@TargetApi(Build.VERSION_CODES.HONEYCOMB) private <IdType>IdType persistObjectApi11(Class<?> modelClass,JSONObject jsonObject) throws JSONException {
  try {
    if (!mDatabase.inTransaction()) {
      mDatabase.enableWriteAheadLogging();
    }
    mDatabase.beginTransactionNonExclusive();
    IdType id=persistObjectInternal(modelClass,jsonObject);
    mDatabase.setTransactionSuccessful();
    return id;
  }
  finally {
    if (mDatabase.inTransaction()) {
      mDatabase.endTransaction();
    }
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.HONEYCOMB) private <IdType>IdType persistObjectApi11(Class<?> modelClass,JSONObject jsonObject) throws JSONException {
  try {
    enableWriteAheadLogging();
    mDatabase.beginTransactionNonExclusive();
    IdType id=persistObjectInternal(modelClass,jsonObject);
    mDatabase.setTransactionSuccessful();
    return id;
  }
  finally {
    endTransaction();
  }
}
Program: 168605
Project: 168605
Buggy source:
/** 
 * Recursively persist the array and all its object's children.
 * @throws JSONException when something went wrong through parsing, this also fails the database transaction and results in no data changes
 */
public <IdType>List<IdType> persistArrayDeprecate(Class<?> modelClass,JSONArray jsonArray) throws JSONException {
  try {
    mDatabase.beginTransaction();
    List<IdType> id_list=persistArrayOfObjects(modelClass,jsonArray);
    mDatabase.setTransactionSuccessful();
    return id_list;
  }
 catch (  JSONException e) {
    throw e;
  }
 finally {
    if (mDatabase.inTransaction()) {
      mDatabase.endTransaction();
    }
  }
}

Fixed version (ground truth):
/** 
 * Recursively persist the array and all its object's children.
 * @throws JSONException when something went wrong through parsing, this also fails the database transaction and results in no data changes
 */
public <IdType>List<IdType> persistArrayDeprecate(Class<?> modelClass,JSONArray jsonArray) throws JSONException {
  try {
    mDatabase.beginTransaction();
    List<IdType> id_list=persistArrayOfObjects(modelClass,jsonArray);
    mDatabase.setTransactionSuccessful();
    return id_list;
  }
 catch (  JSONException e) {
    throw e;
  }
 finally {
    endTransaction();
  }
}
Program: 168606
Project: 168606
Buggy source:
protected void handleFailure(final Context context,@Nullable final Callback<HttpResponse> callback,final Throwable throwable){
  if (sLogger.isDebugEnabled()) {
    String error_message=throwable != null ? throwable.getMessage() : "String_Node_Str";
    sLogger.warn(String.format("String_Node_Str",mHttpRequest.getMethod(),mHttpRequest.getRequestLine().getUri().toString(),error_message));
  }
  if (callback != null) {
    callback.onFailure(throwable);
  }
  broadcast(context,Broadcasts.ACTION_FAILURE,throwable);
}

Fixed version (ground truth):
protected void handleFailure(final Context context,@Nullable final Callback<HttpResponse> callback,final Throwable throwable){
  if (sLogger.isDebugEnabled()) {
    String error_message=throwable != null ? throwable.getMessage() : "String_Node_Str";
    sLogger.warn(String.format("String_Node_Str",mHttpRequest.getMethod(),mHttpRequest.getRequestLine().getUri().toString(),error_message));
  }
  if (callback != null) {
    callback.onFailure(throwable);
  }
  broadcast(context,Broadcasts.ACTION_FAILURE);
}
Program: 168607
Project: 168607
Buggy source:
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int targetViewWidth=right - left;
  int targetViewHeight=bottom - top;
  if (targetViewWidth > 0 && targetViewHeight > 0) {
    mTargetView.removeOnLayoutChangeListener(mTargetViewOnLayoutChangeListener);
    ViewGroup.LayoutParams containerParams=mContainer.getLayoutParams();
    containerParams.width=targetViewWidth;
    containerParams.height=targetViewHeight;
    mContainer.setLayoutParams(containerParams);
  }
 else {
    targetViewWidth=mContainer.getMeasuredWidth();
    targetViewHeight=mContainer.getMeasuredHeight();
    ViewGroup.LayoutParams targetParams=mTargetView.getLayoutParams();
    targetParams.width=targetViewWidth;
    targetParams.height=targetViewHeight;
    mTargetView.setLayoutParams(targetParams);
  }
  ViewGroup.MarginLayoutParams params=(ViewGroup.MarginLayoutParams)getLayoutParams();
  int diameter=Math.max(targetViewWidth,targetViewHeight);
  int delta=-5 * diameter / 100;
  params.width=diameter + delta;
  params.height=diameter + delta;
  int diff=Math.abs(targetViewWidth - targetViewHeight) + delta;
  if (targetViewWidth < targetViewHeight) {
    params.leftMargin=-diff / 2;
    params.topMargin=-delta / 2;
  }
 else   if (targetViewHeight < targetViewWidth) {
    params.leftMargin=-delta / 2;
    params.topMargin=-diff / 2;
  }
  setLayoutParams(params);
}

Fixed version (ground truth):
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int targetViewWidth=right - left;
  int targetViewHeight=bottom - top;
  if (targetViewWidth > 0 && targetViewHeight > 0) {
    mTargetView.removeOnLayoutChangeListener(mTargetViewOnLayoutChangeListener);
    ViewGroup.LayoutParams containerParams=mContainer.getLayoutParams();
    containerParams.width=targetViewWidth;
    containerParams.height=targetViewHeight;
    mContainer.setLayoutParams(containerParams);
  }
 else {
    if (mContainer.getMeasuredWidth() > 0 && mContainer.getMeasuredHeight() > 0) {
      targetViewWidth=mContainer.getMeasuredWidth();
      targetViewHeight=mContainer.getMeasuredHeight();
      ViewGroup.LayoutParams targetParams=mTargetView.getLayoutParams();
      targetParams.width=targetViewWidth;
      targetParams.height=targetViewHeight;
      mTargetView.setLayoutParams(targetParams);
    }
  }
  ViewGroup.MarginLayoutParams params=(ViewGroup.MarginLayoutParams)getLayoutParams();
  int diameter=Math.max(targetViewWidth,targetViewHeight);
  int delta=-5 * diameter / 100;
  params.width=diameter + delta;
  params.height=diameter + delta;
  int diff=Math.abs(targetViewWidth - targetViewHeight) + delta;
  if (targetViewWidth < targetViewHeight) {
    params.leftMargin=-diff / 2;
    params.topMargin=-delta / 2;
  }
 else   if (targetViewHeight < targetViewWidth) {
    params.leftMargin=-delta / 2;
    params.topMargin=-diff / 2;
  }
  setLayoutParams(params);
}
Program: 168608
Project: 168608
Buggy source:
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,this.dbHint,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168609
Project: 168609
Buggy source:
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,this.dbHint,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168610
Project: 168610
Buggy source:
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,namePart,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"));
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  DimensionQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}

Fixed version (ground truth):
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"),namePart);
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}
Program: 168612
Project: 168612
Buggy source:
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),offsetPart,limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON,0),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168613
Project: 168613
Buggy source:
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"),namePart);
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}

Fixed version (ground truth):
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,namePart,MetricQueries.buildDimensionAndClause(dimensions,"String_Node_Str",0));
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}
Program: 168614
Project: 168614
Buggy source:
private List<Map<String,Object>> executeMetricDefsQuery(String tenantId,String name,Map<String,String> dimensions,DateTime startTime,DateTime endTime,String offset,int limit){
  String namePart="String_Node_Str";
  if (name != null && !name.isEmpty()) {
    namePart="String_Node_Str";
  }
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  try (Handle h=db.open()){
    String timeInClause=createTimeInClause(h,startTime,endTime,tenantId,name,dimensions);
    String defSubSelect=String.format(METRIC_DEFINITIONS_SUB_SELECT,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),namePart,offsetPart,timeInClause,limitPart);
    String sql=String.format(FIND_METRIC_DEFS_SQL,defSubSelect);
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (name != null && !name.isEmpty()) {
      logger.debug("String_Node_Str",name);
      query.bind("String_Node_Str",name);
    }
    if (startTime != null) {
      query.bind("String_Node_Str",startTime);
    }
    if (endTime != null) {
      query.bind("String_Node_Str",endTime);
    }
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricDefsQuery(String tenantId,String name,Map<String,String> dimensions,DateTime startTime,DateTime endTime,String offset,int limit){
  String namePart="String_Node_Str";
  if (name != null && !name.isEmpty()) {
    namePart="String_Node_Str";
  }
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  try (Handle h=db.open()){
    String timeInClause=createTimeInClause(h,startTime,endTime,tenantId,name,dimensions);
    String sql=String.format(FIND_METRIC_DEFS_SQL,namePart,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,"String_Node_Str",limit),timeInClause);
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (name != null && !name.isEmpty()) {
      logger.debug("String_Node_Str",name);
      query.bind("String_Node_Str",name);
    }
    if (startTime != null) {
      query.bind("String_Node_Str",startTime);
    }
    if (endTime != null) {
      query.bind("String_Node_Str",endTime);
    }
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168615
Project: 168615
Buggy source:
private Map<byte[],Statistics> findDefIds(Handle h,String tenantId,String name,Map<String,String> dimensions){
  List<byte[]> bytes=new ArrayList<>();
  StringBuilder sb=new StringBuilder();
  if (name != null && !name.isEmpty()) {
    sb.append("String_Node_Str");
  }
  String sql=String.format(FIND_BY_METRIC_DEF_SQL,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),sb);
  Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
  if (name != null && !name.isEmpty()) {
    logger.debug("String_Node_Str",name);
    query.bind("String_Node_Str",name);
  }
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  List<Map<String,Object>> rows=query.list();
  Map<byte[],Statistics> byteIdMap=new HashMap<>();
  byte[] currentDefDimId=null;
  Map<String,String> dims=null;
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    String defName=(String)row.get("String_Node_Str");
    String dimName=(String)row.get("String_Node_Str");
    String dimValue=(String)row.get("String_Node_Str");
    if (defDimId == null || !Arrays.equals(currentDefDimId,defDimId)) {
      currentDefDimId=defDimId;
      dims=new HashMap<>();
      dims.put(dimName,dimValue);
      Statistics statistics=new Statistics();
      statistics.setName(defName);
      statistics.setDimensions(dims);
      byteIdMap.put(currentDefDimId,statistics);
    }
 else {
      dims.put(dimName,dimValue);
    }
  }
  bytes.add(currentDefDimId);
  return byteIdMap;
}

Fixed version (ground truth):
private Map<byte[],Statistics> findDefIds(Handle h,String tenantId,String name,Map<String,String> dimensions){
  List<byte[]> bytes=new ArrayList<>();
  StringBuilder sb=new StringBuilder();
  if (name != null && !name.isEmpty()) {
    sb.append("String_Node_Str");
  }
  String sql=String.format(FIND_BY_METRIC_DEF_SQL,sb,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON,0));
  Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
  if (name != null && !name.isEmpty()) {
    logger.debug("String_Node_Str",name);
    query.bind("String_Node_Str",name);
  }
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  List<Map<String,Object>> rows=query.list();
  Map<byte[],Statistics> byteIdMap=new HashMap<>();
  byte[] currentDefDimId=null;
  Map<String,String> dims=null;
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    String defName=(String)row.get("String_Node_Str");
    String dimName=(String)row.get("String_Node_Str");
    String dimValue=(String)row.get("String_Node_Str");
    if (defDimId == null || !Arrays.equals(currentDefDimId,defDimId)) {
      currentDefDimId=defDimId;
      dims=new HashMap<>();
      dims.put(dimName,dimValue);
      Statistics statistics=new Statistics();
      statistics.setName(defName);
      statistics.setDimensions(dims);
      byteIdMap.put(currentDefDimId,statistics);
    }
 else {
      dims.put(dimName,dimValue);
    }
  }
  bytes.add(currentDefDimId);
  return byteIdMap;
}
Program: 168617
Project: 168617
Buggy source:
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),offsetPart,limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricNamesQuery(String tenantId,Map<String,String> dimensions,String offset,int limit){
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  String defSubSelect=String.format(METRIC_NAMES_SUB_SELECT,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON,0),limitPart);
  String sql=String.format(FIND_METRIC_NAMES_SQL,defSubSelect);
  try (Handle h=db.open()){
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168618
Project: 168618
Buggy source:
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"),namePart);
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}

Fixed version (ground truth):
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,namePart,MetricQueries.buildDimensionAndClause(dimensions,"String_Node_Str",0));
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}
Program: 168619
Project: 168619
Buggy source:
private List<Map<String,Object>> executeMetricDefsQuery(String tenantId,String name,Map<String,String> dimensions,DateTime startTime,DateTime endTime,String offset,int limit){
  String namePart="String_Node_Str";
  if (name != null && !name.isEmpty()) {
    namePart="String_Node_Str";
  }
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  String limitPart="String_Node_Str" + Integer.toString(limit + 1);
  try (Handle h=db.open()){
    String timeInClause=createTimeInClause(h,startTime,endTime,tenantId,name,dimensions);
    String defSubSelect=String.format(METRIC_DEFINITIONS_SUB_SELECT,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),namePart,offsetPart,timeInClause,limitPart);
    String sql=String.format(FIND_METRIC_DEFS_SQL,defSubSelect);
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (name != null && !name.isEmpty()) {
      logger.debug("String_Node_Str",name);
      query.bind("String_Node_Str",name);
    }
    if (startTime != null) {
      query.bind("String_Node_Str",startTime);
    }
    if (endTime != null) {
      query.bind("String_Node_Str",endTime);
    }
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }

Fixed version (ground truth):
private List<Map<String,Object>> executeMetricDefsQuery(String tenantId,String name,Map<String,String> dimensions,DateTime startTime,DateTime endTime,String offset,int limit){
  String namePart="String_Node_Str";
  if (name != null && !name.isEmpty()) {
    namePart="String_Node_Str";
  }
  String offsetPart="String_Node_Str";
  if (offset != null && !offset.isEmpty()) {
    offsetPart="String_Node_Str";
  }
  try (Handle h=db.open()){
    String timeInClause=createTimeInClause(h,startTime,endTime,tenantId,name,dimensions);
    String sql=String.format(FIND_METRIC_DEFS_SQL,namePart,offsetPart,MetricQueries.buildDimensionAndClause(dimensions,"String_Node_Str",limit),timeInClause);
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    if (name != null && !name.isEmpty()) {
      logger.debug("String_Node_Str",name);
      query.bind("String_Node_Str",name);
    }
    if (startTime != null) {
      query.bind("String_Node_Str",startTime);
    }
    if (endTime != null) {
      query.bind("String_Node_Str",endTime);
    }
    if (offset != null && !offset.isEmpty()) {
      logger.debug("String_Node_Str",offset);
      try {
        query.bind("String_Node_Str",Hex.decodeHex(offset.toCharArray()));
      }
 catch (      DecoderException e) {
        throw Exceptions.badRequest("String_Node_Str" + offset,e);
      }
    }
    MetricQueries.bindDimensionsToQuery(query,dimensions);
    return query.list();
  }
 }
Program: 168620
Project: 168620
Buggy source:
private Map<byte[],Statistics> findDefIds(Handle h,String tenantId,String name,Map<String,String> dimensions){
  List<byte[]> bytes=new ArrayList<>();
  StringBuilder sb=new StringBuilder();
  if (name != null && !name.isEmpty()) {
    sb.append("String_Node_Str");
  }
  String sql=String.format(FIND_BY_METRIC_DEF_SQL,MetricQueries.buildJoinClauseFor(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON),sb);
  Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
  if (name != null && !name.isEmpty()) {
    logger.debug("String_Node_Str",name);
    query.bind("String_Node_Str",name);
  }
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  List<Map<String,Object>> rows=query.list();
  Map<byte[],Statistics> byteIdMap=new HashMap<>();
  byte[] currentDefDimId=null;
  Map<String,String> dims=null;
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    String defName=(String)row.get("String_Node_Str");
    String dimName=(String)row.get("String_Node_Str");
    String dimValue=(String)row.get("String_Node_Str");
    if (defDimId == null || !Arrays.equals(currentDefDimId,defDimId)) {
      currentDefDimId=defDimId;
      dims=new HashMap<>();
      dims.put(dimName,dimValue);
      Statistics statistics=new Statistics();
      statistics.setName(defName);
      statistics.setDimensions(dims);
      byteIdMap.put(currentDefDimId,statistics);
    }
 else {
      dims.put(dimName,dimValue);
    }
  }
  bytes.add(currentDefDimId);
  return byteIdMap;
}

Fixed version (ground truth):
private Map<byte[],Statistics> findDefIds(Handle h,String tenantId,String name,Map<String,String> dimensions){
  List<byte[]> bytes=new ArrayList<>();
  StringBuilder sb=new StringBuilder();
  if (name != null && !name.isEmpty()) {
    sb.append("String_Node_Str");
  }
  String sql=String.format(FIND_BY_METRIC_DEF_SQL,sb,MetricQueries.buildDimensionAndClause(dimensions,TABLE_TO_JOIN_DIMENSIONS_ON,0));
  Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
  if (name != null && !name.isEmpty()) {
    logger.debug("String_Node_Str",name);
    query.bind("String_Node_Str",name);
  }
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  List<Map<String,Object>> rows=query.list();
  Map<byte[],Statistics> byteIdMap=new HashMap<>();
  byte[] currentDefDimId=null;
  Map<String,String> dims=null;
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    String defName=(String)row.get("String_Node_Str");
    String dimName=(String)row.get("String_Node_Str");
    String dimValue=(String)row.get("String_Node_Str");
    if (defDimId == null || !Arrays.equals(currentDefDimId,defDimId)) {
      currentDefDimId=defDimId;
      dims=new HashMap<>();
      dims.put(dimName,dimValue);
      Statistics statistics=new Statistics();
      statistics.setName(defName);
      statistics.setDimensions(dims);
      byteIdMap.put(currentDefDimId,statistics);
    }
 else {
      dims.put(dimName,dimValue);
    }
  }
  bytes.add(currentDefDimId);
  return byteIdMap;
}
Program: 168621
Project: 168621
Buggy source:
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,namePart,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"));
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  DimensionQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}

Fixed version (ground truth):
private String createTimeInClause(Handle dbHandle,DateTime startTime,DateTime endTime,String tenantId,String metricName,Map<String,String> dimensions){
  if (startTime == null) {
    return "String_Node_Str";
  }
  Set<byte[]> defDimIdSet=new HashSet<>();
  String namePart="String_Node_Str";
  if (metricName != null && !metricName.isEmpty()) {
    namePart="String_Node_Str";
  }
  String defDimSql=String.format(DEFDIM_IDS_SELECT,MetricQueries.buildJoinClauseFor(dimensions,"String_Node_Str"),namePart);
  Query<Map<String,Object>> query=dbHandle.createQuery(defDimSql).bind("String_Node_Str",tenantId);
  MetricQueries.bindDimensionsToQuery(query,dimensions);
  if (metricName != null && !metricName.isEmpty()) {
    query.bind("String_Node_Str",metricName);
  }
  List<Map<String,Object>> rows=query.list();
  for (  Map<String,Object> row : rows) {
    byte[] defDimId=(byte[])row.get("String_Node_Str");
    defDimIdSet.add(defDimId);
  }
  if (defDimIdSet.size() == 0) {
    return "String_Node_Str";
  }
  String timeAndClause="String_Node_Str";
  if (endTime != null) {
    timeAndClause="String_Node_Str";
  }
 else {
    timeAndClause="String_Node_Str";
  }
  String defDimInClause=MetricQueries.createDefDimIdInClause(defDimIdSet);
  return String.format(MEASUREMENT_AND_CLAUSE,defDimInClause,timeAndClause);
}
Program: 168623
Project: 168623
Buggy source:
public List<String> findAlarmIds(String tenantId,Map<String,String> dimensions){
  final String FIND_ALARM_IDS_SQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<String> alarmIdList;
  try (Handle h=this.mysql.open()){
    final String sql=String.format(FIND_ALARM_IDS_SQL,this.buildJoinClauseFor(dimensions));
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    logger.debug("String_Node_Str",sql);
    DimensionQueries.bindDimensionsToQuery(query,dimensions);
    alarmIdList=query.map(StringMapper.FIRST).list();
  }
   return alarmIdList;
}

Fixed version (ground truth):
public List<String> findAlarmIds(String tenantId,Map<String,String> dimensions){
  final String FIND_ALARM_IDS_SQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<String> alarmIdList;
  try (Handle h=this.mysql.open()){
    final String sql=String.format(FIND_ALARM_IDS_SQL,this.buildJoinClauseFor(dimensions));
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    logger.debug("String_Node_Str",sql);
    this.bindDimensionsToQuery(query,dimensions);
    alarmIdList=query.map(StringMapper.FIRST).list();
  }
   return alarmIdList;
}
Program: 168626
Project: 168626
Buggy source:
public List<String> findAlarmIds(String tenantId,Map<String,String> dimensions){
  final String FIND_ALARM_IDS_SQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<String> alarmIdList;
  try (Handle h=this.mysql.open()){
    final String sql=String.format(FIND_ALARM_IDS_SQL,this.buildJoinClauseFor(dimensions));
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    logger.debug("String_Node_Str",sql);
    DimensionQueries.bindDimensionsToQuery(query,dimensions);
    alarmIdList=query.map(StringMapper.FIRST).list();
  }
   return alarmIdList;
}

Fixed version (ground truth):
public List<String> findAlarmIds(String tenantId,Map<String,String> dimensions){
  final String FIND_ALARM_IDS_SQL="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<String> alarmIdList;
  try (Handle h=this.mysql.open()){
    final String sql=String.format(FIND_ALARM_IDS_SQL,this.buildJoinClauseFor(dimensions));
    Query<Map<String,Object>> query=h.createQuery(sql).bind("String_Node_Str",tenantId);
    logger.debug("String_Node_Str",sql);
    this.bindDimensionsToQuery(query,dimensions);
    alarmIdList=query.map(StringMapper.FIRST).list();
  }
   return alarmIdList;
}
Program: 168627
Project: 168627
Buggy source:
public CreateMetricCommand(String name,@Nullable Map<String,String> dimensions,@Nullable Long timestamp,double value,@Nullable Map<String,String> valueMeta){
  setName(name);
  setDimensions(dimensions);
  setTimestamp(timestamp);
  setValueMeta(valueMeta);
  this.value=value;
}

Fixed version (ground truth):
public CreateMetricCommand(String name,@Nullable Map<String,String> dimensions,long timestamp,double value,@Nullable Map<String,String> valueMeta){
  setName(name);
  setDimensions(dimensions);
  this.timestamp=timestamp;
  setValueMeta(valueMeta);
  this.value=value;
}
Program: 168628
Project: 168628
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + (int)(timestamp ^ (timestamp >>> 32));
  long temp;
  temp=(value == null) ? 0 : Double.doubleToLongBits(value);
  result=prime * result + (int)(temp ^ (temp >>> 32));
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + ((timestamp == null) ? 0 : (int)(timestamp ^ (timestamp >>> 32)));
  long temp;
  temp=(value == null) ? 0 : Double.doubleToLongBits(value);
  result=prime * result + (int)(temp ^ (temp >>> 32));
  return result;
}
Program: 168629
Project: 168629
Buggy source:
@Override public Response toResponse(JsonMappingException exception){
  return Response.status(FaultType.BAD_REQUEST.statusCode).type(MediaType.APPLICATION_JSON).entity(Exceptions.buildLoggedErrorMessage(FaultType.BAD_REQUEST,"String_Node_Str",Exceptions.stripLocationFromStacktrace(exception.getMessage()),null)).build();
}

Fixed version (ground truth):
@Override public Response toResponse(JsonMappingException exception){
  return Response.status(FaultType.UNPROCESSABLE_ENTITY.statusCode).type(MediaType.APPLICATION_JSON).entity(Exceptions.buildLoggedErrorMessage(FaultType.UNPROCESSABLE_ENTITY,"String_Node_Str",Exceptions.stripLocationFromStacktrace(exception.getMessage()),null)).build();
}
Program: 168630
Project: 168630
Buggy source:
@SuppressWarnings("String_Node_Str") public void shouldCreateSet() throws Exception {
  String json=jsonFixture("String_Node_Str");
  CreateMetricCommand[] metrics=fromJson(json,CreateMetricCommand[].class);
  ClientResponse response=createResponseFor(metrics);
  assertEquals(response.getStatus(),204);
  verify(service).create(any(List.class),eq("String_Node_Str"),anyString());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void shouldCreateSet() throws Exception {
  String json=jsonFixture("String_Node_Str");
  CreateMetricCommand[] metrics=fromJson(json,CreateMetricCommand[].class);
  metrics[0].timestamp=timestamp;
  metrics[1].timestamp=timestamp;
  ClientResponse response=createResponseFor(metrics);
  assertEquals(response.getStatus(),204);
  verify(service).create(any(List.class),eq("String_Node_Str"),anyString());
}
Program: 168631
Project: 168631
Buggy source:
public void shouldErrorOnCreateWithoutName() throws Exception {
  String json=jsonFixture("String_Node_Str");
  ClientResponse response=createResponseFor(json);
  ErrorMessages.assertThat(response.getEntity(String.class)).matches("String_Node_Str",422,"String_Node_Str");
}

Fixed version (ground truth):
public void shouldErrorOnCreateWithoutName() throws Exception {
  String json=jsonFixture("String_Node_Str");
  CreateMetricCommand metric=fromJson(json,CreateMetricCommand.class);
  metric.timestamp=timestamp;
  ClientResponse response=createResponseFor(metric);
  ErrorMessages.assertThat(response.getEntity(String.class)).matches("String_Node_Str",422,"String_Node_Str");
}
Program: 168632
Project: 168632
Buggy source:
public CreateMetricCommand(String name,@Nullable Map<String,String> dimensions,@Nullable Long timestamp,double value,@Nullable Map<String,String> valueMeta){
  setName(name);
  setDimensions(dimensions);
  setTimestamp(timestamp);
  setValueMeta(valueMeta);
  this.value=value;
}

Fixed version (ground truth):
public CreateMetricCommand(String name,@Nullable Map<String,String> dimensions,long timestamp,double value,@Nullable Map<String,String> valueMeta){
  setName(name);
  setDimensions(dimensions);
  this.timestamp=timestamp;
  setValueMeta(valueMeta);
  this.value=value;
}
Program: 168633
Project: 168633
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + (int)(timestamp ^ (timestamp >>> 32));
  long temp;
  temp=(value == null) ? 0 : Double.doubleToLongBits(value);
  result=prime * result + (int)(temp ^ (temp >>> 32));
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + ((timestamp == null) ? 0 : (int)(timestamp ^ (timestamp >>> 32)));
  long temp;
  temp=(value == null) ? 0 : Double.doubleToLongBits(value);
  result=prime * result + (int)(temp ^ (temp >>> 32));
  return result;
}
Program: 168634
Project: 168634
Buggy source:
@Override public Response toResponse(JsonMappingException exception){
  return Response.status(FaultType.BAD_REQUEST.statusCode).type(MediaType.APPLICATION_JSON).entity(Exceptions.buildLoggedErrorMessage(FaultType.BAD_REQUEST,"String_Node_Str",Exceptions.stripLocationFromStacktrace(exception.getMessage()),null)).build();
}

Fixed version (ground truth):
@Override public Response toResponse(JsonMappingException exception){
  return Response.status(FaultType.UNPROCESSABLE_ENTITY.statusCode).type(MediaType.APPLICATION_JSON).entity(Exceptions.buildLoggedErrorMessage(FaultType.UNPROCESSABLE_ENTITY,"String_Node_Str",Exceptions.stripLocationFromStacktrace(exception.getMessage()),null)).build();
}
Program: 168635
Project: 168635
Buggy source:
@SuppressWarnings("String_Node_Str") public void shouldCreateSet() throws Exception {
  String json=jsonFixture("String_Node_Str");
  CreateMetricCommand[] metrics=fromJson(json,CreateMetricCommand[].class);
  ClientResponse response=createResponseFor(metrics);
  assertEquals(response.getStatus(),204);
  verify(service).create(any(List.class),eq("String_Node_Str"),anyString());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void shouldCreateSet() throws Exception {
  String json=jsonFixture("String_Node_Str");
  CreateMetricCommand[] metrics=fromJson(json,CreateMetricCommand[].class);
  metrics[0].timestamp=timestamp;
  metrics[1].timestamp=timestamp;
  ClientResponse response=createResponseFor(metrics);
  assertEquals(response.getStatus(),204);
  verify(service).create(any(List.class),eq("String_Node_Str"),anyString());
}