nus-yam/ex-repair huggingface dataset:
Program: 63068
Project: 63068
Buggy source:
/** 
 * 对消息进行一系列的处理,包括 拦截、匹配、分发等动作
 * @param context 上下文环境
 * @param request 微信请求
 * @param messageKey 消息的key
 * @throws WeixinException
 */
public void doDispatch(final ChannelHandlerContext context,final WeixinRequest request,final CruxMessageHandler cruxMessage) throws WeixinException {
  MessageKey messageKey=defineMessageKey(cruxMessage.getMsgType(),cruxMessage.getEventType(),cruxMessage.getAccountType());
  Class<?> targetClass=messageMatcher.match(messageKey);
  Object message=request.getOriginalContent();
  if (targetClass != null) {
    message=messageRead(request.getOriginalContent(),targetClass);
  }
  logger.info("String_Node_Str",messageKey,targetClass);
  MessageHandlerExecutor handlerExecutor=getHandlerExecutor(context,request,messageKey,message,cruxMessage.getNodeNames());
  if (handlerExecutor == null || handlerExecutor.getMessageHandler() == null) {
    noHandlerFound(context,request,message);
    return;
  }
  if (!handlerExecutor.applyPreHandle(request,message)) {
    return;
  }
  WeixinException dispatchException=null;
  try {
    WeixinResponse response=handlerExecutor.getMessageHandler().doHandle(request,message,cruxMessage.getNodeNames());
    handlerExecutor.applyPostHandle(request,response,message);
    context.write(response);
  }
 catch (  WeixinException e) {
    dispatchException=e;
  }
  handlerExecutor.triggerAfterCompletion(request,message,dispatchException);
}

Fixed version (ground truth):
/** 
 * 对消息进行一系列的处理,包括 拦截、匹配、分发等动作
 * @param context 上下文环境
 * @param request 微信请求
 * @param cruxMessage 微信的关键消息
 * @throws WeixinException
 */
public void doDispatch(final ChannelHandlerContext context,final WeixinRequest request,final CruxMessageHandler cruxMessage) throws WeixinException {
  MessageKey messageKey=defineMessageKey(cruxMessage.getMsgType(),cruxMessage.getEventType(),cruxMessage.getAccountType());
  Class<?> targetClass=messageMatcher.match(messageKey);
  Object message=request.getOriginalContent();
  if (targetClass != null) {
    message=messageRead(request.getOriginalContent(),targetClass);
  }
  logger.info("String_Node_Str",messageKey,targetClass);
  MessageHandlerExecutor handlerExecutor=getHandlerExecutor(context,request,messageKey,message,cruxMessage.getNodeNames());
  if (handlerExecutor == null || handlerExecutor.getMessageHandler() == null) {
    noHandlerFound(context,request,message);
    return;
  }
  if (!handlerExecutor.applyPreHandle(request,message)) {
    return;
  }
  WeixinException dispatchException=null;
  try {
    WeixinResponse response=handlerExecutor.getMessageHandler().doHandle(request,message,cruxMessage.getNodeNames());
    handlerExecutor.applyPostHandle(request,response,message);
    context.write(response);
  }
 catch (  WeixinException e) {
    dispatchException=e;
  }
  handlerExecutor.triggerAfterCompletion(request,message,dispatchException);
}
Program: 63070
Project: 63070
Buggy source:
/** 
 * 获取所有的handler
 * @return handler集合
 * @see com.foxinmy.weixin4j.handler.WeixinMessageHandler
 * @throws WeixinException
 */
public WeixinMessageHandler[] getMessageHandlers() throws WeixinException {
  if (this.messageHandlers == null) {
    if (messageHandlerPackages != null) {
      List<Class<?>> messageHandlerClass=new LinkedList<Class<?>>();
      for (      String packageName : messageHandlerPackages) {
        messageHandlerClass.addAll(ClassUtil.getClasses(packageName));
      }
      if (beanFactory != null) {
        for (        Class<?> clazz : messageHandlerClass) {
          messageHandlerList.add((WeixinMessageHandler)beanFactory.getBean(clazz));
        }
      }
 else {
        for (        Class<?> clazz : messageHandlerClass) {
          if (clazz.isInterface() || Modifier.isAbstract(clazz.getModifiers())) {
            continue;
          }
          try {
            Constructor<?> ctor=clazz.getDeclaredConstructor();
            ReflectionUtil.makeAccessible(ctor);
            messageHandlerList.add((WeixinMessageHandler)ctor.newInstance((Object[])null));
          }
 catch (          Exception ex) {
            throw new WeixinException(clazz.getName() + "String_Node_Str",ex);
          }
        }
      }
    }
    if (messageHandlerList != null && !this.messageHandlerList.isEmpty()) {
      this.messageHandlers=this.messageHandlerList.toArray(new WeixinMessageHandler[this.messageHandlerList.size()]);
    }
  }
  return this.messageHandlers;
}

Fixed version (ground truth):
/** 
 * 获取所有的handler
 * @return handler集合
 * @see com.foxinmy.weixin4j.handler.WeixinMessageHandler
 * @throws WeixinException
 */
public WeixinMessageHandler[] getMessageHandlers() throws WeixinException {
  if (this.messageHandlers == null) {
    if (messageHandlerPackages != null) {
      List<Class<?>> messageHandlerClass=new LinkedList<Class<?>>();
      for (      String packageName : messageHandlerPackages) {
        messageHandlerClass.addAll(ClassUtil.getClasses(packageName));
      }
      if (beanFactory != null) {
        for (        Class<?> clazz : messageHandlerClass) {
          messageHandlerList.add(0,(WeixinMessageHandler)beanFactory.getBean(clazz));
        }
      }
 else {
        for (        Class<?> clazz : messageHandlerClass) {
          if (clazz.isInterface() || Modifier.isAbstract(clazz.getModifiers())) {
            continue;
          }
          try {
            Constructor<?> ctor=clazz.getDeclaredConstructor();
            ReflectionUtil.makeAccessible(ctor);
            messageHandlerList.add(0,(WeixinMessageHandler)ctor.newInstance((Object[])null));
          }
 catch (          Exception ex) {
            throw new WeixinException(clazz.getName() + "String_Node_Str",ex);
          }
        }
      }
    }
    if (messageHandlerList != null && !this.messageHandlerList.isEmpty()) {
      this.messageHandlers=this.messageHandlerList.toArray(new WeixinMessageHandler[this.messageHandlerList.size()]);
    }
  }
  return this.messageHandlers;
}
Program: 63071
Project: 63071
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + encryptContent + "String_Node_Str"+ encryptType+ "String_Node_Str"+ echoStr+ "String_Node_Str"+ timeStamp+ "String_Node_Str"+ nonce+ "String_Node_Str"+ signature+ "String_Node_Str"+ originalContent+ "String_Node_Str"+ method+ "String_Node_Str"+ aesToken+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + encryptContent + "String_Node_Str"+ encryptType+ "String_Node_Str"+ echoStr+ "String_Node_Str"+ timeStamp+ "String_Node_Str"+ nonce+ "String_Node_Str"+ signature+ "String_Node_Str"+ originalContent+ "String_Node_Str"+ method+ "String_Node_Str"+ aesToken+ "String_Node_Str"+ parameters+ "String_Node_Str";
}
Program: 63072
Project: 63072
Buggy source:
public WeixinRequest(String method,EncryptType encryptType,String echoStr,String timeStamp,String nonce,String signature,String msgSignature,String originalContent,String encryptContent,AesToken aesToken){
  this.method=method;
  this.encryptType=encryptType;
  this.echoStr=echoStr;
  this.timeStamp=timeStamp;
  this.nonce=nonce;
  this.signature=signature;
  this.msgSignature=msgSignature;
  this.originalContent=originalContent;
  this.encryptContent=encryptContent;
  this.aesToken=aesToken;
}

Fixed version (ground truth):
public WeixinRequest(String method,EncryptType encryptType,String echoStr,String timeStamp,String nonce,String signature,String msgSignature,String originalContent,String encryptContent,AesToken aesToken,Map<String,List<String>> parameters){
  this.method=method;
  this.encryptType=encryptType;
  this.echoStr=echoStr;
  this.timeStamp=timeStamp;
  this.nonce=nonce;
  this.signature=signature;
  this.msgSignature=msgSignature;
  this.originalContent=originalContent;
  this.encryptContent=encryptContent;
  this.aesToken=aesToken;
  this.parameters=parameters;
}
Program: 63075
Project: 63075
Buggy source:
public void setEntity(HttpEntity httpEntity){
  this.entity=httpEntity;
}

Fixed version (ground truth):
@Override public void setEntity(HttpEntity entity){
  this.entity=entity;
}
Program: 63076
Project: 63076
Buggy source:
private void checkXml(Response response) throws WeixinException {
  response.setXmlResult(true);
  XmlResult xmlResult=null;
  try {
    xmlResult=response.getAsXmlResult();
  }
 catch (  CannotResolveClassException ex) {
    String newXml=response.getAsString().replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
    response.setText(newXml);
    xmlResult=response.getAsXmlResult();
  }
  if (xmlResult.getReturnCode().equals("String_Node_Str")) {
    return;
  }
  if (!xmlResult.getReturnCode().equalsIgnoreCase(com.foxinmy.weixin4j.model.Consts.SUCCESS)) {
    throw new WeixinException(xmlResult.getReturnCode(),xmlResult.getReturnMsg());
  }
  if (!xmlResult.getResultCode().equalsIgnoreCase(com.foxinmy.weixin4j.model.Consts.SUCCESS)) {
    throw new WeixinException(xmlResult.getErrCode(),xmlResult.getErrCodeDes());
  }
}

Fixed version (ground truth):
private void checkXml(Response response) throws WeixinException {
  XmlResult xmlResult=null;
  try {
    xmlResult=response.getAsXmlResult();
  }
 catch (  CannotResolveClassException ex) {
    String newXml=response.getAsString().replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
    response.setText(newXml);
    xmlResult=response.getAsXmlResult();
  }
  response.setXmlResult(true);
  if (xmlResult.getReturnCode().equals("String_Node_Str")) {
    return;
  }
  if (!xmlResult.getReturnCode().equalsIgnoreCase(com.foxinmy.weixin4j.model.Consts.SUCCESS)) {
    throw new WeixinException(xmlResult.getReturnCode(),xmlResult.getReturnMsg());
  }
  if (!xmlResult.getResultCode().equalsIgnoreCase(com.foxinmy.weixin4j.model.Consts.SUCCESS)) {
    throw new WeixinException(xmlResult.getErrCode(),xmlResult.getErrCodeDes());
  }
}
Program: 63077
Project: 63077
Buggy source:
private void checkJson(Response response) throws WeixinException {
  response.setJsonResult(true);
  JsonResult jsonResult=response.getAsJsonResult();
  if (jsonResult.getCode() != 0) {
    if (StringUtils.isBlank(jsonResult.getDesc())) {
      jsonResult=response.getTextError(jsonResult.getCode());
    }
    throw new WeixinException(Integer.toString(jsonResult.getCode()),jsonResult.getDesc());
  }
}

Fixed version (ground truth):
private void checkJson(Response response) throws WeixinException {
  JsonResult jsonResult=response.getAsJsonResult();
  response.setJsonResult(true);
  if (jsonResult.getCode() != 0) {
    if (StringUtils.isBlank(jsonResult.getDesc())) {
      jsonResult=response.getTextError(jsonResult.getCode());
    }
    throw new WeixinException(Integer.toString(jsonResult.getCode()),jsonResult.getDesc());
  }
}
Program: 63078
Project: 63078
Buggy source:
/** 
 * 创建预支付对象
 * @param payPackage 包含订单信息的对象
 * @see com.foxinmy.weixin4j.mp.payment.v3.PayPackageV3
 * @see com.foxinmy.weixin4j.mp.payment.v3.PrePay
 * @return 预支付对象
 */
public static PrePay createPrePay(PayPackageV3 payPackage){
  PrePay prePay=null;
  String payJsRequestXml=XStream.to(payPackage).replaceAll("String_Node_Str","String_Node_Str");
  HttpRequest request=new HttpRequest();
  try {
    Response response=request.post(Consts.UNIFIEDORDER,payJsRequestXml);
    prePay=response.getAsObject(new TypeReference<PrePay>(){
    }
);
  }
 catch (  WeixinException e) {
    prePay=new PrePay(e.getErrorCode(),e.getErrorMsg());
  }
  return prePay;
}

Fixed version (ground truth):
/** 
 * 创建预支付对象</br> <font color="red">此方法并不包含签名,需要自己传入一个完整并且合法的PayPackage</font>
 * @param payPackage 包含订单信息的对象
 * @see com.foxinmy.weixin4j.mp.payment.v3.PayPackageV3
 * @see com.foxinmy.weixin4j.mp.payment.v3.PrePay
 * @return 预支付对象
 */
public static PrePay createPrePay(PayPackageV3 payPackage) throws PayException {
  if (StringUtils.isBlank(payPackage.getSign())) {
  }
  String payJsRequestXml=XStream.to(payPackage).replaceAll("String_Node_Str","String_Node_Str");
  HttpRequest request=new HttpRequest();
  Response response=null;
  try {
    response=request.post(Consts.UNIFIEDORDER,payJsRequestXml);
    return response.getAsObject(new TypeReference<PrePay>(){
    }
);
  }
 catch (  WeixinException e) {
    throw new PayException(e.getErrorCode(),e.getErrorMsg());
  }
}
Program: 63080
Project: 63080
Buggy source:
/** 
 * 退款查询<br/> 退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款 3 个工作日后重新查询退款状态
 * @param weixinAccount
 * @param idQuery 单号 refund_id、out_refund_no、 out_trade_no 、 transaction_id 四个参数必填一个,优先级为: refund_id>out_refund_no>transaction_id>out_trade_no
 * @return 退款记录
 * @throws WeixinException
 */
public Refund refundQuery(WeixinAccount weixinAccount,IdQuery idQuery) throws WeixinException {
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str",weixinAccount.getAppId());
  map.put("String_Node_Str",weixinAccount.getMchId());
  map.put("String_Node_Str",RandomUtil.generateString(16));
  map.put("String_Node_Str",weixinAccount.getDeviceInfo());
  map.put(idQuery.getType().getName(),idQuery.getId());
  String sign=PayUtil.paysignMd5(map,weixinAccount.getPaySignKey());
  map.put("String_Node_Str",sign);
  String param=map2xml(map);
  String refundquery_uri=getRequestUri("String_Node_Str");
  Response response=request.post(refundquery_uri,param);
  return new RefundConverter().fromXML(response.getAsString());
}

Fixed version (ground truth):
/** 
 * 退款查询<br/> 退款有一定延时,用零钱支付的退款20分钟内到账,银行卡支付的退款 3 个工作日后重新查询退款状态
 * @param weixinAccount 商户信息
 * @param idQuery 单号 refund_id、out_refund_no、 out_trade_no 、 transaction_id 四个参数必填一个,优先级为: refund_id>out_refund_no>transaction_id>out_trade_no
 * @return 退款记录
 * @throws WeixinException
 */
public Refund refundQuery(WeixinAccount weixinAccount,IdQuery idQuery) throws WeixinException {
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str",weixinAccount.getAppId());
  map.put("String_Node_Str",weixinAccount.getMchId());
  map.put("String_Node_Str",RandomUtil.generateString(16));
  map.put("String_Node_Str",weixinAccount.getDeviceInfo());
  map.put(idQuery.getType().getName(),idQuery.getId());
  String sign=PayUtil.paysignMd5(map,weixinAccount.getPaySignKey());
  map.put("String_Node_Str",sign);
  String param=map2xml(map);
  String refundquery_uri=getRequestUri("String_Node_Str");
  Response response=request.post(refundquery_uri,param);
  return new RefundConverter().fromXML(response.getAsString());
}
Program: 63081
Project: 63081
Buggy source:
private void toggleFromMonth(){
  if (mUnit.isInView(mSelected)) {
    mUnit=new Week(mSelected,mToday,mMinDate,mMaxDate);
    mUnit.select(mSelected);
    mActiveMonth=mSelected;
  }
 else {
    mActiveMonth=mUnit.getFrom();
    mUnit=new Week(mUnit.getTootleTo(),mToday,mMinDate,mMaxDate);
  }
  mState=State.WEEK;
}

Fixed version (ground truth):
private void toggleFromMonth(LocalDate date){
  mUnit=new Week(date,mToday,mMinDate,mMaxDate);
  mState=State.WEEK;
}
Program: 63082
Project: 63082
Buggy source:
@Override public void finish(final boolean expanded){
  mCalendarView.post(new Runnable(){
    @Override public void run(){
      mCalendarView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
      mWeeksView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
      for (      AbstractViewHolder view : mViews) {
        view.onFinish(true);
      }
      if (!expanded) {
        mCalendarView.getManager().toggleView();
        mCalendarView.populateLayout();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void finish(final boolean expanded){
  mCalendarView.post(new Runnable(){
    @Override public void run(){
      mCalendarView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
      mWeeksView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
      for (      AbstractViewHolder view : mViews) {
        view.onFinish(true);
      }
      if (!expanded) {
        CalendarManager manager=mCalendarView.getManager();
        if (mFromMonth) {
          manager.toggleView();
        }
 else {
          manager.toggleToWeek(mActiveIndex);
        }
        mCalendarView.populateLayout();
      }
    }
  }
);
}
Program: 63083
Project: 63083
Buggy source:
@Override public void run(){
  mCalendarView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
  mWeeksView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
  for (  AbstractViewHolder view : mViews) {
    view.onFinish(true);
  }
  if (!expanded) {
    mCalendarView.getManager().toggleView();
    mCalendarView.populateLayout();
  }
}

Fixed version (ground truth):
@Override public void run(){
  mCalendarView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
  mWeeksView.getLayoutParams().height=ViewGroup.LayoutParams.WRAP_CONTENT;
  for (  AbstractViewHolder view : mViews) {
    view.onFinish(true);
  }
  if (!expanded) {
    CalendarManager manager=mCalendarView.getManager();
    if (mFromMonth) {
      manager.toggleView();
    }
 else {
      manager.toggleToWeek(mActiveIndex);
    }
    mCalendarView.populateLayout();
  }
}
Program: 63084
Project: 63084
Buggy source:
/** 
 * A lower level API, get byte values from ID, return the number of bytes written. Bypassing the cache layer, this could be significantly slower than getIdFromValue(T value).
 * @throws IllegalArgumentException if ID is not found in dictionary
 */
final public int getValueBytesFromId(int id,byte[] returnValue,int offset){
  if (isNullId(id))   return 0;
 else   return getValueBytesFromIdImpl(id,returnValue,offset);
}

Fixed version (ground truth):
/** 
 * A lower level API, get byte values from ID, return the number of bytes written. Bypassing the cache layer, this could be significantly slower than getIdFromValue(T value).
 * @return size of value bytes, 0 if empty string, -1 if null
 * @throws IllegalArgumentException if ID is not found in dictionary
 */
final public int getValueBytesFromId(int id,byte[] returnValue,int offset){
  if (isNullId(id))   return -1;
 else   return getValueBytesFromIdImpl(id,returnValue,offset);
}
Program: 63085
Project: 63085
Buggy source:
@Test public void testNull(){
  int nullId=dict.getIdFromValue(null);
  assertNull(dict.getValueFromId(nullId));
  int nullId2=dict.getIdFromValueBytes(null,0,0);
  assertEquals(dict.getValueBytesFromId(nullId2,null,0),0);
  assertEquals(nullId,nullId2);
}

Fixed version (ground truth):
@Test public void testNull(){
  int nullId=dict.getIdFromValue(null);
  assertNull(dict.getValueFromId(nullId));
  int nullId2=dict.getIdFromValueBytes(null,0,0);
  assertEquals(dict.getValueBytesFromId(nullId2,null,0),-1);
  assertEquals(nullId,nullId2);
}
Program: 63086
Project: 63086
Buggy source:
private static void testStringDictionary(ArrayList<String> str,ArrayList<String> notFound){
  TrieDictionaryBuilder<String> b=newDictBuilder(str);
  int baseId=new Random().nextInt(100);
  TrieDictionary<String> dict=b.build(baseId);
  TreeSet<String> set=new TreeSet<String>();
  for (  String s : str) {
    set.add(s);
  }
  dict=testSerialize(dict);
  Iterator<String> it=set.iterator();
  int id=baseId;
  for (; it.hasNext(); id++) {
    String value=it.next();
    assertEquals(id,dict.getIdFromValue(value));
    assertEquals(value,dict.getValueFromId(id));
  }
  if (notFound != null) {
    for (    String s : notFound) {
      try {
        dict.getIdFromValue(s);
        fail("String_Node_Str" + s + "String_Node_Str");
      }
 catch (      IllegalArgumentException e) {
      }
    }
  }
  int nullId=dict.getIdFromValue(null);
  assertNull(dict.getValueFromId(nullId));
  int nullId2=dict.getIdFromValueBytes(null,0,0);
  assertEquals(dict.getValueBytesFromId(nullId2,null,0),0);
  assertEquals(nullId,nullId2);
}

Fixed version (ground truth):
private static void testStringDictionary(ArrayList<String> str,ArrayList<String> notFound){
  TrieDictionaryBuilder<String> b=newDictBuilder(str);
  int baseId=new Random().nextInt(100);
  TrieDictionary<String> dict=b.build(baseId);
  TreeSet<String> set=new TreeSet<String>();
  for (  String s : str) {
    set.add(s);
  }
  dict=testSerialize(dict);
  Iterator<String> it=set.iterator();
  int id=baseId;
  for (; it.hasNext(); id++) {
    String value=it.next();
    assertEquals(id,dict.getIdFromValue(value));
    assertEquals(value,dict.getValueFromId(id));
  }
  if (notFound != null) {
    for (    String s : notFound) {
      try {
        dict.getIdFromValue(s);
        fail("String_Node_Str" + s + "String_Node_Str");
      }
 catch (      IllegalArgumentException e) {
      }
    }
  }
  int nullId=dict.getIdFromValue(null);
  assertNull(dict.getValueFromId(nullId));
  int nullId2=dict.getIdFromValueBytes(null,0,0);
  assertEquals(dict.getValueBytesFromId(nullId2,null,0),-1);
  assertEquals(nullId,nullId2);
}
Program: 63088
Project: 63088
Buggy source:
public void setMeasureValue(String fieldName,Object fieldValue){
  String dataType=info.getDataType(fieldName);
  if ("String_Node_Str".equals(dataType) && fieldValue instanceof BigDecimal) {
    fieldValue=((BigDecimal)fieldValue).doubleValue();
  }
 else   if ("String_Node_Str".equals(dataType) && !(fieldValue instanceof Integer)) {
    fieldValue=((Number)fieldValue).intValue();
  }
  setFieldObjectValue(fieldName,fieldValue);
}

Fixed version (ground truth):
public void setMeasureValue(String fieldName,Object fieldValue){
  String dataType=info.getDataType(fieldName);
  if ("String_Node_Str".equals(dataType) && fieldValue instanceof BigDecimal) {
    fieldValue=((BigDecimal)fieldValue).doubleValue();
  }
 else   if ("String_Node_Str".equals(dataType) && !(fieldValue instanceof Integer)) {
    fieldValue=((Number)fieldValue).intValue();
  }
 else   if ("String_Node_Str".equals(dataType) && fieldValue instanceof BigDecimal) {
    fieldValue=((BigDecimal)fieldValue).floatValue();
  }
  setFieldObjectValue(fieldName,fieldValue);
}
Program: 63089
Project: 63089
Buggy source:
public void init(KylinConfig config,Map<String,TableDesc> tables){
  this.errors.clear();
  this.config=config;
  if (this.modelName == null || this.modelName.length() == 0) {
    this.addError("String_Node_Str" + this.getName() + "String_Node_Str");
  }
  this.model=MetadataManager.getInstance(config).getDataModelDesc(this.modelName);
  if (this.model == null) {
    this.addError("String_Node_Str" + modelName + "String_Node_Str");
  }
  for (  DimensionDesc dim : dimensions) {
    dim.init(this,tables);
  }
  sortDimAndMeasure();
  initDimensionColumns(tables);
  initMeasureColumns(tables);
  rowkey.init(this);
  if (hbaseMapping != null) {
    hbaseMapping.init(this);
  }
  initMeasureReferenceToColumnFamily();
  if (null != this.model.getPartitionDesc()) {
    this.model.getPartitionDesc().init(columnMap);
  }
  List<TblColRef> dimCols=listDimensionColumnsExcludingDerived();
  if (rowkey.getRowKeyColumns().length != dimCols.size()) {
    addError("String_Node_Str" + rowkey.getRowKeyColumns().length + "String_Node_Str"+ dimCols.size()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void init(KylinConfig config,Map<String,TableDesc> tables){
  this.errors.clear();
  this.config=config;
  if (this.modelName == null || this.modelName.length() == 0) {
    this.addError("String_Node_Str" + this.getName() + "String_Node_Str");
  }
  this.model=MetadataManager.getInstance(config).getDataModelDesc(this.modelName);
  if (this.model == null) {
    this.addError("String_Node_Str" + modelName + "String_Node_Str");
  }
  for (  DimensionDesc dim : dimensions) {
    dim.init(this,tables);
  }
  sortDimAndMeasure();
  initDimensionColumns(tables);
  initMeasureColumns(tables);
  rowkey.init(this);
  if (hbaseMapping != null) {
    hbaseMapping.init(this);
  }
  initMeasureReferenceToColumnFamily();
  List<TblColRef> dimCols=listDimensionColumnsExcludingDerived();
  if (rowkey.getRowKeyColumns().length != dimCols.size()) {
    addError("String_Node_Str" + rowkey.getRowKeyColumns().length + "String_Node_Str"+ dimCols.size()+ "String_Node_Str");
  }
}
Program: 63090
Project: 63090
Buggy source:
public void init(Map<String,TableDesc> tables){
  initJoinColumns(tables);
}

Fixed version (ground truth):
public void init(Map<String,TableDesc> tables){
  initJoinColumns(tables);
  initPartitionDesc(tables);
}
Program: 63091
Project: 63091
Buggy source:
public void init(Map<String,Map<String,TblColRef>> columnMap){
  if (StringUtils.isNotEmpty(partitionDateColumn)) {
    partitionDateColumn=partitionDateColumn.toUpperCase();
    String[] columns=StringSplitter.split(partitionDateColumn,"String_Node_Str");
    if (null != columns && columns.length == 3) {
      String tableName=columns[0].toUpperCase() + "String_Node_Str" + columns[1].toUpperCase();
      Map<String,TblColRef> cols=columnMap.get(tableName);
      if (cols != null) {
        partitionDateColumnRef=cols.get(columns[2].toUpperCase());
      }
 else {
        throw new IllegalStateException("String_Node_Str" + tableName + "String_Node_Str");
      }
    }
 else {
      throw new IllegalStateException("String_Node_Str" + partitionDateColumn + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void init(Map<String,TableDesc> tables){
  if (StringUtils.isNotEmpty(partitionDateColumn)) {
    partitionDateColumn=partitionDateColumn.toUpperCase();
    String[] columns=StringSplitter.split(partitionDateColumn,"String_Node_Str");
    if (null != columns && columns.length == 3) {
      String tableName=columns[0].toUpperCase() + "String_Node_Str" + columns[1].toUpperCase();
      TableDesc table=tables.get(tableName);
      ColumnDesc col=table.findColumnByName(columns[2]);
      if (col != null) {
        partitionDateColumnRef=new TblColRef(col);
      }
 else {
        throw new IllegalStateException("String_Node_Str" + partitionDateColumn + "String_Node_Str");
      }
    }
 else {
      throw new IllegalStateException("String_Node_Str" + partitionDateColumn + "String_Node_Str");
    }
  }
}
Program: 63092
Project: 63092
Buggy source:
/** 
 * this method is heavily called at coprocessor side, Make sure as little object creation as possible
 */
public void aggregate(MeasureAggregator[] measureAggrs,byte[] row){
  rawTableRecord.setBytes(row,0,row.length);
  for (int metricIndex=0; metricIndex < metricInfos.length; ++metricIndex) {
    MetricInfo metricInfo=metricInfos[metricIndex];
    MeasureAggregator aggregator=measureAggrs[metricIndex];
    FixedLenMeasureCodec measureSerializer=measureSerializers[metricIndex];
    rawTableRecord.getValueBytes(metricInfo.refIndex,byteBuffer);
    if (metricInfo.type == MetricType.Normal) {
      aggregator.aggregate(measureSerializer.read(byteBuffer.get(),byteBuffer.getOffset()));
    }
 else     if (metricInfo.type == MetricType.DistinctCount) {
      HyperLogLogPlusCounter hllc=hllcs[metricIndex];
      if (hllc == null) {
        hllc=new HyperLogLogPlusCounter(metricInfo.presision);
      }
      hllc.clear();
      hllc.add(byteBuffer.get(),byteBuffer.getOffset(),byteBuffer.getLength());
      aggregator.aggregate(hllc);
    }
  }
  for (int i=0; i < metricInfos.length; ++i) {
    if (metricInfos[i].type == MetricType.Count) {
      measureAggrs[i].aggregate(ONE);
    }
  }
}

Fixed version (ground truth):
/** 
 * this method is heavily called at coprocessor side, Make sure as little object creation as possible
 */
public void aggregate(MeasureAggregator[] measureAggrs,byte[] row){
  rawTableRecord.setBytes(row,0,row.length);
  for (int metricIndex=0; metricIndex < metricInfos.length; ++metricIndex) {
    if (metricInfos[metricIndex].type == MetricType.Count) {
      measureAggrs[metricIndex].aggregate(ONE);
      continue;
    }
    if (metricInfos[metricIndex].type == MetricType.DimensionAsMetric) {
      continue;
    }
    MetricInfo metricInfo=metricInfos[metricIndex];
    MeasureAggregator aggregator=measureAggrs[metricIndex];
    FixedLenMeasureCodec measureSerializer=measureSerializers[metricIndex];
    rawTableRecord.getValueBytes(metricInfo.refIndex,byteBuffer);
    if (metricInfo.type == MetricType.Normal) {
      aggregator.aggregate(measureSerializer.read(byteBuffer.get(),byteBuffer.getOffset()));
    }
 else     if (metricInfo.type == MetricType.DistinctCount) {
      HyperLogLogPlusCounter hllc=hllcs[metricIndex];
      if (hllc == null) {
        hllc=new HyperLogLogPlusCounter(metricInfo.presision);
      }
      hllc.clear();
      hllc.add(byteBuffer.get(),byteBuffer.getOffset(),byteBuffer.getLength());
      aggregator.aggregate(hllc);
    }
  }
}
Program: 63093
Project: 63093
Buggy source:
public void overrideCoprocessorLocalJar(String path){
  kylinConfig.setProperty(COPROCESSOR_LOCAL_JAR,path);
}

Fixed version (ground truth):
public void overrideCoprocessorLocalJar(String path){
  System.setProperty(COPROCESSOR_LOCAL_JAR,path);
}
Program: 63094
Project: 63094
Buggy source:
public void overrideKylinJobJarPath(String path){
  kylinConfig.setProperty(KYLIN_JOB_JAR,path);
}

Fixed version (ground truth):
public void overrideKylinJobJarPath(String path){
  System.setProperty(KYLIN_JOB_JAR,path);
}
Program: 63096
Project: 63096
Buggy source:
public JobStepStatusEnum checkStatus(){
  if (null == mrJobID) {
    this.output.append("String_Node_Str");
    return JobStepStatusEnum.WAITING;
  }
  JobStepStatusEnum status=null;
  try {
    final Pair<RMAppState,FinalApplicationStatus> result=new HadoopStatusGetter(yarnUrl,mrJobID).get();
    log.debug("String_Node_Str" + mrJobID + "String_Node_Str"+ result.getLeft()+ "String_Node_Str"+ result.getRight());
    output.append(new SimpleDateFormat("String_Node_Str").format(new Date()) + "String_Node_Str" + mrJobID+ "String_Node_Str"+ result.getLeft()+ "String_Node_Str"+ result.getRight()+ "String_Node_Str");
switch (result.getRight()) {
case SUCCEEDED:
      status=JobStepStatusEnum.FINISHED;
    break;
case FAILED:
  status=JobStepStatusEnum.ERROR;
break;
case KILLED:
status=JobStepStatusEnum.ERROR;
break;
case UNDEFINED:
switch (result.getLeft()) {
case NEW:
case NEW_SAVING:
case SUBMITTED:
case ACCEPTED:
status=JobStepStatusEnum.WAITING;
break;
case RUNNING:
status=JobStepStatusEnum.RUNNING;
break;
case FINAL_SAVING:
case FINISHING:
case FINISHED:
case FAILED:
case KILLING:
case KILLED:
}
break;
}
}
 catch (Exception e) {
output.append("String_Node_Str" + e.getLocalizedMessage() + "String_Node_Str");
status=JobStepStatusEnum.ERROR;
}
return status;
}

Fixed version (ground truth):
public JobStepStatusEnum checkStatus(){
  if (null == mrJobID) {
    this.output.append("String_Node_Str");
    return JobStepStatusEnum.WAITING;
  }
  JobStepStatusEnum status=null;
  try {
    final Pair<RMAppState,FinalApplicationStatus> result=new HadoopStatusGetter(yarnUrl,mrJobID).get();
    logger.debug("String_Node_Str" + mrJobID + "String_Node_Str"+ result.getLeft()+ "String_Node_Str"+ result.getRight());
    output.append(new SimpleDateFormat("String_Node_Str").format(new Date()) + "String_Node_Str" + mrJobID+ "String_Node_Str"+ result.getLeft()+ "String_Node_Str"+ result.getRight()+ "String_Node_Str");
switch (result.getRight()) {
case SUCCEEDED:
      status=JobStepStatusEnum.FINISHED;
    break;
case FAILED:
  status=JobStepStatusEnum.ERROR;
break;
case KILLED:
status=JobStepStatusEnum.ERROR;
break;
case UNDEFINED:
switch (result.getLeft()) {
case NEW:
case NEW_SAVING:
case SUBMITTED:
case ACCEPTED:
status=JobStepStatusEnum.WAITING;
break;
case RUNNING:
status=JobStepStatusEnum.RUNNING;
break;
case FINAL_SAVING:
case FINISHING:
case FINISHED:
case FAILED:
case KILLING:
case KILLED:
}
break;
}
}
 catch (Exception e) {
logger.error("String_Node_Str",e);
output.append("String_Node_Str" + e.getLocalizedMessage() + "String_Node_Str");
status=JobStepStatusEnum.ERROR;
}
return status;
}
Program: 63097
Project: 63097
Buggy source:
private String getOptional(String prop,String dft){
  return kylinConfig.getString(prop,dft);
}

Fixed version (ground truth):
private String getOptional(String prop,String dft){
  final String property=System.getProperty(prop);
  return property != null ? property : kylinConfig.getString(prop,dft);
}
Program: 63098
Project: 63098
Buggy source:
public String getKylinJobJarPath(){
  final String jobJar=getOptional(KYLIN_JOB_JAR);
  if (StringUtils.isNotEmpty(jobJar)) {
    return jobJar;
  }
  String kylinHome=getKylinHome();
  return kylinHome + File.separator + "String_Node_Str"+ File.separator+ JOB_JAR_NAME.replace("String_Node_Str",VERSION);
}

Fixed version (ground truth):
public String getKylinJobJarPath(){
  final String jobJar=getOptional(KYLIN_JOB_JAR);
  if (StringUtils.isNotEmpty(jobJar)) {
    return jobJar;
  }
  return getFileName(getKylinHome(),JOB_JAR_NAME_PATTERN);
}
Program: 63099
Project: 63099
Buggy source:
public String getCoprocessorLocalJar(){
  final String coprocessorJar=getOptional(COPROCESSOR_LOCAL_JAR);
  if (StringUtils.isNotEmpty(coprocessorJar)) {
    return coprocessorJar;
  }
  String kylinHome=getKylinHome();
  return kylinHome + File.separator + "String_Node_Str"+ File.separator+ COPROCESSOR_JAR_NAME.replace("String_Node_Str",VERSION);
}

Fixed version (ground truth):
public String getCoprocessorLocalJar(){
  final String coprocessorJar=getOptional(COPROCESSOR_LOCAL_JAR);
  if (StringUtils.isNotEmpty(coprocessorJar)) {
    return coprocessorJar;
  }
  return getFileName(getKylinHome(),COPROCESSOR_JAR_NAME_PATTERN);
}
Program: 63100
Project: 63100
Buggy source:
public static void staticCreateTestMetadata(String kylinConfigFolder){
  KylinConfig.destoryInstance();
  if (System.getProperty(KylinConfig.KYLIN_CONF) == null && System.getenv(KylinConfig.KYLIN_CONF) == null)   System.setProperty(KylinConfig.KYLIN_CONF,kylinConfigFolder);
}

Fixed version (ground truth):
public static void staticCreateTestMetadata(String kylinConfigFolder){
  KylinConfig.destoryInstance();
  if (System.getProperty(KylinConfig.KYLIN_CONF_HOME) == null && System.getenv(KylinConfig.KYLIN_CONF_HOME) == null)   System.setProperty(KylinConfig.KYLIN_CONF_HOME,kylinConfigFolder);
}
Program: 63101
Project: 63101
Buggy source:
public static void staticCleanupTestMetadata(){
  cleanupCache();
  System.clearProperty(KylinConfig.KYLIN_CONF);
  KylinConfig.destoryInstance();
}

Fixed version (ground truth):
public static void staticCleanupTestMetadata(){
  cleanupCache();
  System.clearProperty(KylinConfig.KYLIN_CONF_HOME);
  KylinConfig.destoryInstance();
}
Program: 63102
Project: 63102
Buggy source:
public static void createTestMetadata(String testDataFolder){
  KylinConfig.destoryInstance();
  String tempTestMetadataUrl="String_Node_Str";
  try {
    FileUtils.deleteDirectory(new File(tempTestMetadataUrl));
    FileUtils.copyDirectory(new File(testDataFolder),new File(tempTestMetadataUrl));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (System.getProperty(KylinConfig.KYLIN_CONF) == null && System.getenv(KylinConfig.KYLIN_CONF) == null)   System.setProperty(KylinConfig.KYLIN_CONF,tempTestMetadataUrl);
  KylinConfig.getInstanceFromEnv().setMetadataUrl(tempTestMetadataUrl);
}

Fixed version (ground truth):
public static void createTestMetadata(String testDataFolder){
  KylinConfig.destoryInstance();
  String tempTestMetadataUrl="String_Node_Str";
  try {
    FileUtils.deleteDirectory(new File(tempTestMetadataUrl));
    FileUtils.copyDirectory(new File(testDataFolder),new File(tempTestMetadataUrl));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (System.getProperty(KylinConfig.KYLIN_CONF_HOME) == null && System.getenv(KylinConfig.KYLIN_CONF_HOME) == null)   System.setProperty(KylinConfig.KYLIN_CONF_HOME,tempTestMetadataUrl);
  KylinConfig.getInstanceFromEnv().setMetadataUrl(tempTestMetadataUrl);
}
Program: 63103
Project: 63103
Buggy source:
public CubeMetadataUpgrade(String newMetadataUrl){
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF,newMetadataUrl);
  KylinConfig.getInstanceFromEnv().setMetadataUrl(newMetadataUrl);
  config=KylinConfig.getInstanceFromEnv();
  store=getStore();
}

Fixed version (ground truth):
public CubeMetadataUpgrade(String newMetadataUrl){
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF_HOME,newMetadataUrl);
  KylinConfig.getInstanceFromEnv().setMetadataUrl(newMetadataUrl);
  config=KylinConfig.getInstanceFromEnv();
  store=getStore();
}
Program: 63104
Project: 63104
Buggy source:
public static KylinConfig loadKylinPropsAndMetadata(Configuration conf) throws IOException {
  File metaDir=new File("String_Node_Str");
  System.setProperty(KylinConfig.KYLIN_CONF,metaDir.getAbsolutePath());
  logger.info("String_Node_Str" + metaDir.getAbsolutePath());
  KylinConfig kylinConfig=KylinConfig.getInstanceFromEnv();
  kylinConfig.setMetadataUrl(metaDir.getCanonicalPath());
  return kylinConfig;
}

Fixed version (ground truth):
public static KylinConfig loadKylinPropsAndMetadata(Configuration conf) throws IOException {
  File metaDir=new File("String_Node_Str");
  System.setProperty(KylinConfig.KYLIN_CONF_HOME,metaDir.getAbsolutePath());
  logger.info("String_Node_Str" + metaDir.getAbsolutePath());
  KylinConfig kylinConfig=KylinConfig.getInstanceFromEnv();
  kylinConfig.setMetadataUrl(metaDir.getCanonicalPath());
  return kylinConfig;
}
Program: 63105
Project: 63105
Buggy source:
private void setup() throws IOException {
  long currentTIME=System.currentTimeMillis();
  exportFolder="String_Node_Str" + currentTIME + "String_Node_Str";
  backupArchive="String_Node_Str" + currentTIME + "String_Node_Str";
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF,AbstractKylinTestCase.SANDBOX_TEST_DATA);
  kylinConfig=KylinConfig.getInstanceFromEnv();
  cli=kylinConfig.getCliCommandExecutor();
  String metadataUrl=kylinConfig.getMetadataUrl();
  int cut=metadataUrl.indexOf('@');
  tableNameBase=metadataUrl.substring(0,cut);
  String hbaseUrl=cut < 0 ? metadataUrl : metadataUrl.substring(cut + 1);
  HConnection conn=HBaseConnection.get(hbaseUrl);
  try {
    hbase=new HBaseAdmin(conn);
    config=hbase.getConfiguration();
    allTables=hbase.listTables();
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw e;
  }
}

Fixed version (ground truth):
private void setup() throws IOException {
  long currentTIME=System.currentTimeMillis();
  exportFolder="String_Node_Str" + currentTIME + "String_Node_Str";
  backupArchive="String_Node_Str" + currentTIME + "String_Node_Str";
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF_HOME,AbstractKylinTestCase.SANDBOX_TEST_DATA);
  kylinConfig=KylinConfig.getInstanceFromEnv();
  cli=kylinConfig.getCliCommandExecutor();
  String metadataUrl=kylinConfig.getMetadataUrl();
  int cut=metadataUrl.indexOf('@');
  tableNameBase=metadataUrl.substring(0,cut);
  String hbaseUrl=cut < 0 ? metadataUrl : metadataUrl.substring(cut + 1);
  HConnection conn=HBaseConnection.get(hbaseUrl);
  try {
    hbase=new HBaseAdmin(conn);
    config=hbase.getConfiguration();
    allTables=hbase.listTables();
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw e;
  }
}
Program: 63106
Project: 63106
Buggy source:
public void setup() throws IOException {
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF,AbstractKylinTestCase.SANDBOX_TEST_DATA);
  kylinConfig=KylinConfig.getInstanceFromEnv();
  cli=kylinConfig.getCliCommandExecutor();
  String metadataUrl=kylinConfig.getMetadataUrl();
  int cut=metadataUrl.indexOf('@');
  tableNameBase=metadataUrl.substring(0,cut);
  String hbaseUrl=cut < 0 ? metadataUrl : metadataUrl.substring(cut + 1);
  HConnection conn=HBaseConnection.get(hbaseUrl);
  try {
    hbase=new HBaseAdmin(conn);
    config=hbase.getConfiguration();
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw e;
  }
  uploadTarballToRemote();
}

Fixed version (ground truth):
public void setup() throws IOException {
  KylinConfig.destoryInstance();
  System.setProperty(KylinConfig.KYLIN_CONF_HOME,AbstractKylinTestCase.SANDBOX_TEST_DATA);
  kylinConfig=KylinConfig.getInstanceFromEnv();
  cli=kylinConfig.getCliCommandExecutor();
  String metadataUrl=kylinConfig.getMetadataUrl();
  int cut=metadataUrl.indexOf('@');
  tableNameBase=metadataUrl.substring(0,cut);
  String hbaseUrl=cut < 0 ? metadataUrl : metadataUrl.substring(cut + 1);
  HConnection conn=HBaseConnection.get(hbaseUrl);
  try {
    hbase=new HBaseAdmin(conn);
    config=hbase.getConfiguration();
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw e;
  }
  uploadTarballToRemote();
}
Program: 63107
Project: 63107
Buggy source:
public String getKylinJobJarPath(){
  final String jobJar=getOptional(KYLIN_JOB_JAR);
  if (StringUtils.isNotEmpty(jobJar)) {
    return jobJar;
  }
  return getFileName(getKylinHome(),JOB_JAR_NAME_PATTERN);
}

Fixed version (ground truth):
public String getKylinJobJarPath(){
  final String jobJar=getOptional(KYLIN_JOB_JAR);
  if (StringUtils.isNotEmpty(jobJar)) {
    return jobJar;
  }
  return getFileName(getKylinHome() + File.separator + "String_Node_Str",JOB_JAR_NAME_PATTERN);
}
Program: 63108
Project: 63108
Buggy source:
private static String getFileName(String kylinHome,Pattern pattern){
  File home=new File(kylinHome);
  SortedSet<String> files=Sets.newTreeSet();
  if (home.exists() && home.isDirectory()) {
    for (    File file : home.listFiles()) {
      final Matcher matcher=pattern.matcher(file.getName());
      if (matcher.matches()) {
        files.add(file.getAbsolutePath());
      }
    }
  }
  if (files.isEmpty()) {
    throw new RuntimeException("String_Node_Str" + pattern.toString() + "String_Node_Str");
  }
 else {
    return files.last();
  }
}

Fixed version (ground truth):
private static String getFileName(String homePath,Pattern pattern){
  File home=new File(homePath);
  SortedSet<String> files=Sets.newTreeSet();
  if (home.exists() && home.isDirectory()) {
    for (    File file : home.listFiles()) {
      final Matcher matcher=pattern.matcher(file.getName());
      if (matcher.matches()) {
        files.add(file.getAbsolutePath());
      }
    }
  }
  if (files.isEmpty()) {
    throw new RuntimeException("String_Node_Str" + pattern.toString() + "String_Node_Str");
  }
 else {
    return files.last();
  }
}
Program: 63109
Project: 63109
Buggy source:
public String getCoprocessorLocalJar(){
  final String coprocessorJar=getOptional(COPROCESSOR_LOCAL_JAR);
  if (StringUtils.isNotEmpty(coprocessorJar)) {
    return coprocessorJar;
  }
  return getFileName(getKylinHome(),COPROCESSOR_JAR_NAME_PATTERN);
}

Fixed version (ground truth):
public String getCoprocessorLocalJar(){
  final String coprocessorJar=getOptional(COPROCESSOR_LOCAL_JAR);
  if (StringUtils.isNotEmpty(coprocessorJar)) {
    return coprocessorJar;
  }
  return getFileName(getKylinHome() + File.separator + "String_Node_Str",COPROCESSOR_JAR_NAME_PATTERN);
}
Program: 63110
Project: 63110
Buggy source:
private String getRequired(String prop){
  String r=kylinConfig.getString(prop);
  if (StringUtils.isEmpty(r))   throw new IllegalArgumentException("String_Node_Str" + prop + "String_Node_Str");
  return r;
}

Fixed version (ground truth):
private String getRequired(String prop){
  final String property=System.getProperty(prop);
  if (property != null) {
    return property;
  }
  String r=kylinConfig.getString(prop);
  if (StringUtils.isEmpty(r)) {
    throw new IllegalArgumentException("String_Node_Str" + prop + "String_Node_Str");
  }
  return r;
}
Program: 63111
Project: 63111
Buggy source:
@Override public void write(LongWritable v,byte[] buf,int offset){
  BytesUtil.writeLong(v.get(),buf,offset,SIZE);
}

Fixed version (ground truth):
@Override public void write(LongWritable v,byte[] buf,int offset){
  BytesUtil.writeLong(v == null ? 0 : v.get(),buf,offset,SIZE);
}
Program: 63112
Project: 63112
Buggy source:
private TableDesc reloadSourceTableAt(String path) throws IOException {
  ResourceStore store=getStore();
  TableDesc t=store.getResource(path,TableDesc.class,TABLE_SERIALIZER);
  t.init();
  String tableIdentity=t.getIdentity();
  srcTableMap.putLocal(tableIdentity,t);
  return t;
}

Fixed version (ground truth):
private TableDesc reloadSourceTableAt(String path) throws IOException {
  ResourceStore store=getStore();
  TableDesc t=store.getResource(path,TableDesc.class,TABLE_SERIALIZER);
  if (t == null) {
    return null;
  }
  t.init();
  String tableIdentity=t.getIdentity();
  srcTableMap.putLocal(tableIdentity,t);
  return t;
}
Program: 63113
Project: 63113
Buggy source:
private static void cleanupCache(){
  KylinConfig config=null;
  try {
    config=KylinConfig.getInstanceFromEnv();
  }
 catch (  Exception e) {
  }
  if (config == null)   return;
  for (  String serviceClass : SERVICES_WITH_CACHE) {
    try {
      Class<?> cls=Class.forName(serviceClass);
      Method method=cls.getDeclaredMethod("String_Node_Str",KylinConfig.class);
      method.invoke(null,config);
    }
 catch (    ClassNotFoundException e) {
    }
catch (    Exception e) {
      System.err.println("String_Node_Str" + serviceClass);
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private static void cleanupCache(){
  for (  String serviceClass : SERVICES_WITH_CACHE) {
    try {
      Class<?> cls=Class.forName(serviceClass);
      Method method=cls.getDeclaredMethod("String_Node_Str");
      method.invoke(null);
    }
 catch (    ClassNotFoundException e) {
    }
catch (    Exception e) {
      System.err.println("String_Node_Str" + serviceClass);
      e.printStackTrace();
    }
  }
}
Program: 63115
Project: 63115
Buggy source:
@Override public void handle(String type,String name,String event){
  final CacheService cacheService=new CacheService(){
    @Override public KylinConfig getConfig(){
      return configB;
    }
  }
;
  Broadcaster.TYPE wipeType=Broadcaster.TYPE.getType(type);
  Broadcaster.EVENT wipeEvent=Broadcaster.EVENT.getEvent(event);
  final String log="String_Node_Str" + wipeType + "String_Node_Str"+ wipeEvent+ "String_Node_Str"+ name;
  logger.info(log);
switch (wipeEvent) {
case CREATE:
case UPDATE:
    cacheService.rebuildCache(wipeType,name);
  break;
case DROP:
cacheService.removeCache(wipeType,name);
break;
default :
throw new RuntimeException("String_Node_Str" + wipeEvent);
}
}

Fixed version (ground truth):
@Override public void handle(String type,String name,String event){
  final CacheService cacheService=new CacheService(){
    @Override public KylinConfig getConfig(){
      return configB;
    }
  }
;
  Broadcaster.TYPE wipeType=Broadcaster.TYPE.getType(type);
  Broadcaster.EVENT wipeEvent=Broadcaster.EVENT.getEvent(event);
  final String log="String_Node_Str" + wipeType + "String_Node_Str"+ wipeEvent+ "String_Node_Str"+ name;
  logger.info(log);
  counter.incrementAndGet();
switch (wipeEvent) {
case CREATE:
case UPDATE:
    cacheService.rebuildCache(wipeType,name);
  break;
case DROP:
cacheService.removeCache(wipeType,name);
break;
default :
throw new RuntimeException("String_Node_Str" + wipeEvent);
}
}