nus-yam/ex-repair huggingface dataset:
Program: 36340
Project: 36340
Buggy source:
public void saveCourses(final RefreshResponse refreshResponse,final ResultListener resultListener){
  new AsyncTask<Boolean,Void,Boolean>(){
    @Override protected Boolean doInBackground(    Boolean... params){
      try {
        RushCore.getInstance().deleteAll(Course.class);
        RushCore.getInstance().deleteAll(WithdrawnCourse.class);
        for (        Course course : refreshResponse.getCourses()) {
          course.save();
        }
        for (        WithdrawnCourse withdrawnCourse : refreshResponse.getWithdrawnCourses()) {
          withdrawnCourse.save();
        }
        return true;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return false;
      }
    }
    @Override protected void onPostExecute(    Boolean result){
      if (result) {
        Editor editor=sharedPreferences.edit();
        editor.putString(Constants.KEY_SEMESTER,refreshResponse.getSemester());
        editor.putString(Constants.KEY_COURSES_REFRESHED,refreshResponse.getRefreshed());
        editor.apply();
        resultListener.onSuccess();
      }
 else {
        resultListener.onFailure(new com.karthikb351.vitinfo2.model.Status(StatusCodes.UNKNOWN,context.getResources().getString(R.string.api_unknown_error)));
      }
    }
  }
.execute(true);
}

Fixed version (ground truth):
public void saveCourses(final RefreshResponse refreshResponse,final ResultListener resultListener){
  new AsyncTask<Boolean,Void,Boolean>(){
    @Override protected Boolean doInBackground(    Boolean... params){
      try {
        RushCore.getInstance().deleteAll(Course.class);
        RushCore.getInstance().deleteAll(WithdrawnCourse.class);
        for (        Course course : refreshResponse.getCourses()) {
          course.save();
        }
        for (        WithdrawnCourse withdrawnCourse : refreshResponse.getWithdrawnCourses()) {
          withdrawnCourse.save();
        }
        return true;
      }
 catch (      Exception e) {
        e.printStackTrace();
        return false;
      }
    }
    @Override protected void onPostExecute(    Boolean result){
      if (result) {
        Editor editor=sharedPreferences.edit();
        editor.putString(Constants.KEY_CAMPUS,refreshResponse.getCampus());
        editor.putString(Constants.KEY_REGISTERNUMBER,refreshResponse.getRegisterNumber());
        editor.putString(Constants.KEY_DATEOFBIRTH,refreshResponse.getDateOfBirth());
        editor.putString(Constants.KEY_MOBILE,refreshResponse.getMobileNumber());
        editor.apply();
        editor.putString(Constants.KEY_SEMESTER,refreshResponse.getSemester());
        editor.putString(Constants.KEY_COURSES_REFRESHED,refreshResponse.getRefreshed());
        editor.apply();
        resultListener.onSuccess();
      }
 else {
        resultListener.onFailure(new com.karthikb351.vitinfo2.model.Status(StatusCodes.UNKNOWN,context.getResources().getString(R.string.api_unknown_error)));
      }
    }
  }
.execute(true);
}
Program: 36342
Project: 36342
Buggy source:
@Override public int getItemViewType(int position){
  if (position == 0)   layoutId=R.layout.card_marks;
 else   layoutId=R.layout.card_assessment;
  return layoutId;
}

Fixed version (ground truth):
@Override public int getItemViewType(int position){
  if (position == 0)   layoutId=R.layout.card_total_internals;
 else   layoutId=R.layout.card_assessment;
  return layoutId;
}
Program: 36343
Project: 36343
Buggy source:
public ContributorViewHolder(View view){
  super(view);
}

Fixed version (ground truth):
public ContributorViewHolder(View view){
  super(view);
  contributorName=(TextView)view.findViewById(R.id.contributor_name);
  contributorRole=(TextView)view.findViewById(R.id.contributor_role);
  contributorGit=(TextView)view.findViewById(R.id.contributor_github_profile);
  contributorMail=(TextView)view.findViewById(R.id.contributor_email);
}
Program: 36344
Project: 36344
Buggy source:
@Override public void onBindViewHolder(ContributorViewHolder holder,int position){
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ContributorViewHolder holder,int position){
  holder.contributorMail.setText(contributors.get(position).getEmail());
  holder.contributorGit.setText(contributors.get(position).getGithubProfile());
  holder.contributorRole.setText(contributors.get(position).getRole());
  holder.contributorName.setText(contributors.get(position).getName());
  holder.contributorId.setText(contributors.get(position).getContributorId());
}
Program: 36345
Project: 36345
Buggy source:
void initializeLayouts(){
  dl=(DrawerLayout)findViewById(R.id.drawer_layout);
  lv=(ListView)findViewById(R.id.lvDrawer);
  topics=getResources().getStringArray(R.array.title_section);
  ArrayList<String> stringList=new ArrayList<String>(Arrays.asList(topics));
  lv.setAdapter(new NavigationDrawerAdapter(this,R.layout.drawer_menu_item,stringList));
  lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      android.support.v4.app.FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
      android.support.v4.app.Fragment frag=null;
switch (position) {
case 0:
        frag=TimeTableFragment.newInstance();
      break;
case 1:
    frag=CoursesFragment.newInstance();
  break;
case 2:
frag=FriendsFragment.newInstance();
break;
case 3:
frag=SettingsFragment.newInstance();
break;
}
ft.replace(R.id.flContent,frag,topics[position]).addToBackStack(null).commit();
}
}
);
getSupportFragmentManager().beginTransaction().add(R.id.flContent,new MainFragment(),"String_Node_Str").commit();
}

Fixed version (ground truth):
void initializeLayouts(){
  dl=(DrawerLayout)findViewById(R.id.drawer_layout);
  lv=(ListView)findViewById(R.id.lvDrawer);
  topics=getResources().getStringArray(R.array.topic);
  ArrayList<String> stringList=new ArrayList<String>(Arrays.asList(topics));
  lv.setAdapter(new NavigationDrawerAdapter(this,R.layout.drawer_menu_item,stringList));
  lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      android.support.v4.app.FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
      android.support.v4.app.Fragment frag=null;
switch (position) {
case 0:
        frag=MainFragment.newInstance();
      break;
case 1:
    frag=CoursesFragment.newInstance();
  break;
case 2:
frag=TimeTableFragment.newInstance();
break;
case 3:
frag=FriendsFragment.newInstance();
break;
case 4:
frag=SettingsFragment.newInstance();
break;
}
ft.replace(R.id.flContent,frag,topics[position]).addToBackStack(null).commit();
}
}
);
getSupportFragmentManager().beginTransaction().add(R.id.flContent,new MainFragment(),"String_Node_Str").commit();
}
Program: 36346
Project: 36346
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  android.support.v4.app.FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  android.support.v4.app.Fragment frag=null;
switch (position) {
case 0:
    frag=TimeTableFragment.newInstance();
  break;
case 1:
frag=CoursesFragment.newInstance();
break;
case 2:
frag=FriendsFragment.newInstance();
break;
case 3:
frag=SettingsFragment.newInstance();
break;
}
ft.replace(R.id.flContent,frag,topics[position]).addToBackStack(null).commit();
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  android.support.v4.app.FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  android.support.v4.app.Fragment frag=null;
switch (position) {
case 0:
    frag=MainFragment.newInstance();
  break;
case 1:
frag=CoursesFragment.newInstance();
break;
case 2:
frag=TimeTableFragment.newInstance();
break;
case 3:
frag=FriendsFragment.newInstance();
break;
case 4:
frag=SettingsFragment.newInstance();
break;
}
ft.replace(R.id.flContent,frag,topics[position]).addToBackStack(null).commit();
}
Program: 36347
Project: 36347
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  TextView textView=new TextView(getActivity());
  textView.setText(R.string.hello_blank_fragment);
  return textView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  TextView textView=new TextView(getActivity());
  textView.setText("String_Node_Str");
  return textView;
}
Program: 36348
Project: 36348
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.friends_fragment,container,false);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  TextView textView=new TextView(getActivity());
  textView.setText("String_Node_Str");
  return textView;
}
Program: 36349
Project: 36349
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_main,container,false);
  String planet=getResources().getStringArray(R.array.planets_array)[0];
  int imageId=getResources().getIdentifier(planet.toLowerCase(Locale.getDefault()),"String_Node_Str",getActivity().getPackageName());
  getActivity().setTitle(planet);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  String topics=getResources().getStringArray(R.array.topic)[0];
  getActivity().setTitle(topics);
  TextView textView=new TextView(getActivity());
  textView.setText("String_Node_Str");
  return textView;
}
Program: 36350
Project: 36350
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.settings_fragment,container,false);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  TextView textView=new TextView(getActivity());
  textView.setText("String_Node_Str");
  return textView;
}
Program: 36351
Project: 36351
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.timetable_fragment,container,false);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  TextView textView=new TextView(getActivity());
  textView.setText("String_Node_Str");
  return textView;
}
Program: 36352
Project: 36352
Buggy source:
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder,int position){
  CourseViewHolder cvHolder=(CourseViewHolder)holder;
  cvHolder.courseCode.setText(courses.get(position).courseCode);
  cvHolder.courseName.setText(courses.get(position).courseName);
  cvHolder.photo.setImageResource(courses.get(position).photoResourceId);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(CourseViewHolder holder,int position){
  CourseViewHolder cvHolder=(CourseViewHolder)holder;
  cvHolder.courseCode.setText(courses.get(position).courseCode);
  cvHolder.courseName.setText(courses.get(position).courseName);
  cvHolder.photo.setImageResource(courses.get(position).photoResourceId);
}
Program: 36353
Project: 36353
Buggy source:
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.bLogin:
    Intent i=new Intent(LoginActivity.class,this);
  break;
case R.id.bRefresh:
}
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.bLogin:
    Intent i=new Intent(MainActivity.this,LoginActivity.class);
  startActivity(i);
break;
case R.id.bRefresh:
}
}
Program: 36354
Project: 36354
Buggy source:
public void firstUser(final onTaskCompleted listener){
  refreshCredentials();
class bgTask extends AsyncTask<Void,Void,Object> {
    Exception e;
    @Override protected Object doInBackground(    Void... params){
      try {
        if (!isConnected())         throw new Exception("String_Node_Str");
        Response temp=HomeCall.sendRequest(regno,dob,campus,"String_Node_Str");
        if (temp.getStatus().getCode() == 0) {
          DataHandler.getInstance(context).saveFirstJSON(HomeCall.json_response);
          return temp;
        }
 else         throw new Exception(temp.getStatus().getMessage());
      }
 catch (      Exception e) {
        this.e=e;
      }
      return null;
    }
    @Override protected void onPostExecute(    Object o){
      super.onPostExecute(o);
      listener.onCompleted(o,e);
    }
  }
  loginUser(new onTaskCompleted(){
    @Override public void onCompleted(    Object result,    Exception e){
      if (e == null)       new bgTask().execute();
 else       listener.onCompleted(null,e);
    }
  }
);
}

Fixed version (ground truth):
public void firstUser(final onTaskCompleted listener){
  refreshCredentials();
class bgTask extends AsyncTask<Void,Void,Object> {
    Exception e;
    @Override protected Object doInBackground(    Void... params){
      try {
        if (!isConnected())         throw new Exception("String_Node_Str");
        Response temp=HomeCall.sendRequest(regno,dob,campus,"String_Node_Str");
        if (temp.getStatus().getCode() == 0) {
          DataHandler.getInstance(context).saveFirstJSON(HomeCall.json_response);
          DataHandler.getInstance(context).saveRefreshJSON(HomeCall.json_response);
          return temp;
        }
 else         throw new Exception(temp.getStatus().getMessage());
      }
 catch (      Exception e) {
        this.e=e;
      }
      return null;
    }
    @Override protected void onPostExecute(    Object o){
      super.onPostExecute(o);
      listener.onCompleted(o,e);
    }
  }
  loginUser(new onTaskCompleted(){
    @Override public void onCompleted(    Object result,    Exception e){
      if (e == null)       new bgTask().execute();
 else       listener.onCompleted(null,e);
    }
  }
);
}
Program: 36355
Project: 36355
Buggy source:
public ViewHolder(View itemView){
  super(itemView);
  itemView.setOnClickListener(FriendsAdapter.this);
  itemView.setOnLongClickListener(FriendsAdapter.this);
  image=(ImageView)itemView.findViewById(R.id.img_profile);
  name=(TextView)itemView.findViewById(R.id.lbl_title);
  status=(TextView)itemView.findViewById(R.id.lbl_status);
  endsin=(TextView)itemView.findViewById(R.id.lbl_endsin);
  venue=(TextView)itemView.findViewById(R.id.lbl_venue);
}

Fixed version (ground truth):
public ViewHolder(View itemView){
  super(itemView);
  image=(ImageView)itemView.findViewById(R.id.img_profile);
  name=(TextView)itemView.findViewById(R.id.lbl_title);
  status=(TextView)itemView.findViewById(R.id.lbl_status);
  endsin=(TextView)itemView.findViewById(R.id.lbl_endsin);
  venue=(TextView)itemView.findViewById(R.id.lbl_venue);
}
Program: 36356
Project: 36356
Buggy source:
@Override public ViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
  View v=LayoutInflater.from(parent.getContext()).inflate(itemLayout,parent,false);
  return new ViewHolder(v);
}

Fixed version (ground truth):
@Override public FriendsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
  View v=LayoutInflater.from(parent.getContext()).inflate(itemLayout,parent,false);
  v.setOnClickListener(FriendsAdapter.this);
  v.setOnLongClickListener(FriendsAdapter.this);
  return new ViewHolder(v);
}
Program: 36357
Project: 36357
Buggy source:
@Override public void onBindViewHolder(ViewHolder holder,int position){
  Friend f=friends.get(position);
  if (f.isFb && f.img_profile != null)   holder.image.setImageBitmap(f.img_profile);
  holder.name.setText(f.title);
  TimeTable t=new TimeTable(context);
  if (t.getFriendStatus(f.timetable)) {
    holder.status.setText("String_Node_Str");
    holder.status.setTextColor(Color.parseColor("String_Node_Str"));
    holder.venue.setText("String_Node_Str" + t.FreindEndsIn);
  }
 else {
    holder.status.setText("String_Node_Str");
    holder.status.setTextColor(Color.parseColor("String_Node_Str"));
    holder.endsin.setText("String_Node_Str");
  }
  holder.venue.setText(t.FriendVenue);
  holder.itemView.setTag(f);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ViewHolder holder,int position){
  Friend f=friends.get(position);
  if (f.isFb && f.img_profile != null)   holder.image.setImageBitmap(f.img_profile);
 else   holder.image.setImageBitmap(BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_action_person));
  holder.name.setText(f.title);
  TimeTable t=new TimeTable(context);
  if (t.getFriendStatus(f.timetable)) {
    holder.status.setText("String_Node_Str");
    holder.status.setTextColor(Color.parseColor("String_Node_Str"));
    holder.venue.setText("String_Node_Str" + t.FreindEndsIn);
  }
 else {
    holder.status.setText("String_Node_Str");
    holder.status.setTextColor(Color.parseColor("String_Node_Str"));
    holder.endsin.setText("String_Node_Str");
  }
  holder.venue.setText(t.FriendVenue);
  holder.itemView.setTag(f);
}
Program: 36358
Project: 36358
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_friends,container,false);
  Tracker t=((Application)getActivity().getApplication()).getTracker(Application.TrackerName.GLOBAL_TRACKER);
  t.setScreenName("String_Node_Str");
  t.send(new HitBuilders.AppViewBuilder().build());
  mPullToRefreshLayout=(SwipeRefreshLayout)v.findViewById(R.id.friends_pull);
  mPullToRefreshLayout.setEnabled(false);
  mPullToRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.HoloBright),getResources().getColor(R.color.HoloOrange),getResources().getColor(R.color.HoloGreen),getResources().getColor(R.color.HoloRed));
  listView=(RecyclerView)v.findViewById(R.id.enhanced_list);
  listView.setLayoutManager(new LinearLayoutManager(getActivity()));
  setHasOptionsMenu(true);
  dat=new DataHandler(getActivity());
  zxingLibConfig=new ZXingLibConfig();
  zxingLibConfig.useFrontLight=true;
  new Load_Data().execute();
  refresh_data=new Refresh_Data();
  refresh_data.execute();
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_friends,container,false);
  Tracker t=((Application)getActivity().getApplication()).getTracker(Application.TrackerName.GLOBAL_TRACKER);
  t.setScreenName("String_Node_Str");
  t.send(new HitBuilders.AppViewBuilder().build());
  mPullToRefreshLayout=(SwipeRefreshLayout)v.findViewById(R.id.friends_pull);
  mPullToRefreshLayout.setEnabled(false);
  mPullToRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.HoloBright),getResources().getColor(R.color.HoloOrange),getResources().getColor(R.color.HoloGreen),getResources().getColor(R.color.HoloRed));
  listView=(RecyclerView)v.findViewById(R.id.enhanced_list);
  listView.setLayoutManager(new LinearLayoutManager(getActivity()));
  listView.setHasFixedSize(false);
  setHasOptionsMenu(true);
  dat=new DataHandler(getActivity());
  zxingLibConfig=new ZXingLibConfig();
  zxingLibConfig.useFrontLight=true;
  new Load_Data().execute();
  refresh_data=new Refresh_Data();
  refresh_data.execute();
  return v;
}
Program: 36360
Project: 36360
Buggy source:
@Override protected Void doInBackground(Void... voids){
  try {
    HttpResponse res=getResponse(FRIEND_TIMETABLE_URL);
    if (res.getStatusLine().getStatusCode() == 403 || res.getStatusLine().getStatusCode() == 503) {
      e=new Exception("String_Node_Str");
      return null;
    }
    String result=EntityUtils.toString(res.getEntity());
    Friend f=new Friend();
    f.regno=Friend_regno;
    f.dob=Friend_dob;
    f.title=Friend_regno;
    ParseQuery<ParseUser> query=ParseUser.getQuery();
    ParseUser u=(query.whereEqualTo("String_Node_Str",f.regno)).getFirst();
    String isIt=u.getString("String_Node_Str");
    if (isIt != null && isIt.equals("String_Node_Str")) {
      f.isFb=true;
      f.fbId=u.getString("String_Node_Str");
      f.title=u.getString("String_Node_Str");
      Ion.with(dat.context).load("String_Node_Str" + f.fbId + "String_Node_Str").write(new File(dat.context.getCacheDir().getPath() + "String_Node_Str" + f.fbId+ "String_Node_Str")).get();
    }
    f.timetable=result;
    dat.addFriend(f);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
    e=new Exception("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... voids){
  try {
    HttpResponse res=getResponse(FRIEND_TIMETABLE_URL);
    if (res.getStatusLine().getStatusCode() == 403 || res.getStatusLine().getStatusCode() == 503) {
      e=new Exception("String_Node_Str");
      return null;
    }
    String result=EntityUtils.toString(res.getEntity());
    Friend f=new Friend();
    f.regno=Friend_regno;
    f.dob=Friend_dob;
    f.title=Friend_regno;
    ParseQuery<ParseUser> query=ParseUser.getQuery();
    ParseUser u=(query.whereEqualTo("String_Node_Str",f.regno)).getFirst();
    String isIt=u.getString("String_Node_Str");
    if (isIt != null && isIt.equals("String_Node_Str")) {
      f.isFb=true;
      f.fbId=u.getString("String_Node_Str");
      f.title=u.getString("String_Node_Str");
      Ion.with(dat.context).load("String_Node_Str" + f.fbId + "String_Node_Str").write(new File(dat.context.getCacheDir().getPath() + "String_Node_Str" + f.fbId+ "String_Node_Str")).get();
    }
    f.timetable=result;
    try {
      new JSONObject(f.timetable);
    }
 catch (    JSONException e1) {
      e=new Exception("String_Node_Str");
      return null;
    }
    dat.addFriend(f);
  }
 catch (  Exception e1) {
    e1.printStackTrace();
    e=new Exception("String_Node_Str");
  }
  return null;
}
Program: 36361
Project: 36361
Buggy source:
@Override protected Void doInBackground(Void... voids){
  try {
    friends=new DataHandler(getActivity()).getFreinds();
    for (int i=0; i < friends.size(); i++) {
      if (!friends.get(i).isFb) {
        ParseQuery<ParseUser> query=ParseUser.getQuery();
        ParseUser u=(query.whereEqualTo("String_Node_Str",friends.get(i).regno)).getFirst();
        String isIt=u.getString("String_Node_Str");
        if (isIt != null && isIt.equals("String_Node_Str")) {
          friends.get(i).isFb=true;
          friends.get(i).fbId=u.get("String_Node_Str").toString();
          friends.get(i).title=u.get("String_Node_Str").toString();
          needSaving=true;
        }
      }
    }
    if (needSaving)     dat.saveFriends(friends);
    downloadProfileImage(friends);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... voids){
  if (!haveNetworkConnection())   return null;
  try {
    friends=new DataHandler(getActivity()).getFreinds();
    for (int i=0; i < friends.size(); i++) {
      if (!friends.get(i).isFb) {
        ParseQuery<ParseUser> query=ParseUser.getQuery();
        ParseUser u=(query.whereEqualTo("String_Node_Str",friends.get(i).regno)).getFirst();
        String isIt=u.getString("String_Node_Str");
        if (isIt != null && isIt.equals("String_Node_Str")) {
          friends.get(i).isFb=true;
          friends.get(i).fbId=u.get("String_Node_Str").toString();
          friends.get(i).title=u.get("String_Node_Str").toString();
          needSaving=true;
        }
      }
    }
    if (needSaving)     dat.saveFriends(friends);
    downloadProfileImage(friends);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 36362
Project: 36362
Buggy source:
public static void DELETE_ALL_DATA(Context context){
  PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit();
}

Fixed version (ground truth):
public static void DELETE_ALL_DATA(Context context){
  PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit();
  context.deleteDatabase("String_Node_Str");
}
Program: 36363
Project: 36363
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_attendance_details,container,false);
  tv_title=(TextView)v.findViewById(R.id.title_detailed);
  tv_slot=(TextView)v.findViewById(R.id.slot_detailed);
  tv_code=(TextView)v.findViewById(R.id.code_detailed);
  tv_type=(TextView)v.findViewById(R.id.type_detailed);
  tv_atten=(TextView)v.findViewById(R.id.atten_detailed);
  tv_net_per=(TextView)v.findViewById(R.id.net_per);
  atten_updated_date=(TextView)v.findViewById(R.id.atten_lastUpdatedDate);
  atten_updated_status=(TextView)v.findViewById(R.id.atten_lastUpdatedStatus);
  bunk_val=(TextView)v.findViewById(R.id.bunk_val);
  makeup_val=(TextView)v.findViewById(R.id.makeup_val);
  progBar=(ProgressBar)v.findViewById(R.id.progressBar_detailed);
  bunk_add=(Button)v.findViewById(R.id.bunk_add);
  bunk_sub=(Button)v.findViewById(R.id.bunk_sub);
  makeup_add=(Button)v.findViewById(R.id.makeup_add);
  makeup_sub=(Button)v.findViewById(R.id.makeup_sub);
  bunk_add.setOnClickListener(ocl);
  bunk_sub.setOnClickListener(ocl);
  makeup_add.setOnClickListener(ocl);
  makeup_sub.setOnClickListener(ocl);
  load();
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragment_attendance_details,container,false);
  tv_title=(TextView)v.findViewById(R.id.title_detailed);
  tv_slot=(TextView)v.findViewById(R.id.slot_detailed);
  tv_code=(TextView)v.findViewById(R.id.code_detailed);
  tv_type=(TextView)v.findViewById(R.id.type_detailed);
  tv_atten=(TextView)v.findViewById(R.id.atten_detailed);
  tv_net_per=(TextView)v.findViewById(R.id.net_per);
  bunk_val=(TextView)v.findViewById(R.id.bunk_val);
  makeup_val=(TextView)v.findViewById(R.id.makeup_val);
  progBar=(ProgressBar)v.findViewById(R.id.progressBar_detailed);
  bunk_add=(Button)v.findViewById(R.id.bunk_add);
  bunk_sub=(Button)v.findViewById(R.id.bunk_sub);
  makeup_add=(Button)v.findViewById(R.id.makeup_add);
  makeup_sub=(Button)v.findViewById(R.id.makeup_sub);
  bunk_add.setOnClickListener(ocl);
  bunk_sub.setOnClickListener(ocl);
  makeup_add.setOnClickListener(ocl);
  makeup_sub.setOnClickListener(ocl);
  load();
  return v;
}
Program: 36364
Project: 36364
Buggy source:
public void saveRegNo(String regno){
  saveString("String_Node_Str",regno);
}

Fixed version (ground truth):
public void saveRegNo(String regno){
  saveString("String_Node_Str",regno.trim());
}
Program: 36365
Project: 36365
Buggy source:
public ArrayList<TTSlot> getTT(int Day){
  ArrayList<TTSlot> today=new ArrayList<TTSlot>();
  if (Day == Calendar.SUNDAY || Day == Calendar.SATURDAY)   Day=Calendar.MONDAY;
  set_day(Day);
  try {
    Calendar calendar=Calendar.getInstance();
    calendar.set(Calendar.DAY_OF_WEEK,Day);
    SimpleDateFormat dayFormat=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
    JSONObject root=new JSONObject(dat.getTimeTable());
    JSONArray subs=root.getJSONArray("String_Node_Str");
    root=root.getJSONObject("String_Node_Str");
    JSONArray json_slts=root.getJSONArray(dayFormat.format(calendar.getTime()));
    TTSlot temp;
    String clsnbr, slt="String_Node_Str";
    for (int i=0; i < json_slts.length(); i++) {
      if (json_slts.getInt(i) != 0) {
        clsnbr=Integer.toString(json_slts.getInt(i));
        Subject sub=dat.getSubject(clsnbr);
        if (sub.slot.contains("String_Node_Str")) {
          String[] parts=sub.slot.split("String_Node_Str");
          for (int j=0; j < parts.length; j++) {
            if (slts_today[i].toUpperCase().equals(parts[j])) {
              slt=parts[j];
              break;
            }
          }
        }
 else         slt=sub.slot;
        temp=new TTSlot(slt,clsnbr);
        temp.venue=getVenue(subs,clsnbr);
        temp.setTime(i);
        today.add(temp);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return today;
}

Fixed version (ground truth):
public ArrayList<TTSlot> getTT(int Day){
  ArrayList<TTSlot> today=new ArrayList<TTSlot>();
  if (Day == Calendar.SUNDAY || Day == Calendar.SATURDAY)   Day=Calendar.MONDAY;
  set_day(Day);
  try {
    Calendar calendar=Calendar.getInstance();
    calendar.set(Calendar.DAY_OF_WEEK,Day);
    SimpleDateFormat dayFormat=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
    JSONObject root=new JSONObject(dat.getTimeTable());
    JSONArray subs=root.getJSONArray("String_Node_Str");
    root=root.getJSONObject("String_Node_Str");
    JSONArray json_slts=root.getJSONArray(dayFormat.format(calendar.getTime()));
    TTSlot temp;
    String clsnbr, slt="String_Node_Str";
    for (int i=0; i < json_slts.length(); i++) {
      if (json_slts.getInt(i) != 0) {
        clsnbr=Integer.toString(json_slts.getInt(i));
        Subject sub=dat.getSubject(clsnbr);
        if (sub.slot.contains("String_Node_Str")) {
          int tmp;
          String[] parts=sub.slot.split("String_Node_Str");
          for (int j=0; j < parts.length; j++) {
            if (parts[j].charAt(0) == 'L')             tmp=i + 10;
 else             tmp=i;
            if (slts_today[tmp].toUpperCase().equals(parts[j])) {
              slt=parts[j];
              break;
            }
          }
        }
 else         slt=sub.slot;
        temp=new TTSlot(slt,clsnbr);
        temp.venue=getVenue(subs,clsnbr);
        temp.setTime(i);
        today.add(temp);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return today;
}
Program: 36366
Project: 36366
Buggy source:
@Override protected Void doInBackground(Void... voids){
  subs.add(new NowListHeader("String_Node_Str"));
  TimeTable tt=new TimeTable(cntx);
  int today=Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
  if (today == Calendar.SUNDAY || today == Calendar.SATURDAY) {
    subs.add(new NowListNoClass());
    subs.add(new NowListHeader("String_Node_Str"));
    today=Calendar.MONDAY;
    ttSlots=tt.getTT(today);
  }
 else {
    ttSlots=tt.getTT(today);
    boolean noClass=true;
    Calendar temp=Calendar.getInstance();
    for (int i=0; i < ttSlots.size(); i++) {
      if (temp.compareTo(ttSlots.get(i).frm_time) >= 0 && temp.compareTo(ttSlots.get(i).to_time) < 0) {
        noClass=false;
        subs.add(new NowListItem(cntx,ttSlots.get(i)));
        subs.remove(i);
        break;
      }
    }
    if (noClass)     subs.add(new NowListNoClass());
    subs.add(new NowListHeader("String_Node_Str"));
  }
  for (int i=0; i < ttSlots.size(); i++) {
    subs.add(new NowListItem(cntx,ttSlots.get(i)));
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... voids){
  subs.add(new NowListHeader("String_Node_Str"));
  TimeTable tt=new TimeTable(cntx);
  int today=Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
  if (today == Calendar.SUNDAY || today == Calendar.SATURDAY) {
    subs.add(new NowListNoClass());
    subs.add(new NowListHeader("String_Node_Str"));
    today=Calendar.MONDAY;
    ttSlots=tt.getTT(today);
  }
 else {
    ttSlots=tt.getTT(today);
    boolean noClass=true;
    Calendar temp=Calendar.getInstance();
    for (int i=0; i < ttSlots.size(); i++) {
      if (temp.compareTo(ttSlots.get(i).frm_time) >= 0 && temp.compareTo(ttSlots.get(i).to_time) < 0) {
        noClass=false;
        subs.add(new NowListItem(cntx,ttSlots.get(i)));
        ttSlots.remove(i);
        break;
      }
    }
    if (noClass)     subs.add(new NowListNoClass());
    subs.add(new NowListHeader("String_Node_Str"));
  }
  for (int i=0; i < ttSlots.size(); i++) {
    subs.add(new NowListItem(cntx,ttSlots.get(i)));
  }
  return null;
}
Program: 36367
Project: 36367
Buggy source:
/** 
 * 增加参数
 * @param name
 * @param value
 * @param urlEncoding
 * @return
 */
public HttpBuilder param(String name,String value,boolean urlEncoding){
  String encodedValue=null;
  if (urlEncoding) {
    try {
      encodedValue=URLEncoder.encode(value,charset.name());
    }
 catch (    UnsupportedEncodingException e) {
      Logger.error(e);
    }
  }
  if (encodedValue == null) {
    encodedValue=value;
  }
  NameValuePair nameValuePair=new BasicNameValuePair(name,encodedValue);
  this.nameValuePairs.add(nameValuePair);
  return this;
}

Fixed version (ground truth):
/** 
 * 增加参数
 * @param name
 * @param value
 * @param urlEncoding
 * @return
 */
public HttpBuilder param(String name,String value,boolean urlEncoding){
  String encodedValue=null;
  if (urlEncoding && value != null) {
    try {
      encodedValue=URLEncoder.encode(value,charset.name());
    }
 catch (    UnsupportedEncodingException e) {
      Logger.error(e);
    }
  }
  if (encodedValue == null) {
    encodedValue=value;
  }
  NameValuePair nameValuePair=new BasicNameValuePair(name,encodedValue);
  this.nameValuePairs.add(nameValuePair);
  return this;
}
Program: 36368
Project: 36368
Buggy source:
@Nullable @Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",element) + "String_Node_Str";
}

Fixed version (ground truth):
@Nullable @Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",element) + "String_Node_Str";
}
Program: 36369
Project: 36369
Buggy source:
@NotNull protected String getStringTemplate(@NotNull PsiExpression expr){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",expr) + "String_Node_Str";
}

Fixed version (ground truth):
@NotNull protected String getStringTemplate(@NotNull PsiElement context){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",context) + "String_Node_Str";
}
Program: 36370
Project: 36370
Buggy source:
@Nullable @Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",element) + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",element) + (isTopmostExpression(element) ? "String_Node_Str" : "String_Node_Str");
}
Program: 36371
Project: 36371
Buggy source:
public CheckNotNullPostfixTemplate(){
  super("String_Node_Str","String_Node_Str",JAVA_PSI_INFO,IS_NON_VOID);
}

Fixed version (ground truth):
public CheckNotNullPostfixTemplate(){
  super("String_Node_Str","String_Node_Str",JAVA_PSI_INFO,IS_NOT_PRIMITIVE);
}
Program: 36372
Project: 36372
Buggy source:
@NotNull private String getStringTemplate(@NotNull PsiExpression expr){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",expr) + "String_Node_Str";
}

Fixed version (ground truth):
@NotNull private String getStringTemplate(@NotNull PsiExpression expr){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",expr) + "String_Node_Str";
}
Program: 36373
Project: 36373
Buggy source:
@NotNull private String getStringTemplate(@NotNull PsiExpression expr){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",expr) + "String_Node_Str";
}

Fixed version (ground truth):
@NotNull private String getStringTemplate(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",element) + "String_Node_Str";
}
Program: 36374
Project: 36374
Buggy source:
@Nullable @Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS.getClassName(),"String_Node_Str",element) + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(PRECONDITIONS,"String_Node_Str",element) + "String_Node_Str";
}
Program: 36375
Project: 36375
Buggy source:
protected ImmutableBasePostfixTemplate(@NotNull String key,@NotNull String example,@NotNull GuavaClassName className,@NotNull String methodName){
  super(key,example,JAVA_PSI_INFO);
  this.className=className;
  this.methodName=methodName;
}

Fixed version (ground truth):
protected ImmutableBasePostfixTemplate(@NotNull String key,@NotNull String example,@NotNull GuavaClassName className,@NotNull String methodName){
  super(key,example,JAVA_PSI_INFO,IS_NON_PRIMITIVE_ARRAY_OR_ITERABLE_OR_ITERATOR);
  this.className=className;
  this.methodName=methodName;
}
Program: 36376
Project: 36376
Buggy source:
@Override public final String getTemplateString(@NotNull PsiElement element){
  return FQ_METHOD_ON + "String_Node_Str";
}

Fixed version (ground truth):
@Override public final String getTemplateString(@NotNull PsiElement element){
  return getStaticMethodPrefix(JOINER,"String_Node_Str",element) + "String_Node_Str" + (isTopmostExpression(element) ? "String_Node_Str" : "String_Node_Str");
}
Program: 36377
Project: 36377
Buggy source:
public static void callbackRegister(IWailaRegistrar registrar){
  WailaHandler instance=new WailaHandler();
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.addConfig("String_Node_Str","String_Node_Str","String_Node_Str");
  registrar.registerBodyProvider(instance,Block.class);
}

Fixed version (ground truth):
public static void callbackRegister(IWailaRegistrar registrar){
  WailaHandler instance=new WailaHandler();
  for (  Map.Entry<String,Boolean> entry : configOptions.entrySet()) {
    ConfigHandler.instance().getConfig(entry.getKey(),entry.getValue());
    registrar.addConfig("String_Node_Str",entry.getKey(),"String_Node_Str" + entry.getKey());
  }
  registrar.registerBodyProvider(instance,Block.class);
}
Program: 36379
Project: 36379
Buggy source:
@Override public void run(){
  final ConsumerIterator<byte[],EventMessage> it=stream.iterator();
  LOGGER.debug("String_Node_Str",cluster.getName());
  while (it.hasNext()) {
    final EventMessage message=it.next().message();
    final String topic=topicStrategy.getTopic(message);
    try {
      cluster.publish(message);
      LOGGER.info("String_Node_Str",message.getIdentifier(),topic,message.getPayload());
      metricHelper.markReceivedMessage(topic);
    }
 catch (    Throwable t) {
      LOGGER.error("String_Node_Str",message.getIdentifier(),topic,t);
      metricHelper.markErroredWhileReceivingMessage(topic);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final ConsumerIterator<byte[],EventMessage> it=stream.iterator();
  LOGGER.debug("String_Node_Str",cluster.getName());
  while (it.hasNext()) {
    final EventMessage message=it.next().message();
    final String event=message.getPayloadType().getSimpleName();
    try {
      cluster.publish(message);
      LOGGER.info("String_Node_Str",event,message.getIdentifier());
      metricHelper.markReceivedMessage(event);
    }
 catch (    Throwable t) {
      LOGGER.error("String_Node_Str",event,message.getIdentifier(),t);
      metricHelper.markErroredWhileReceivingMessage(event);
    }
  }
}
Program: 36380
Project: 36380
Buggy source:
public KafkaStreamListener(final Cluster cluster,final KafkaStream<byte[],EventMessage> stream,final KafkaMetricHelper metricHelper,final TopicStrategy topicStrategy){
  this.cluster=checkNotNull(cluster);
  this.stream=checkNotNull(stream);
  this.metricHelper=checkNotNull(metricHelper);
  this.topicStrategy=checkNotNull(topicStrategy);
}

Fixed version (ground truth):
public KafkaStreamListener(final Cluster cluster,final KafkaStream<byte[],EventMessage> stream,final KafkaMetricHelper metricHelper){
  this.cluster=checkNotNull(cluster);
  this.stream=checkNotNull(stream);
  this.metricHelper=checkNotNull(metricHelper);
}
Program: 36381
Project: 36381
Buggy source:
public KafkaClusterListener(final ConsumerFactory consumerFactory,final KafkaMetricHelper metricHelper,final TopicStrategy topicStrategy,final Cluster cluster,final int numberOfStreamListener){
  checkNotNull(consumerFactory);
  checkNotNull(metricHelper);
  checkNotNull(topicStrategy);
  checkNotNull(cluster);
  checkArgument(numberOfStreamListener > 0,"String_Node_Str");
  final ThreadFactory threadFactory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str" + cluster.getName() + "String_Node_Str").build();
  this.executor=Executors.newFixedThreadPool(numberOfStreamListener,threadFactory);
  this.consumer=consumerFactory.createConnector(cluster.getName());
  final List<KafkaStream<byte[],EventMessage>> streams=consumerFactory.createStreams(numberOfStreamListener,consumer);
  for (  final KafkaStream<byte[],EventMessage> stream : streams) {
    executor.submit(new KafkaStreamListener(cluster,stream,metricHelper,topicStrategy));
  }
  LOGGER.debug("String_Node_Str",cluster.getName());
}

Fixed version (ground truth):
public KafkaClusterListener(final ConsumerFactory consumerFactory,final KafkaMetricHelper metricHelper,final TopicStrategy topicStrategy,final Cluster cluster,final int numberOfStreamListener){
  checkNotNull(consumerFactory);
  checkNotNull(metricHelper);
  checkNotNull(topicStrategy);
  checkNotNull(cluster);
  checkArgument(numberOfStreamListener > 0,"String_Node_Str");
  final ThreadFactory threadFactory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str" + cluster.getName() + "String_Node_Str").build();
  this.executor=Executors.newFixedThreadPool(numberOfStreamListener,threadFactory);
  this.consumer=consumerFactory.createConnector(cluster.getName());
  final List<KafkaStream<byte[],EventMessage>> streams=consumerFactory.createStreams(numberOfStreamListener,consumer);
  for (  final KafkaStream<byte[],EventMessage> stream : streams) {
    executor.submit(new KafkaStreamListener(cluster,stream,metricHelper));
  }
  LOGGER.debug("String_Node_Str",cluster.getName());
}
Program: 36382
Project: 36382
Buggy source:
public void markReceivedMessage(final String topic){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}

Fixed version (ground truth):
public void markReceivedMessage(final String event){
  metricRegistry.meter(prefix + "String_Node_Str" + event+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}
Program: 36383
Project: 36383
Buggy source:
public void markSentMessage(final String topic){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}

Fixed version (ground truth):
public void markSentMessage(final String topic,final String event){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str" + event+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}
Program: 36384
Project: 36384
Buggy source:
public void markErroredWhileReceivingMessage(final String topic){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}

Fixed version (ground truth):
public void markErroredWhileReceivingMessage(final String event){
  metricRegistry.meter(prefix + "String_Node_Str" + event+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}
Program: 36385
Project: 36385
Buggy source:
public void markErroredWhileSendingMessage(final String topic){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}

Fixed version (ground truth):
public void markErroredWhileSendingMessage(final String topic,final String event){
  metricRegistry.meter(prefix + "String_Node_Str" + topic+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str" + event+ "String_Node_Str").mark();
  metricRegistry.meter(prefix + "String_Node_Str").mark();
}
Program: 36386
Project: 36386
Buggy source:
public KafkaMetricHelper(final MetricRegistry metricRegistry,final String prefix){
  this.metricRegistry=metricRegistry;
  this.prefix=prefix;
}

Fixed version (ground truth):
public KafkaMetricHelper(final MetricRegistry metricRegistry,final String prefix){
  this.metricRegistry=checkNotNull(metricRegistry);
  this.prefix=checkNotNull(prefix);
}
Program: 36387
Project: 36387
Buggy source:
protected void publish(final KeyedMessage<String,EventMessage> message){
  final String topic=message.topic();
  try {
    producer.send(message);
    LOGGER.debug("String_Node_Str",message.key(),topic);
    metricHelper.markSentMessage(topic);
  }
 catch (  Throwable t) {
    LOGGER.error("String_Node_Str",message.key(),topic,t);
    metricHelper.markErroredWhileSendingMessage(topic);
  }
}

Fixed version (ground truth):
protected void publish(final KeyedMessage<String,EventMessage> message){
  final String event=message.message().getPayloadType().getSimpleName();
  final String topic=message.topic();
  try {
    producer.send(message);
    LOGGER.debug("String_Node_Str",event,message.key(),topic);
    metricHelper.markSentMessage(topic,event);
  }
 catch (  Throwable t) {
    LOGGER.error("String_Node_Str",event,message.key(),topic,t);
    metricHelper.markErroredWhileSendingMessage(topic,event);
  }
}
Program: 36388
Project: 36388
Buggy source:
@Test public void markErroredWhileSendingMessage_markTwoMeters(){
  final String prefix="String_Node_Str";
  final KafkaMetricHelper kafkaMetricHelper=new KafkaMetricHelper(metricRegistry,prefix);
  kafkaMetricHelper.markErroredWhileSendingMessage("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(meter,times(2)).mark();
}

Fixed version (ground truth):
@Test public void markErroredWhileSendingMessage_markTwoMeters(){
  final String prefix="String_Node_Str";
  final KafkaMetricHelper kafkaMetricHelper=new KafkaMetricHelper(metricRegistry,prefix);
  kafkaMetricHelper.markErroredWhileSendingMessage("String_Node_Str","String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(meter,times(3)).mark();
}
Program: 36389
Project: 36389
Buggy source:
@Test public void markSentMessage_markTwoMeters(){
  final String prefix="String_Node_Str";
  final KafkaMetricHelper kafkaMetricHelper=new KafkaMetricHelper(metricRegistry,prefix);
  kafkaMetricHelper.markSentMessage("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(meter,times(2)).mark();
}

Fixed version (ground truth):
@Test public void markSentMessage_markTwoMeters(){
  final String prefix="String_Node_Str";
  final KafkaMetricHelper kafkaMetricHelper=new KafkaMetricHelper(metricRegistry,prefix);
  kafkaMetricHelper.markSentMessage("String_Node_Str","String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(metricRegistry).meter("String_Node_Str");
  verify(meter,times(3)).mark();
}