nus-yam/ex-repair huggingface dataset:
Program: 94105
Project: 94105
Buggy source:
public Object getBuiltContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (cursor.getCount() == 0)   return null;
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Object invocationResponse;
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ callbackHandler.parameters);
    invocationResponse=callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}

Fixed version (ground truth):
public Object getBuiltContent(String tableName,String columnName,String[] selectionArgs,String sortOrder,String[] projection,CallbackHandler callbackHandler){
  Logger.log("String_Node_Str");
  String selection=columnName + "String_Node_Str";
  Cursor cursor=getDatabase().query(tableName,projection,selection,selectionArgs,null,null,sortOrder);
  callbackHandler.addParams(cursor);
  Logger.log("String_Node_Str" + cursor.getCount());
  if (!cursor.moveToFirst()) {
    Logger.log("String_Node_Str");
    return null;
  }
  Object invocationResponse;
  try {
    Logger.log("String_Node_Str" + callbackHandler.method.getName() + "String_Node_Str"+ callbackHandler.parameters);
    invocationResponse=callbackHandler.method.invoke(callbackHandler.caller,callbackHandler.parameters);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
    cursor.close();
    return null;
  }
  if (invocationResponse == null) {
    Logger.log("String_Node_Str" + callbackHandler.method.getName());
    return null;
  }
  cursor.close();
  return invocationResponse;
}
Program: 94106
Project: 94106
Buggy source:
public LensData getLens(String mCode){
  Logger.log("String_Node_Str");
  String[] selectionArgs={mCode};
  String sortOrder=LensEntry.COLUMN_NAME_MCODE + "String_Node_Str";
  CallbackHandler callback=getCallback("String_Node_Str",LensDatabaseHelper.class,Cursor.class);
  LensData lensData=(LensData)super.getBuiltContent(LensEntry.TABLE_NAME,LensEntry.COLUMN_NAME_MCODE,selectionArgs,sortOrder,fullProjection,callback);
  if (lensData == null)   return null;
  Logger.log("String_Node_Str" + lensData.mCode);
  return lensData;
}

Fixed version (ground truth):
public LensData getLens(String mCode){
  Logger.log("String_Node_Str");
  String[] selectionArgs={mCode};
  String sortOrder=LensEntry.COLUMN_NAME_MCODE + "String_Node_Str";
  CallbackHandler callback=getCallback("String_Node_Str",LensDatabaseHelper.class,Cursor.class);
  LensData lensData=(LensData)super.getBuiltContent(LensEntry.TABLE_NAME,LensEntry.COLUMN_NAME_MCODE,selectionArgs,sortOrder,fullProjection,callback);
  Logger.log("String_Node_Str" + lensData.mCode);
  return lensData;
}
Program: 94109
Project: 94109
Buggy source:
public static ArrayList<Object> buildModifiedList(ArrayList<Object> list,ArrayList<String> lensBlacklist){
  Logger.log("String_Node_Str" + list.size());
  ArrayList<Object> lensList=MainActivity.lensDBHelper.getAllExcept(lensBlacklist);
  Logger.log("String_Node_Str" + lensList.size());
  for (  Object lensObj : lensList) {
    LensData lensData=(LensData)lensObj;
    if (!lensData.mActive)     continue;
    Object lens=buildModifiedLens(lensData);
    list.add(lens);
  }
  Logger.log("String_Node_Str" + list.size());
  return list;
}

Fixed version (ground truth):
public static ArrayList<Object> buildModifiedList(ArrayList<Object> list,ArrayList<String> lensBlacklist){
  Logger.log("String_Node_Str" + list.size());
  ArrayList<Object> lensList=MainActivity.lensDBHelper.getAllExcept(lensBlacklist);
  if (lensList == null) {
    Logger.log("String_Node_Str");
    return list;
  }
  Logger.log("String_Node_Str" + lensList.size());
  for (  Object lensObj : lensList) {
    LensData lensData=(LensData)lensObj;
    if (!lensData.mActive)     continue;
    Object lens=buildModifiedLens(lensData);
    list.add(lens);
  }
  Logger.log("String_Node_Str" + list.size());
  return list;
}
Program: 94111
Project: 94111
Buggy source:
@Override public void initZygote(StartupParam startupParam) throws Throwable {
  MODULE_PATH=startupParam.modulePath;
  mResources=XModuleResources.createInstance(startupParam.modulePath,null);
}

Fixed version (ground truth):
@Override public void initZygote(StartupParam startupParam) throws Throwable {
  MODULE_PATH=startupParam.modulePath;
  mResources=XModuleResources.createInstance(startupParam.modulePath,null);
  File prefsFile=new File(Environment.getDataDirectory(),"String_Node_Str" + HookMethods.PACKAGE_NAME + "String_Node_Str"+ HookMethods.PACKAGE_NAME+ "String_Node_Str"+ "String_Node_Str");
  prefsFile.setReadable(true,false);
}
Program: 94118
Project: 94118
Buggy source:
@Override protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
  return false;
}

Fixed version (ground truth):
@Override protected Object replaceHookedMethod(MethodHookParam param){
  return false;
}
Program: 94120
Project: 94120
Buggy source:
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  param.args[0]=5190453;
}

Fixed version (ground truth):
@Override protected void beforeHookedMethod(MethodHookParam param){
  param.args[0]=5190453;
}
Program: 94123
Project: 94123
Buggy source:
@Override public void initZygote(StartupParam startupParam) throws Throwable {
  MODULE_PATH=startupParam.modulePath;
  mResources=XModuleResources.createInstance(startupParam.modulePath,null);
}

Fixed version (ground truth):
@Override public void initZygote(StartupParam startupParam){
  MODULE_PATH=startupParam.modulePath;
  mResources=XModuleResources.createInstance(startupParam.modulePath,null);
}
Program: 94124
Project: 94124
Buggy source:
public boolean postData(){
  HttpClient httpclient=new DefaultHttpClient();
  HttpPost httppost=new HttpPost("String_Node_Str");
  try {
    List nameValuePairs=new ArrayList(2);
    nameValuePairs.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    HttpResponse response=httpclient.execute(httppost);
    InputStream is=response.getEntity().getContent();
    BufferedInputStream bis=new BufferedInputStream(is);
    final ByteArrayBuffer baf=new ByteArrayBuffer(20);
    int current=0;
    while ((current=bis.read()) != -1) {
      baf.append((byte)current);
    }
    String text=new String(baf.toByteArray());
    String status=null;
    String error_msg=null;
    try {
      JSONObject obj=new JSONObject(text);
      status=obj.getString("String_Node_Str");
      error_msg=obj.getString("String_Node_Str");
      if (status.equals("String_Node_Str") && !error_msg.isEmpty()) {
        latest=true;
      }
      if (status.equals("String_Node_Str") && error_msg.isEmpty()) {
        latest=false;
      }
    }
 catch (    Throwable t) {
      Log.e("String_Node_Str","String_Node_Str" + text + "String_Node_Str");
      latest=false;
    }
  }
 catch (  ClientProtocolException e) {
    latest=false;
  }
catch (  IOException e) {
    latest=false;
  }
  return latest;
}

Fixed version (ground truth):
public boolean postData(){
  HttpClient httpclient=new DefaultHttpClient();
  HttpPost httppost=new HttpPost("String_Node_Str");
  try {
    List<BasicNameValuePair> nameValuePairs=new ArrayList<BasicNameValuePair>(2);
    nameValuePairs.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    HttpResponse response=httpclient.execute(httppost);
    InputStream is=response.getEntity().getContent();
    BufferedInputStream bis=new BufferedInputStream(is);
    final ByteArrayBuffer baf=new ByteArrayBuffer(20);
    int current;
    while ((current=bis.read()) != -1) {
      baf.append((byte)current);
    }
    String text=new String(baf.toByteArray());
    String status;
    String error_msg;
    try {
      JSONObject obj=new JSONObject(text);
      status=obj.getString("String_Node_Str");
      error_msg=obj.getString("String_Node_Str");
      if (status.equals("String_Node_Str") && !error_msg.isEmpty()) {
        latest=true;
      }
      if (status.equals("String_Node_Str") && error_msg.isEmpty()) {
        latest=false;
      }
    }
 catch (    Throwable t) {
      Log.e("String_Node_Str","String_Node_Str" + text + "String_Node_Str");
      latest=false;
    }
  }
 catch (  IOException e2) {
    latest=false;
  }
  return latest;
}
Program: 94128
Project: 94128
Buggy source:
private void checkForCompletion(){
  if (flags.contains(FlagState.COMPLETED))   return;
  boolean isComplete=flags.contains(FlagState.HEADER) && flags.contains(FlagState.HEADER);
  if (isComplete)   flags.add(FlagState.COMPLETED);
}

Fixed version (ground truth):
private void checkForCompletion(){
  if (flags.contains(FlagState.COMPLETED))   return;
  boolean isComplete=flags.contains(FlagState.HEADER) && flags.contains(FlagState.PAYLOAD);
  if (isComplete)   flags.add(FlagState.COMPLETED);
}
Program: 94129
Project: 94129
Buggy source:
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  Logger.log("String_Node_Str" + param.args[0],true);
  String str=(String)param.args[0];
  if (str.contains("String_Node_Str")) {
    String url=Environment.getExternalStorageDirectory() + "String_Node_Str" + str;
    Logger.log("String_Node_Str" + url,true);
    File file=new File(url);
    InputStream is=null;
    is=new BufferedInputStream(new FileInputStream(file));
    param.setResult(is);
    Logger.log("String_Node_Str",true);
  }
}

Fixed version (ground truth):
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  Logger.log("String_Node_Str" + param.args[0],true);
  String str=(String)param.args[0];
  if (str.contains("String_Node_Str")) {
    String url=Environment.getExternalStorageDirectory() + "String_Node_Str" + str;
    Logger.log("String_Node_Str" + url,true);
    File file=new File(url);
    if (!file.exists()) {
      Logger.log("String_Node_Str" + str);
      return;
    }
    InputStream is=null;
    is=new BufferedInputStream(new FileInputStream(file));
    param.setResult(is);
    Logger.log("String_Node_Str",true);
  }
}
Program: 94131
Project: 94131
Buggy source:
private static void applyFilter(Bitmap source,Bitmap result,FilterType type){
  GPUImage gpuImage=new GPUImage(context);
  gpuImage.setImage(source);
  gpuImage.setFilter(type.getFilter());
  Bitmap filtered=gpuImage.getBitmapWithFilterApplied();
  int[] pixels=new int[filtered.getHeight() * filtered.getWidth()];
  filtered.getPixels(pixels,0,filtered.getWidth(),0,0,filtered.getWidth(),filtered.getHeight());
  result.setPixels(pixels,0,filtered.getWidth(),0,0,filtered.getWidth(),filtered.getHeight());
}

Fixed version (ground truth):
private static void applyFilter(Bitmap source,Bitmap result,FilterType type){
  GPUImage gpuImage=new GPUImage(context);
  gpuImage.setImage(source);
  gpuImage.setFilter(type.getFilter());
  try {
    Bitmap filtered=gpuImage.getBitmapWithFilterApplied();
    int[] pixels=new int[filtered.getHeight() * filtered.getWidth()];
    filtered.getPixels(pixels,0,filtered.getWidth(),0,0,filtered.getWidth(),filtered.getHeight());
    result.setPixels(pixels,0,filtered.getWidth(),0,0,filtered.getWidth(),filtered.getHeight());
  }
 catch (  NullPointerException e) {
    Logger.log("String_Node_Str" + type.toString());
    return;
  }
}
Program: 94134
Project: 94134
Buggy source:
public static String readFromSDFile(String filename){
  String aBuffer="String_Node_Str";
  try {
    File myFile=new File(Environment.getExternalStorageDirectory() + "String_Node_Str" + filename+ "String_Node_Str");
    FileInputStream fIn=new FileInputStream(myFile);
    BufferedReader myReader=new BufferedReader(new InputStreamReader(fIn));
    String aDataRow="String_Node_Str";
    while ((aDataRow=myReader.readLine()) != null) {
      aBuffer+=aDataRow + "String_Node_Str";
    }
    myReader.close();
  }
 catch (  Exception e) {
    Logger.log("String_Node_Str" + e.toString());
  }
  return aBuffer;
}

Fixed version (ground truth):
public static String readFromSDFile(String filename){
  String aBuffer="String_Node_Str";
  try {
    File myFile=new File(Environment.getExternalStorageDirectory() + "String_Node_Str" + filename+ "String_Node_Str");
    FileInputStream fIn=new FileInputStream(myFile);
    BufferedReader myReader=new BufferedReader(new InputStreamReader(fIn));
    String aDataRow="String_Node_Str";
    while ((aDataRow=myReader.readLine()) != null) {
      aBuffer+=aDataRow + "String_Node_Str";
    }
    myReader.close();
  }
 catch (  Exception e) {
    Logger.log("String_Node_Str" + e.toString(),true);
  }
  return aBuffer;
}
Program: 94137
Project: 94137
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  width=seekBar2.getProgress();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  width=seekBar2.getProgress();
  if (width == 0) {
    width=width + 1;
  }
}
Program: 94138
Project: 94138
Buggy source:
public void onProgressChanged(SeekBar seekBar2,int n,boolean bl){
}

Fixed version (ground truth):
public void onProgressChanged(SeekBar seekBar2,int n,boolean bl){
  if (n == 0) {
    n=n + 1;
  }
  tv.setText("String_Node_Str" + n);
}
Program: 94141
Project: 94141
Buggy source:
Request(RequestBuilder builder){
  method=builder.method;
  headers=builder.headers;
  cookies=builder.cookies;
  userAgent=builder.userAgent;
  charset=builder.requestCharset;
  body=builder.body;
  socksTimeout=builder.socksTimeout;
  connectTimeout=builder.connectTimeout;
  proxy=builder.proxy;
  followRedirect=builder.followRedirect;
  compress=builder.compress;
  verify=builder.verify;
  certs=builder.certs;
  basicAuth=builder.basicAuth;
  sessionContext=builder.sessionContext;
  keepAlive=builder.keepAlive;
  this.url=joinUrl(builder.url,builder.params,charset);
}

Fixed version (ground truth):
Request(RequestBuilder builder){
  method=builder.method;
  headers=builder.headers;
  cookies=builder.cookies;
  userAgent=builder.userAgent;
  charset=builder.charset;
  body=builder.body;
  socksTimeout=builder.socksTimeout;
  connectTimeout=builder.connectTimeout;
  proxy=builder.proxy;
  followRedirect=builder.followRedirect;
  compress=builder.compress;
  verify=builder.verify;
  certs=builder.certs;
  basicAuth=builder.basicAuth;
  sessionContext=builder.sessionContext;
  keepAlive=builder.keepAlive;
  this.url=builder.url;
  this.params=builder.params;
}
Program: 94142
Project: 94142
Buggy source:
/** 
 * Set charset used to encode request params or forms. Default UTF8.
 */
public RequestBuilder charset(Charset charset){
  requestCharset=charset;
  return this;
}

Fixed version (ground truth):
/** 
 * Set charset used to encode request params or forms. Default UTF8.
 */
public RequestBuilder charset(Charset charset){
  this.charset=charset;
  return this;
}
Program: 94143
Project: 94143
Buggy source:
RequestBuilder(@Nullable SessionContext sessionContext){
  this.sessionContext=sessionContext;
}

Fixed version (ground truth):
RequestBuilder(Request request){
  method=request.getMethod();
  headers=request.getHeaders();
  cookies=request.getCookies();
  userAgent=request.getUserAgent();
  charset=request.getCharset();
  body=request.getBody();
  socksTimeout=request.getSocksTimeout();
  connectTimeout=request.getConnectTimeout();
  proxy=request.getProxy();
  followRedirect=request.isFollowRedirect();
  compress=request.isCompress();
  verify=request.isVerify();
  certs=request.getCerts();
  basicAuth=request.getBasicAuth();
  sessionContext=request.getSessionContext();
  keepAlive=request.isKeepAlive();
  this.url=request.getUrl();
  this.params=request.getParams();
}
Program: 94144
Project: 94144
Buggy source:
/** 
 * Set charset used to encode request params or forms. Default UTF8.
 */
public RequestBuilder requestCharset(Charset charset){
  requestCharset=charset;
  return this;
}

Fixed version (ground truth):
/** 
 * Set charset used to encode request params or forms. Default UTF8.
 */
public RequestBuilder requestCharset(Charset charset){
  this.charset=charset;
  return this;
}
Program: 94145
Project: 94145
Buggy source:
public RequestBuilder url(String url){
  this.url=Objects.requireNonNull(url);
  return this;
}

Fixed version (ground truth):
public RequestBuilder url(URL url){
  this.url=Objects.requireNonNull(url);
  return this;
}
Program: 94146
Project: 94146
Buggy source:
/** 
 * Create new request with method and url
 */
public static RequestBuilder newRequest(String method,String url){
  return new RequestBuilder(null).method(method).url(url);
}

Fixed version (ground truth):
/** 
 * Create new request with method and url
 */
public static RequestBuilder newRequest(String method,String url){
  return new RequestBuilder().method(method).url(url);
}
Program: 94147
Project: 94147
Buggy source:
public RequestBuilder newRequest(String method,String url){
  return new RequestBuilder(context).url(url).method(method);
}

Fixed version (ground truth):
public RequestBuilder newRequest(String method,String url){
  return new RequestBuilder().sessionContext(context).url(url).method(method);
}
Program: 94148
Project: 94148
Buggy source:
/** 
 * Encode key-value query parameter
 */
public static String encodeQuery(Parameter<String> query,Charset charset){
  return encodeParam(query.getName(),charset) + "String_Node_Str" + encodeParam(query.getValue(),charset);
}

Fixed version (ground truth):
/** 
 * Encode key-value query parameter
 */
public static String encodeQuery(Map.Entry<String,String> query,Charset charset){
  return encodeParam(query.getKey(),charset) + "String_Node_Str" + encodeParam(query.getValue(),charset);
}
Program: 94149
Project: 94149
Buggy source:
/** 
 * Encode multi queries
 */
public static String encodeQueries(Collection<? extends Parameter<String>> queries,Charset charset){
  StringBuilder sb=new StringBuilder();
  for (  Parameter<String> query : queries) {
    sb.append(encodeParam(query.getName(),charset));
    sb.append('=');
    sb.append(encodeParam(query.getValue(),charset));
    sb.append('&');
  }
  if (sb.length() > 0) {
    sb.deleteCharAt(sb.length() - 1);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Encode multi queries
 */
public static String encodeQueries(Collection<? extends Map.Entry<String,String>> queries,Charset charset){
  StringBuilder sb=new StringBuilder();
  for (  Map.Entry<String,String> query : queries) {
    sb.append(encodeParam(query.getKey(),charset));
    sb.append('=');
    sb.append(encodeParam(query.getValue(),charset));
    sb.append('&');
  }
  if (sb.length() > 0) {
    sb.deleteCharAt(sb.length() - 1);
  }
  return sb.toString();
}
Program: 94151
Project: 94151
Buggy source:
public void start(){
  server=new Server();
  HttpConfiguration http_config=new HttpConfiguration();
  http_config.setSecureScheme("String_Node_Str");
  http_config.setSecurePort(8443);
  http_config.setOutputBufferSize(32768);
  ServerConnector http=new ServerConnector(server,new HttpConnectionFactory(http_config));
  http.setPort(8080);
  http.setIdleTimeout(30000);
  SslContextFactory sslContextFactory=new SslContextFactory();
  sslContextFactory.setKeyStorePath(this.getClass().getResource("String_Node_Str").toExternalForm());
  sslContextFactory.setKeyStorePassword("String_Node_Str");
  sslContextFactory.setKeyManagerPassword("String_Node_Str");
  HttpConfiguration httpsConfig=new HttpConfiguration(http_config);
  httpsConfig.addCustomizer(new SecureRequestCustomizer());
  ServerConnector https=new ServerConnector(server,new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),new HttpConnectionFactory(httpsConfig));
  https.setPort(8443);
  https.setIdleTimeout(500000);
  server.setConnectors(new Connector[]{http,https});
  ServletHandler handler=new ServletHandler();
  server.setHandler(handler);
  handler.addServletWithMapping(MockGetServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockPostServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockBasicAuthenticationServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockMultiPartServlet.class,"String_Node_Str");
  try {
    server.start();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void start(){
  server=new Server();
  HttpConfiguration http_config=new HttpConfiguration();
  http_config.setSecureScheme("String_Node_Str");
  http_config.setSecurePort(8443);
  http_config.setOutputBufferSize(32768);
  ServerConnector http=new ServerConnector(server,new HttpConnectionFactory(http_config));
  http.setPort(8080);
  http.setIdleTimeout(30000);
  SslContextFactory sslContextFactory=new SslContextFactory();
  sslContextFactory.setKeyStorePath(this.getClass().getResource("String_Node_Str").toExternalForm());
  sslContextFactory.setKeyStorePassword("String_Node_Str");
  sslContextFactory.setKeyManagerPassword("String_Node_Str");
  HttpConfiguration httpsConfig=new HttpConfiguration(http_config);
  httpsConfig.addCustomizer(new SecureRequestCustomizer());
  ServerConnector https=new ServerConnector(server,new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),new HttpConnectionFactory(httpsConfig));
  https.setPort(8443);
  https.setIdleTimeout(500000);
  server.setConnectors(new Connector[]{http,https});
  ServletHandler handler=new ServletHandler();
  server.setHandler(handler);
  handler.addServletWithMapping(MockGetServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockPostServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockBasicAuthenticationServlet.class,"String_Node_Str");
  handler.addServletWithMapping(MockPartServlet.class,"String_Node_Str");
  try {
    server.start();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 94152
Project: 94152
Buggy source:
@Override protected void handleMessageInternal(final Message<?> message) throws Exception {
  String topic=this.topicExpression != null ? this.topicExpression.getValue(this.evaluationContext,message,String.class) : message.getHeaders().get(KafkaHeaders.TOPIC,String.class);
  Integer partitionId=this.partitionExpression != null ? this.partitionExpression.getValue(this.evaluationContext,message,Integer.class) : message.getHeaders().get(KafkaHeaders.PARTITION_ID,Integer.class);
  Object messageKey=this.messageKeyExpression != null ? this.messageKeyExpression.getValue(this.evaluationContext,message) : message.getHeaders().get(KafkaHeaders.MESSAGE_KEY);
  this.kafkaProducerContext.send(topic,partitionId,messageKey,message.getPayload());
}

Fixed version (ground truth):
@Override protected void handleMessageInternal(final Message<?> message) throws Exception {
  String topic=this.topicExpression != null ? this.topicExpression.getValue(this.evaluationContext,message,String.class) : message.getHeaders().get(KafkaHeaders.TOPIC,String.class);
  Integer partitionId=this.partitionIdExpression != null ? this.partitionIdExpression.getValue(this.evaluationContext,message,Integer.class) : message.getHeaders().get(KafkaHeaders.PARTITION_ID,Integer.class);
  Object messageKey=this.messageKeyExpression != null ? this.messageKeyExpression.getValue(this.evaluationContext,message) : message.getHeaders().get(KafkaHeaders.MESSAGE_KEY);
  this.kafkaProducerContext.send(topic,partitionId,messageKey,message.getPayload());
}
Program: 94153
Project: 94153
Buggy source:
public Future<RecordMetadata> send(String topic,Integer partition,K messageKey,V messagePayload){
  String targetTopic=StringUtils.hasText(topic) ? topic : this.producerMetadata.getTopic();
  Future<RecordMetadata> future=this.producer.send(new ProducerRecord<>(targetTopic,partition,messageKey,messagePayload));
  if (!producerMetadata.isSync()) {
    return future;
  }
 else {
    try {
      if (producerMetadata.getSendTimeout() <= 0) {
        future.get();
      }
 else {
        future.get(producerMetadata.getSendTimeout(),TimeUnit.MILLISECONDS);
      }
    }
 catch (    InterruptedException|ExecutionException|TimeoutException e) {
      throw new KafkaException(e);
    }
    return future;
  }
}

Fixed version (ground truth):
public Future<RecordMetadata> send(String topic,Integer partition,K messageKey,V messagePayload){
  String targetTopic=StringUtils.hasText(topic) ? topic : this.producerMetadata.getTopic();
  if (partition == null && this.getProducerMetadata().getPartitioner() != null) {
    partition=this.getProducerMetadata().getPartitioner().partition(messageKey,this.producer.partitionsFor(targetTopic).size());
  }
  Future<RecordMetadata> future=this.producer.send(new ProducerRecord<>(targetTopic,partition,messageKey,messagePayload));
  if (!producerMetadata.isSync()) {
    return future;
  }
 else {
    try {
      if (producerMetadata.getSendTimeout() <= 0) {
        future.get();
      }
 else {
        future.get(producerMetadata.getSendTimeout(),TimeUnit.MILLISECONDS);
      }
    }
 catch (    InterruptedException|ExecutionException|TimeoutException e) {
      throw new KafkaException(e);
    }
    return future;
  }
}
Program: 94154
Project: 94154
Buggy source:
@SuppressWarnings("String_Node_Str") public Map<String,List<KafkaStream<byte[],byte[]>>> getConsumerMapWithMessageStreams(){
  if (consumerMetadata.getValueDecoder() != null) {
    return getConsumerConnector().createMessageStreams(consumerMetadata.getTopicStreamMap(),consumerMetadata.getValueDecoder(),consumerMetadata.getValueDecoder());
  }
  return getConsumerConnector().createMessageStreams(consumerMetadata.getTopicStreamMap());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Map<String,List<KafkaStream<byte[],byte[]>>> getConsumerMapWithMessageStreams(){
  if (consumerMetadata.getValueDecoder() != null && consumerMetadata.getKeyDecoder() != null) {
    return getConsumerConnector().createMessageStreams(consumerMetadata.getTopicStreamMap(),consumerMetadata.getKeyDecoder(),consumerMetadata.getValueDecoder());
  }
  return getConsumerConnector().createMessageStreams(consumerMetadata.getTopicStreamMap());
}
Program: 94155
Project: 94155
Buggy source:
@ProtobufRPC(serviceName="String_Node_Str",methodName="String_Node_Str",onceTalkTimeout=1000000) Future<EchoInfo> echoAsync(EchoInfo info);

Fixed version (ground truth):
@ProtobufRPC(serviceName="String_Node_Str",methodName="String_Node_Str",onceTalkTimeout=500000) Future<EchoInfo> echoAsync(EchoInfo info);
Program: 94156
Project: 94156
Buggy source:
@ProtobufRPCService(serviceName="String_Node_Str",methodName="String_Node_Str",description="String_Node_Str") public EchoInfo doEcho(EchoInfo info){
  EchoInfo ret=new EchoInfo();
  ret.setMessage("String_Node_Str" + info.getMessage() + (order == null ? "String_Node_Str" : order));
  return ret;
}

Fixed version (ground truth):
@ProtobufRPCService(serviceName="String_Node_Str",methodName="String_Node_Str",description="String_Node_Str") public EchoInfo doEcho(EchoInfo info){
  EchoInfo ret=new EchoInfo();
  ret.setMessage("String_Node_Str" + info.getMessage() + (order == null ? "String_Node_Str" : order));
  SleepUtils.dummySleep(2000000);
  return ret;
}
Program: 94157
Project: 94157
Buggy source:
/** 
 * Checks if is current channel.
 * @param channel the channel
 * @return true, if is current channel
 */
public boolean isCurrentChannel(Channel channel){
  if (this.channel == null) {
    return false;
  }
  return channel.equals(channel);
}

Fixed version (ground truth):
/** 
 * Checks if is current channel.
 * @param channel the channel
 * @return true, if is current channel
 */
public boolean isCurrentChannel(Channel channel){
  if (this.channel == null) {
    return false;
  }
  return this.channel.equals(channel);
}
Program: 94158
Project: 94158
Buggy source:
public static void main(String[] args){
  RpcClientOptions options=new RpcClientOptions();
  options.setThreadPoolSize(10);
  options.setMaxIdleSize(10);
  options.setMinIdleSize(10);
  options.setMaxWait(1000);
  options.setShortConnection(false);
  RpcClient rpcClient=new RpcClient(options);
  ProtobufRpcProxy<EchoService> pbrpcProxy=new ProtobufRpcProxy<EchoService>(rpcClient,EchoService.class);
  pbrpcProxy.setPort(Integer.valueOf(args[0]));
  pbrpcProxy.setHost("String_Node_Str");
  EchoService echoService=pbrpcProxy.proxy();
  EchoInfo echoInfo=new EchoInfo();
  long time=System.currentTimeMillis();
  for (int i=0; i < 1000; i++) {
    echoInfo.setMessage("String_Node_Str" + i);
    echoInfo=echoService.echo(echoInfo);
    System.out.println(echoInfo.getMessage());
  }
  System.out.println(System.currentTimeMillis() - time);
  pbrpcProxy.close();
  rpcClient.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args){
  RpcClientOptions options=new RpcClientOptions();
  options.setThreadPoolSize(10);
  options.setMaxIdleSize(10);
  options.setMinIdleSize(10);
  options.setMaxWait(1000);
  options.setShortConnection(false);
  RpcClient rpcClient=new RpcClient(options);
  ProtobufRpcProxy<EchoService> pbrpcProxy=new ProtobufRpcProxy<EchoService>(rpcClient,EchoService.class);
  pbrpcProxy.setPort(8000);
  pbrpcProxy.setHost("String_Node_Str");
  EchoService echoService=pbrpcProxy.proxy();
  EchoInfo echoInfo=new EchoInfo();
  long time=System.currentTimeMillis();
  for (int i=0; i < 1000; i++) {
    try {
      echoInfo.setMessage("String_Node_Str" + i);
      Future<EchoInfo> echoInfo2=echoService.echoAsync(echoInfo);
      EchoInfo echoInfo3=echoInfo2.get();
      System.out.println(echoInfo3);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  System.out.println(System.currentTimeMillis() - time);
  pbrpcProxy.close();
  rpcClient.shutdown();
}
Program: 94159
Project: 94159
Buggy source:
@SuppressWarnings("String_Node_Str") public T getResource(){
  try {
    return (T)internalPool.borrowObject();
  }
 catch (  Exception e) {
    throw new JedisConnectionException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public T getResource(){
  try {
    return (T)internalPool.borrowObject();
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 94160
Project: 94160
Buggy source:
public void returnResource(final T resource){
  try {
    internalPool.returnObject(resource);
  }
 catch (  Exception e) {
    throw new JedisException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void returnResource(final T resource){
  try {
    internalPool.returnObject(resource);
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 94161
Project: 94161
Buggy source:
public void destroy(){
  try {
    internalPool.close();
  }
 catch (  Exception e) {
    throw new JedisException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void destroy(){
  try {
    internalPool.close();
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 94162
Project: 94162
Buggy source:
public void returnBrokenResource(final T resource){
  try {
    internalPool.invalidateObject(resource);
  }
 catch (  Exception e) {
    throw new JedisException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void returnBrokenResource(final T resource){
  try {
    internalPool.invalidateObject(resource);
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 94163
Project: 94163
Buggy source:
@Test public void testGetRpcMethodMeta(){
  RpcClient rpcClient=new RpcClient();
  ProtobufRpcProxy<RpcServiceMetaService> pbrpcProxy=new ProtobufRpcProxy<RpcServiceMetaService>(rpcClient,RpcServiceMetaService.class);
  pbrpcProxy.setPort(PORT);
  RpcServiceMetaService proxy=pbrpcProxy.proxy();
  RpcServiceMetaList rpcServiceMetaInfo=proxy.getRpcServiceMetaInfo();
  Assert.assertEquals(4,rpcServiceMetaInfo.getRpcServiceMetas().size());
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  for (  RpcServiceMeta rpcServiceMeta : rpcServiceMetas) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + rpcServiceMeta.getServiceName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getMethodName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputObjName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputObjName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputProto());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputProto());
  }
  System.out.println("String_Node_Str");
  System.out.println(rpcServiceMetaInfo.getTypesIDL());
  System.out.println(rpcServiceMetaInfo.getRpcsIDL());
}

Fixed version (ground truth):
@Test public void testGetRpcMethodMeta(){
  RpcClient rpcClient=new RpcClient();
  ProtobufRpcProxy<RpcServiceMetaService> pbrpcProxy=new ProtobufRpcProxy<RpcServiceMetaService>(rpcClient,RpcServiceMetaService.class);
  pbrpcProxy.setPort(PORT);
  RpcServiceMetaService proxy=pbrpcProxy.proxy();
  RpcServiceMetaList rpcServiceMetaInfo=proxy.getRpcServiceMetaInfo();
  Assert.assertEquals(5,rpcServiceMetaInfo.getRpcServiceMetas().size());
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  for (  RpcServiceMeta rpcServiceMeta : rpcServiceMetas) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + rpcServiceMeta.getServiceName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getMethodName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputObjName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputObjName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputProto());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputProto());
  }
  System.out.println("String_Node_Str");
  System.out.println(rpcServiceMetaInfo.getTypesIDL());
  System.out.println(rpcServiceMetaInfo.getRpcsIDL());
}
Program: 94164
Project: 94164
Buggy source:
@Test public void testRpcMetaQuery() throws Exception {
  RpcProxyFactoryBean proxyBean=new RpcProxyFactoryBean();
  proxyBean.setServiceInterface(RpcServiceMetaService.class);
  proxyBean.setPort(servicePort);
  proxyBean.afterPropertiesSet();
  Object object=proxyBean.getObject();
  Assert.assertTrue(object instanceof RpcServiceMetaService);
  RpcServiceMetaService rpcServiceMetaService=(RpcServiceMetaService)object;
  RpcServiceMetaList rpcServiceMetaInfo=rpcServiceMetaService.getRpcServiceMetaInfo();
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  Assert.assertEquals(4,rpcServiceMetas.size());
}

Fixed version (ground truth):
@Test public void testRpcMetaQuery() throws Exception {
  RpcProxyFactoryBean proxyBean=new RpcProxyFactoryBean();
  proxyBean.setServiceInterface(RpcServiceMetaService.class);
  proxyBean.setPort(servicePort);
  proxyBean.afterPropertiesSet();
  Object object=proxyBean.getObject();
  Assert.assertTrue(object instanceof RpcServiceMetaService);
  RpcServiceMetaService rpcServiceMetaService=(RpcServiceMetaService)object;
  RpcServiceMetaList rpcServiceMetaInfo=rpcServiceMetaService.getRpcServiceMetaInfo();
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  Assert.assertEquals(5,rpcServiceMetas.size());
}
Program: 94165
Project: 94165
Buggy source:
public Object invoke(MethodInvocation invocation) throws Throwable {
  String beanKey=elect(invocation);
  Object bean=targetBeans.get(beanKey);
  if (isFailOver()) {
    boolean isAvailable;
    try {
      isAvailable=failOverInterceptor.isAvailable(bean,getMethod(bean,invocation),beanKey);
    }
 catch (    Exception e) {
      isAvailable=false;
    }
    if (!isAvailable) {
      failedTarget(bean,invocation,beanKey);
      return invoke(invocation);
    }
  }
  if (bean != null) {
    try {
      return doInvoke(bean,invocation);
    }
 catch (    Throwable e) {
      Throwable t=getRealException(e);
      if (isFailOver() && failOverInterceptor.isDoFailover(t,beanKey)) {
        LOGGER.error("String_Node_Str" + t.getLocalizedMessage());
        failedTarget(bean,invocation,beanKey);
        return invoke(invocation);
      }
      throw t;
    }
  }
  throw new NullPointerException("String_Node_Str");
}

Fixed version (ground truth):
public Object invoke(MethodInvocation invocation) throws Throwable {
  String beanKey=elect(invocation);
  Object bean=targetBeans.get(beanKey);
  if (isFailOver()) {
    boolean isAvailable;
    try {
      isAvailable=failOverInterceptor.isAvailable(bean,getMethod(bean,invocation),beanKey);
    }
 catch (    Exception e) {
      isAvailable=false;
    }
    if (!isAvailable) {
      failedTarget(bean,invocation,beanKey);
      return invoke(invocation);
    }
  }
  if (bean != null) {
    try {
      return doInvoke(bean,invocation);
    }
 catch (    Throwable e) {
      Throwable t=getRealException(e);
      if (isFailOver() && failOverInterceptor.isDoFailover(t,beanKey)) {
        LOGGER.log(Level.SEVERE,"String_Node_Str" + t.getLocalizedMessage());
        failedTarget(bean,invocation,beanKey);
        return invoke(invocation);
      }
      throw t;
    }
  }
  throw new NullPointerException("String_Node_Str");
}
Program: 94167
Project: 94167
Buggy source:
/** 
 * @param heartBeat the heartBeat to set
 */
public void setHeartBeat(boolean heartBeat){
  this.heartBeat=heartBeat;
  if (!heartBeat) {
    LOGGER.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param heartBeat the heartBeat to set
 */
public void setHeartBeat(boolean heartBeat){
  this.heartBeat=heartBeat;
  if (!heartBeat) {
    LOGGER.log(Level.WARNING,"String_Node_Str");
  }
}
Program: 94168
Project: 94168
Buggy source:
/** 
 * get heart bean recover interval. unit 
 * @return
 */
private long getRecoverInterval(){
  long recoverInterval=proxyFactoryBean.getRecoverInterval();
  if (recoverInterval <= TOO_FREQUENT) {
    LOGGER.warn("String_Node_Str" + recoverInterval + "String_Node_Str"+ DEFAULT_RECOVER_INTERVAL);
    recoverInterval=DEFAULT_RECOVER_INTERVAL;
  }
  return recoverInterval;
}

Fixed version (ground truth):
/** 
 * get heart bean recover interval. unit 
 * @return
 */
private long getRecoverInterval(){
  long recoverInterval=proxyFactoryBean.getRecoverInterval();
  if (recoverInterval <= TOO_FREQUENT) {
    LOGGER.log(Level.WARNING,"String_Node_Str" + recoverInterval + "String_Node_Str"+ DEFAULT_RECOVER_INTERVAL);
    recoverInterval=DEFAULT_RECOVER_INTERVAL;
  }
  return recoverInterval;
}
Program: 94169
Project: 94169
Buggy source:
/** 
 * main entry for thread running.
 */
public void run(){
  runing=true;
  LOGGER.info("String_Node_Str");
  Map<String,FactoryBeanInvokeInfo> failedBeans;
  FailOverInterceptor interceptor=proxyFactoryBean.getFailOverInterceptor();
  while (proxyFactoryBean.hasFactoryBeanFailed() && !close) {
    failedBeans=proxyFactoryBean.getFailedFactoryBeans();
    if (failedBeans == null || failedBeans.isEmpty()) {
      return;
    }
    FactoryBeanInvokeInfo invokeInfo;
    for (    Map.Entry<String,FactoryBeanInvokeInfo> entry : failedBeans.entrySet()) {
      invokeInfo=entry.getValue();
      boolean available;
      try {
        available=interceptor.isRecover(invokeInfo.getBean(),invokeInfo.getInvocation(),invokeInfo.getBeanKey());
      }
 catch (      Exception e) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug(e);
        }
        available=false;
      }
      if (available) {
        proxyFactoryBean.recoverFactoryBean(entry.getKey());
        LOGGER.info(invokeInfo.getBeanKey() + "String_Node_Str");
      }
 else {
        LOGGER.warn(invokeInfo.getBeanKey() + "String_Node_Str");
      }
    }
    try {
      Thread.sleep(getRecoverInterval());
    }
 catch (    Exception e) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(e);
      }
    }
  }
  runing=false;
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * main entry for thread running.
 */
public void run(){
  runing=true;
  LOGGER.info("String_Node_Str");
  Map<String,FactoryBeanInvokeInfo> failedBeans;
  FailOverInterceptor interceptor=proxyFactoryBean.getFailOverInterceptor();
  while (proxyFactoryBean.hasFactoryBeanFailed() && !close) {
    failedBeans=proxyFactoryBean.getFailedFactoryBeans();
    if (failedBeans == null || failedBeans.isEmpty()) {
      return;
    }
    FactoryBeanInvokeInfo invokeInfo;
    for (    Map.Entry<String,FactoryBeanInvokeInfo> entry : failedBeans.entrySet()) {
      invokeInfo=entry.getValue();
      boolean available;
      try {
        available=interceptor.isRecover(invokeInfo.getBean(),invokeInfo.getInvocation(),invokeInfo.getBeanKey());
      }
 catch (      Exception e) {
        if (LOGGER.isLoggable(Level.FINE)) {
          LOGGER.log(Level.FINE,e.getMessage());
        }
        available=false;
      }
      if (available) {
        proxyFactoryBean.recoverFactoryBean(entry.getKey());
        LOGGER.info(invokeInfo.getBeanKey() + "String_Node_Str");
      }
 else {
        LOGGER.log(Level.WARNING,invokeInfo.getBeanKey() + "String_Node_Str");
      }
    }
    try {
      Thread.sleep(getRecoverInterval());
    }
 catch (    Exception e) {
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.log(Level.FINE,e.getMessage());
      }
    }
  }
  runing=false;
  LOGGER.info("String_Node_Str");
}
Program: 94170
Project: 94170
Buggy source:
public HaProtobufRpcProxy(RpcClient rpcClient,Class<T> interfaceClass,NamingService namingService,NamingServiceLoadBalanceStrategy loadBalanceStrategy,FailOverInterceptor failOverInterceptor){
  this.rpcClient=rpcClient;
  this.interfaceClass=interfaceClass;
  this.namingService=namingService;
  this.loadBalanceStrategy=loadBalanceStrategy;
  this.failOverInterceptor=failOverInterceptor;
  if (namingService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  proxyInstance=(T)new ProxyFactory(interfaceClass,this).getProxy();
}

Fixed version (ground truth):
public HaProtobufRpcProxy(RpcClient rpcClient,Class<T> interfaceClass,NamingService namingService,NamingServiceLoadBalanceStrategyFactory loadBalanceStrategyFactory,FailOverInterceptor failOverInterceptor){
  this.rpcClient=rpcClient;
  this.interfaceClass=interfaceClass;
  this.namingService=namingService;
  this.loadBalanceStrategyFactory=loadBalanceStrategyFactory;
  this.failOverInterceptor=failOverInterceptor;
  if (namingService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  proxyInstance=(T)new ProxyFactory(interfaceClass,this).getProxy();
}
Program: 94172
Project: 94172
Buggy source:
@Override protected void reInit(final String service,final List<InetSocketAddress> list) throws Exception {
  LoadBalanceProxyFactoryBean oldLbProxyBean=lbMap.get(service);
  List<ProtobufRpcProxy<T>> oldProtobufRpcProxyList=new ArrayList<ProtobufRpcProxy<T>>(protobufRpcProxyListMap.get(service));
  loadBalanceStrategy.doReInit(service,new NamingService(){
    @Override public Map<String,List<InetSocketAddress>> list(    Set<String> serviceSignatures) throws Exception {
      Map<String,List<InetSocketAddress>> ret=new HashMap<String,List<InetSocketAddress>>();
      ret.put(service,list);
      return ret;
    }
  }
);
  doProxy(service,list);
  try {
    doClose(oldLbProxyBean,oldProtobufRpcProxyList);
  }
 catch (  Exception e) {
    LOGGER.fatal(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override protected void reInit(final String service,final List<InetSocketAddress> list) throws Exception {
  LoadBalanceProxyFactoryBean oldLbProxyBean=lbMap.get(service);
  List<ProtobufRpcProxy<T>> oldProtobufRpcProxyList=new ArrayList<ProtobufRpcProxy<T>>(protobufRpcProxyListMap.get(service));
  doProxy(service,list);
  try {
    doClose(oldLbProxyBean,oldProtobufRpcProxyList);
  }
 catch (  Exception e) {
    LOGGER.fatal(e.getMessage(),e);
  }
}
Program: 94173
Project: 94173
Buggy source:
private Method getMethod(Object bean,MethodInvocation invocation) throws Throwable {
  String methodName=invocation.getMethod().getName();
  Method m=bean.getClass().getMethod(methodName,invocation.getMethod().getParameterTypes());
  return m;
}

Fixed version (ground truth):
private Method getMethod(Object bean,MethodInvocation invocation) throws Throwable {
  String methodName=invocation.getMethod().getName();
  if (bean == null) {
    System.out.println("String_Node_Str");
  }
  Class<? extends Object> cls=bean.getClass();
  Method m=cls.getMethod(methodName,invocation.getMethod().getParameterTypes());
  return m;
}
Program: 94174
Project: 94174
Buggy source:
@Test public void testDynamicServerListChangesAdd() throws Exception {
  testNoServerFail();
  list.add(new InetSocketAddress(1036));
  SleepUtils.dummySleep(2000);
  int serverSize=getNamingService().list(defaultServices).get(DEFAULT_KEY).size();
  Assert.assertEquals(6,serverSize);
  EchoInfo echoInfo=new EchoInfo(DEFAULT_KEY);
  Set<String> returnValues=new HashSet<String>();
  for (int i=0; i < serverSize * 2; i++) {
    EchoInfo echo=proxy.echo(echoInfo);
    returnValues.add(echo.getMessage());
  }
  Assert.assertEquals(6,returnValues.size());
}

Fixed version (ground truth):
@Test public void testDynamicServerListChangesAdd() throws Exception {
  testNoServerFail();
  list.add(new InetSocketAddress(1036));
  SleepUtils.dummySleep(6000);
  int serverSize=getNamingService().list(defaultServices).get(DEFAULT_KEY).size();
  Assert.assertEquals(6,serverSize);
  EchoInfo echoInfo=new EchoInfo(DEFAULT_KEY);
  Set<String> returnValues=new HashSet<String>();
  for (int i=0; i < serverSize * 5; i++) {
    EchoInfo echo=proxy.echo(echoInfo);
    returnValues.add(echo.getMessage());
  }
  Assert.assertEquals(6,returnValues.size());
}
Program: 94175
Project: 94175
Buggy source:
public void run(){
  while (!stopChunkPackageTimeoutClean) {
    if (!tempTrunkPackages.isEmpty()) {
      Map<Long,RpcDataPackage> currentCheckPackage;
      currentCheckPackage=new HashMap<Long,RpcDataPackage>(tempTrunkPackages);
      Iterator<Entry<Long,RpcDataPackage>> iter=currentCheckPackage.entrySet().iterator();
      while (iter.hasNext()) {
        Entry<Long,RpcDataPackage> entry=iter.next();
        if (entry.getValue().getTimeStamp() + chunkPackageTimeout > System.currentTimeMillis()) {
          tempTrunkPackages.remove(entry.getValue());
          LOG.log(Level.SEVERE,"String_Node_Str" + chunkPackageTimeout + "String_Node_Str"+ entry.getValue().getRpcMeta().getCorrelationId());
        }
      }
    }
    try {
      Thread.sleep(DEFAULT_CLEANUP_INTERVAL);
    }
 catch (    Exception e) {
      LOG.log(Level.SEVERE,e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (!stopChunkPackageTimeoutClean) {
    if (!tempTrunkPackages.isEmpty()) {
      Map<Long,RpcDataPackage> currentCheckPackage;
      currentCheckPackage=new HashMap<Long,RpcDataPackage>(tempTrunkPackages);
      Iterator<Entry<Long,RpcDataPackage>> iter=currentCheckPackage.entrySet().iterator();
      while (iter.hasNext()) {
        Entry<Long,RpcDataPackage> entry=iter.next();
        if (entry.getValue().getTimeStamp() > System.currentTimeMillis() + chunkPackageTimeout) {
          tempTrunkPackages.remove(entry.getKey());
          LOG.log(Level.SEVERE,"String_Node_Str" + chunkPackageTimeout + "String_Node_Str"+ entry.getValue().getRpcMeta().getCorrelationId());
        }
      }
    }
    try {
      Thread.sleep(DEFAULT_CLEANUP_INTERVAL);
    }
 catch (    Exception e) {
      LOG.log(Level.SEVERE,e.getMessage(),e);
    }
  }
}