nus-yam/ex-repair huggingface dataset:
Program: 8671
Project: 8671
Buggy source:
@Override public void onPageSelected(int position){
  Intent intent=new Intent(Constants.BROADCAST_INTENT_TO_MONTH_FRAGMENT);
  intent.putExtra(Constants.BROADCAST_FIELD_TO_MONTH_FRAGMENT,position - Constants.MONTHS_LIMIT / 2);
  getContext().sendBroadcast(intent);
  today.setVisibility(View.VISIBLE);
  todayIcon.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  viewPagerPosition=position - Constants.MONTHS_LIMIT / 2;
  Intent intent=new Intent(Constants.BROADCAST_INTENT_TO_MONTH_FRAGMENT);
  intent.putExtra(Constants.BROADCAST_FIELD_TO_MONTH_FRAGMENT,position - Constants.MONTHS_LIMIT / 2);
  getContext().sendBroadcast(intent);
  today.setVisibility(View.VISIBLE);
  todayIcon.setVisibility(View.VISIBLE);
}
Program: 8674
Project: 8674
Buggy source:
public void drawDial(Canvas canvas){
  Paint markerPaint, circlePaint;
  circlePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  circlePaint.setColor(ContextCompat.getColor(getContext(),R.color.background));
  circlePaint.setStrokeWidth(1);
  circlePaint.setStyle(Paint.Style.STROKE);
  int textHeight=(int)textPaint.measureText("String_Node_Str");
  markerPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  markerPaint.setColor(ContextCompat.getColor(getContext(),R.color.accent));
  canvas.drawCircle(px,py,Radius,circlePaint);
  canvas.drawCircle(px,py,Radius - 20,circlePaint);
  int textWidth=(int)textPaint.measureText("String_Node_Str");
  int cardinalX=px - textWidth / 2;
  int cardinalY=py - Radius + textHeight;
  for (int i=0; i < 24; i++) {
    canvas.drawLine(px,py - Radius,px,py - Radius + 10,markerPaint);
    canvas.save();
    canvas.translate(0,textHeight);
    if (i % 6 == 0) {
      String dirString="String_Node_Str";
switch (i) {
case (0):
{
          dirString=northString;
          break;
        }
case (6):
      dirString=eastString;
    break;
case (12):
  dirString=southString;
break;
case (18):
dirString=westString;
break;
}
canvas.drawText(dirString,cardinalX,cardinalY,textPaint);
}
 else if (i % 3 == 0) {
String angle=String.valueOf(i * 15);
float angleTextWidth=textPaint.measureText(angle);
int angleTextX=(int)(px - angleTextWidth / 2);
int angleTextY=py - Radius + textHeight;
canvas.drawText(angle,angleTextX,angleTextY,textPaint);
}
canvas.restore();
canvas.rotate(15,px,py);
}
}

Fixed version (ground truth):
public void drawDial(Canvas canvas){
  Paint markerPaint, circlePaint;
  circlePaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  circlePaint.setColor(ContextCompat.getColor(getContext(),R.color.text_normal));
  circlePaint.setStrokeWidth(1);
  circlePaint.setStyle(Paint.Style.STROKE);
  int textHeight=(int)textPaint.measureText("String_Node_Str");
  markerPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  markerPaint.setColor(ContextCompat.getColor(getContext(),R.color.text_normal));
  canvas.drawCircle(px,py,Radius,circlePaint);
  canvas.drawCircle(px,py,Radius - 20,circlePaint);
  int textWidth=(int)textPaint.measureText("String_Node_Str");
  int cardinalX=px - textWidth / 2;
  int cardinalY=py - Radius + textHeight;
  for (int i=0; i < 24; i++) {
    canvas.drawLine(px,py - Radius,px,py - Radius + 10,markerPaint);
    canvas.save();
    canvas.translate(0,textHeight);
    if (i % 6 == 0) {
      String dirString="String_Node_Str";
switch (i) {
case (0):
{
          dirString=northString;
          break;
        }
case (6):
      dirString=eastString;
    break;
case (12):
  dirString=southString;
break;
case (18):
dirString=westString;
break;
}
canvas.drawText(dirString,cardinalX,cardinalY,textPaint);
}
 else if (i % 3 == 0) {
String angle=String.valueOf(i * 15);
float angleTextWidth=textPaint.measureText(angle);
int angleTextX=(int)(px - angleTextWidth / 2);
int angleTextY=py - Radius + textHeight;
canvas.drawText(angle,angleTextX,angleTextY,textPaint);
}
canvas.restore();
canvas.rotate(15,px,py);
}
}
Program: 8675
Project: 8675
Buggy source:
public void initCompassView(){
  setFocusable(true);
  initAstronomicParameters();
  northString="String_Node_Str";
  eastString="String_Node_Str";
  southString="String_Node_Str";
  westString="String_Node_Str";
  dashPath=new DashPathEffect(new float[]{2,5},1);
  dashedPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  dashedPaint.setPathEffect(dashPath);
  dashedPaint.setStrokeWidth(2);
  dashedPaint.setPathEffect(dashPath);
  dashedPaint.setColor(ContextCompat.getColor(getContext(),R.color.accent));
  textPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  textPaint.setColor(ContextCompat.getColor(getContext(),(R.color.text_normal)));
  textPaint.setTextSize(20);
}

Fixed version (ground truth):
public void initCompassView(){
  setFocusable(true);
  initAstronomicParameters();
  northString="String_Node_Str";
  eastString="String_Node_Str";
  southString="String_Node_Str";
  westString="String_Node_Str";
  dashPath=new DashPathEffect(new float[]{2,5},1);
  dashedPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  dashedPaint.setPathEffect(dashPath);
  dashedPaint.setStrokeWidth(2);
  dashedPaint.setPathEffect(dashPath);
  dashedPaint.setColor(ContextCompat.getColor(getContext(),R.color.text_normal));
  textPaint=new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
  textPaint.setColor(ContextCompat.getColor(getContext(),(R.color.text_normal)));
  textPaint.setTextSize(20);
}
Program: 8677
Project: 8677
Buggy source:
private void showEvent(PersianDate persianDate){
  String holidays=utils.getHolidayTitle(persianDate);
  String events=utils.getEventTitle(persianDate);
  event.setVisibility(View.GONE);
  holidayTitle.setVisibility(View.GONE);
  eventTitle.setVisibility(View.GONE);
  if (holidays != null) {
    holidayTitle.setText(utils.textShaper(holidays));
    holidayTitle.setVisibility(View.VISIBLE);
    event.setVisibility(View.VISIBLE);
  }
  if (events != null) {
    eventTitle.setText(events);
    eventTitle.setVisibility(View.VISIBLE);
    event.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
private void showEvent(PersianDate persianDate){
  String holidays=utils.getHolidayTitle(persianDate);
  String events=utils.getEventTitle(persianDate);
  event.setVisibility(View.GONE);
  holidayTitle.setVisibility(View.GONE);
  eventTitle.setVisibility(View.GONE);
  if (holidays != null) {
    holidayTitle.setText(utils.textShaper(holidays));
    holidayTitle.setVisibility(View.VISIBLE);
    event.setVisibility(View.VISIBLE);
  }
  if (!TextUtils.isEmpty(events)) {
    eventTitle.setText(events);
    eventTitle.setVisibility(View.VISIBLE);
    event.setVisibility(View.VISIBLE);
  }
}
Program: 8681
Project: 8681
Buggy source:
@Override public void onClick(View view){
  mainActivity.onClickItem(view,getAdapterPosition());
  selectedItem=getAdapterPosition();
  notifyDataSetChanged();
}

Fixed version (ground truth):
@Override public void onClick(View view){
  mainActivity.onClickItem(getAdapterPosition());
  selectedItem=getAdapterPosition();
  notifyDataSetChanged();
}
Program: 8683
Project: 8683
Buggy source:
public void onClickItem(View v,int position){
  selectItem(position);
}

Fixed version (ground truth):
public void onClickItem(int position){
  selectItem(position);
}
Program: 8684
Project: 8684
Buggy source:
public void selectItem(int position){
switch (position) {
case CALENDAR:
    if (menuPosition != CALENDAR) {
      getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new CalendarMainFragment(),"String_Node_Str").addToBackStack(null).commit();
      menuPosition=CALENDAR;
    }
  break;
case CONVERTER:
if (menuPosition != CONVERTER) {
  getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new ConverterFragment()).addToBackStack(null).commit();
  menuPosition=CONVERTER;
}
break;
case COMPASS:
if (menuPosition != COMPASS) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new CompassFragment()).addToBackStack(null).commit();
menuPosition=COMPASS;
}
break;
case PREFERENCE:
if (menuPosition != PREFERENCE) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new ApplicationPreferenceFragment()).addToBackStack(null).commit();
menuPosition=PREFERENCE;
}
break;
case ABOUT:
if (menuPosition != ABOUT) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new AboutFragment()).addToBackStack(null).commit();
menuPosition=ABOUT;
}
break;
case EXIT:
finish();
break;
}
drawerLayout.closeDrawers();
}

Fixed version (ground truth):
public void selectItem(int position){
switch (position) {
case CALENDAR:
    if (menuPosition != CALENDAR) {
      getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new CalendarMainFragment(),"String_Node_Str").commit();
      menuPosition=CALENDAR;
    }
  break;
case CONVERTER:
if (menuPosition != CONVERTER) {
  getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new ConverterFragment()).commit();
  menuPosition=CONVERTER;
}
break;
case COMPASS:
if (menuPosition != COMPASS) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new CompassFragment()).commit();
menuPosition=COMPASS;
}
break;
case PREFERENCE:
if (menuPosition != PREFERENCE) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new ApplicationPreferenceFragment()).commit();
menuPosition=PREFERENCE;
}
break;
case ABOUT:
if (menuPosition != ABOUT) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder,new AboutFragment()).commit();
menuPosition=ABOUT;
}
break;
case EXIT:
finish();
break;
}
drawerLayout.closeDrawers();
}
Program: 8685
Project: 8685
Buggy source:
private void setMonth(){
  int posithon=viewPager.getCurrentItem();
  int offset=posithon - CalendarMainFragment.MONTHS_LIMIT / 2;
  PersianDate persianDate=Utils.getToday();
  int month=persianDate.getMonth() - offset;
  month-=1;
  month=month % 12;
  if (month < 0) {
    month+=12;
  }
  month+=1;
  currentMounth=month;
}

Fixed version (ground truth):
private void setMonth(){
  int posithon=viewPager.getCurrentItem();
  int offset=posithon - CalendarMainFragment.MONTHS_LIMIT / 2;
  PersianDate persianDate=Utils.getToday();
  int month=persianDate.getMonth() - offset;
  month-=1;
  month=month % 12;
  if (month < 0) {
    month+=12;
  }
  month+=1;
}
Program: 8687
Project: 8687
Buggy source:
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)   return;
  int color;
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
}
Program: 8688
Project: 8688
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.calendar_month,container,false);
  int offset=getArguments().getInt("String_Node_Str");
  List<Day> days=utils.getDays(getContext(),offset);
  char[] digits=utils.preferredDigits(getActivity());
  prev=(IconTextView)view.findViewById(R.id.prev);
  next=(IconTextView)view.findViewById(R.id.next);
  prev.setOnClickListener(this);
  next.setOnClickListener(this);
  PersianDate persianDate=Utils.getToday();
  int month=persianDate.getMonth() - offset;
  month-=1;
  int year=persianDate.getYear();
  year=year + (month / 12);
  month=month % 12;
  if (month < 0) {
    year-=1;
    month+=12;
  }
  month+=1;
  persianDate.setMonth(month);
  persianDate.setYear(year);
  persianDate.setDayOfMonth(1);
  TextView currentMonthTextView=(TextView)view.findViewById(R.id.currentMonthTextView);
  currentMonthTextView.setText(Utils.textShaper(utils.getMonthName(persianDate)));
  TextView currentYearTextView=(TextView)view.findViewById(R.id.currentYearTextView);
  currentYearTextView.setText(Utils.formatNumber(persianDate.getYear(),digits));
  recyclerView=(RecyclerView)view.findViewById(R.id.RecyclerView);
  recyclerView.setHasFixedSize(true);
  layoutManager=new GridLayoutManager(getContext(),7);
  recyclerView.setLayoutManager(layoutManager);
  adapter=new MonthAdapter(getActivity(),this,days);
  recyclerView.setAdapter(adapter);
  calendarMainFragment.selectDay(Utils.getToday());
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.calendar_month,container,false);
  int offset=getArguments().getInt("String_Node_Str");
  List<Day> days=utils.getDays(getContext(),offset);
  char[] digits=utils.preferredDigits(getActivity());
  prev=(IconTextView)view.findViewById(R.id.prev);
  next=(IconTextView)view.findViewById(R.id.next);
  prev.setOnClickListener(this);
  next.setOnClickListener(this);
  PersianDate persianDate=Utils.getToday();
  int month=persianDate.getMonth() - offset;
  month-=1;
  int year=persianDate.getYear();
  year=year + (month / 12);
  month=month % 12;
  if (month < 0) {
    year-=1;
    month+=12;
  }
  month+=1;
  persianDate.setMonth(month);
  persianDate.setYear(year);
  persianDate.setDayOfMonth(1);
  TextView currentMonthTextView=(TextView)view.findViewById(R.id.currentMonthTextView);
  currentMonthTextView.setText(Utils.textShaper(utils.getMonthName(persianDate)));
  TextView currentYearTextView=(TextView)view.findViewById(R.id.currentYearTextView);
  currentYearTextView.setText(Utils.formatNumber(persianDate.getYear(),digits));
  recyclerView=(RecyclerView)view.findViewById(R.id.RecyclerView);
  recyclerView.setHasFixedSize(true);
  layoutManager=new GridLayoutManager(getContext(),7);
  recyclerView.setLayoutManager(layoutManager);
  adapter=new MonthAdapter(getActivity(),this,days);
  recyclerView.setAdapter(adapter);
  return view;
}
Program: 8689
Project: 8689
Buggy source:
public void addListener(CalendarMainFragment calendarMainFragment){
  this.calendarMainFragment=calendarMainFragment;
}

Fixed version (ground truth):
public void addListener(CalendarMainFragment calendarMainFragment){
  this.calendarMainFragment=calendarMainFragment;
  this.calendarMainFragment.selectDay(Utils.getToday());
}
Program: 8690
Project: 8690
Buggy source:
public ViewHolder(View itemView,int ViewType){
  super(itemView);
  itemView.setClickable(true);
  itemView.setOnClickListener(this);
  if (ViewType == TYPE_ITEM) {
    itemTitle=(TextView)itemView.findViewById(R.id.itemTitle);
    itemIcon=(IconTextView)itemView.findViewById(R.id.ItemIcon);
    backGrand=itemView.findViewById(R.id.back_grand);
  }
}

Fixed version (ground truth):
public ViewHolder(View itemView,int ViewType){
  super(itemView);
  itemView.setClickable(true);
  itemView.setOnClickListener(this);
  if (ViewType == TYPE_ITEM) {
    itemTitle=(TextView)itemView.findViewById(R.id.itemTitle);
    itemIcon=(IconTextView)itemView.findViewById(R.id.ItemIcon);
    background=itemView.findViewById(R.id.background);
  }
}
Program: 8691
Project: 8691
Buggy source:
@Override public void onBindViewHolder(DrawerAdapter.ViewHolder holder,int position){
  if (!isPositionHeader(position)) {
    holder.itemTitle.setText(drawerTitles[position - 1]);
    holder.itemIcon.setText(drawerIcon[position - 1]);
    if (selectedItem == position) {
      holder.backGrand.setVisibility(View.VISIBLE);
    }
 else {
      holder.backGrand.setVisibility(View.GONE);
    }
  }
  holder.itemView.setSelected(false);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(DrawerAdapter.ViewHolder holder,int position){
  if (!isPositionHeader(position)) {
    holder.itemTitle.setText(drawerTitles[position - 1]);
    holder.itemIcon.setText(drawerIcon[position - 1]);
    if (selectedItem == position) {
      holder.background.setVisibility(View.VISIBLE);
    }
 else {
      holder.background.setVisibility(View.GONE);
    }
  }
  holder.itemView.setSelected(false);
}
Program: 8692
Project: 8692
Buggy source:
@Override public void onCreatePreferences(Bundle bundle,String s){
  addPreferencesFromResource(R.xml.preferences);
  LocationPreferencesChangeListener prefChangeListener=new LocationPreferencesChangeListener();
  categoryAthan=findPreference("String_Node_Str");
  prefLocation=findPreference("String_Node_Str");
  prefLatitude=findPreference("String_Node_Str");
  prefLongitude=findPreference("String_Node_Str");
  prefLocation.setOnPreferenceChangeListener(prefChangeListener);
  prefLatitude.setOnPreferenceChangeListener(prefChangeListener);
  prefLongitude.setOnPreferenceChangeListener(prefChangeListener);
  updateAthanPreferencesState(null,null);
  loadFonts(getActivity(),(ListPreference)findPreference("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void onCreatePreferences(Bundle bundle,String s){
  prefs=PreferenceManager.getDefaultSharedPreferences(getContext());
  locationName=prefs.getString("String_Node_Str","String_Node_Str");
  String strLat=prefs.getString("String_Node_Str","String_Node_Str");
  String strLng=prefs.getString("String_Node_Str","String_Node_Str");
  latitude=TextUtils.isEmpty(strLat) ? 0 : Double.parseDouble(strLat);
  longitude=TextUtils.isEmpty(strLng) ? 0 : Double.parseDouble(strLng);
  addPreferencesFromResource(R.xml.preferences);
  LocationPreferencesChangeListener prefChangeListener=new LocationPreferencesChangeListener();
  categoryAthan=findPreference("String_Node_Str");
  prefLocation=findPreference("String_Node_Str");
  prefLatitude=findPreference("String_Node_Str");
  prefLongitude=findPreference("String_Node_Str");
  prefLocation.setOnPreferenceChangeListener(prefChangeListener);
  prefLatitude.setOnPreferenceChangeListener(prefChangeListener);
  prefLongitude.setOnPreferenceChangeListener(prefChangeListener);
  updateAthanPreferencesState(null,null);
  loadFonts(getContext().getApplicationContext(),(ListPreference)findPreference("String_Node_Str"));
}
Program: 8694
Project: 8694
Buggy source:
public Uri getAthanUri(Context context){
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String athanSoundUri=prefs.getString("String_Node_Str","String_Node_Str" + context.getPackageName() + "String_Node_Str"+ R.raw.abdulbasit);
  return Uri.parse(athanSoundUri);
}

Fixed version (ground truth):
public Uri getAthanUri(Context context){
  String defaultSoundUri="String_Node_Str" + context.getPackageName() + "String_Node_Str"+ R.raw.abdulbasit;
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String athanSoundUri=prefs.getString("String_Node_Str",defaultSoundUri);
  if (TextUtils.isEmpty(athanSoundUri))   athanSoundUri=defaultSoundUri;
  return Uri.parse(athanSoundUri);
}
Program: 8695
Project: 8695
Buggy source:
public void setAlarm(Context context,long triggerInMillis){
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String valAthanGap=prefs.getString("String_Node_Str","String_Node_Str");
  long athanGap=TextUtils.isEmpty(valAthanGap) ? 0 : Long.parseLong(valAthanGap);
  Calendar triggerTime=Calendar.getInstance();
  triggerTime.setTimeInMillis(triggerInMillis - TimeUnit.SECONDS.toMillis(athanGap));
  AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  if (!triggerTime.before(Calendar.getInstance())) {
    triggerTime.set(Calendar.SECOND,0);
    Log.d(TAG,"String_Node_Str" + triggerTime.getTime());
    Intent intent=new Intent(context,AlarmReceiver.class);
    PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,intent,0);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      alarmManager.setExact(AlarmManager.RTC_WAKEUP,triggerTime.getTimeInMillis(),pendingIntent);
    }
 else {
      alarmManager.set(AlarmManager.RTC_WAKEUP,triggerTime.getTimeInMillis(),pendingIntent);
    }
  }
}

Fixed version (ground truth):
public void setAlarm(Context context,long timeInMillis){
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String valAthanGap=prefs.getString("String_Node_Str","String_Node_Str");
  long athanGap=TextUtils.isEmpty(valAthanGap) ? 0 : Long.parseLong(valAthanGap);
  Calendar triggerTime=Calendar.getInstance();
  triggerTime.setTimeInMillis(timeInMillis - TimeUnit.SECONDS.toMillis(athanGap));
  AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  if (!triggerTime.before(Calendar.getInstance())) {
    triggerTime.set(Calendar.SECOND,0);
    Log.d(TAG,"String_Node_Str" + triggerTime.getTime());
    Intent intent=new Intent(context,AlarmReceiver.class);
    PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,intent,0);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      alarmManager.setExact(AlarmManager.RTC_WAKEUP,triggerTime.getTimeInMillis(),pendingIntent);
    }
 else {
      alarmManager.set(AlarmManager.RTC_WAKEUP,triggerTime.getTimeInMillis(),pendingIntent);
    }
  }
}
Program: 8696
Project: 8696
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  Log.d(TAG,"String_Node_Str" + progress);
  audioManager.setStreamVolume(AudioManager.STREAM_ALARM,progress,0);
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  audioManager.setStreamVolume(AudioManager.STREAM_ALARM,progress,0);
}
Program: 8697
Project: 8697
Buggy source:
@Override protected View onCreateDialogView(){
  View view=super.onCreateDialogView();
  instantiateMediaPlayer();
  seekBarVolumeSlider=(SeekBar)view.findViewById(R.id.sbVolumeSlider);
  seekBarVolumeSlider.setProgress(audioManager.getStreamVolume(AudioManager.STREAM_ALARM));
  seekBarVolumeSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      Log.d(TAG,"String_Node_Str" + progress);
      audioManager.setStreamVolume(AudioManager.STREAM_ALARM,progress,0);
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
      try {
        if (!mediaPlayer.isPlaying()) {
          mediaPlayer.prepare();
          mediaPlayer.start();
        }
      }
 catch (      IOException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override protected View onCreateDialogView(){
  View view=super.onCreateDialogView();
  instantiateMediaPlayer();
  seekBarVolumeSlider=(SeekBar)view.findViewById(R.id.sbVolumeSlider);
  seekBarVolumeSlider.setProgress(audioManager.getStreamVolume(AudioManager.STREAM_ALARM));
  seekBarVolumeSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      audioManager.setStreamVolume(AudioManager.STREAM_ALARM,progress,0);
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
      try {
        if (!mediaPlayer.isPlaying()) {
          mediaPlayer.prepare();
          mediaPlayer.start();
        }
      }
 catch (      IOException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
);
  return view;
}
Program: 8698
Project: 8698
Buggy source:
public void instantiateMediaPlayer(){
  try {
    mediaPlayer=null;
    mediaPlayer=new MediaPlayer();
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
    mediaPlayer.setDataSource(getContext(),athanSoundUri);
    mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){
      @Override public void onCompletion(      MediaPlayer mp){
        instantiateMediaPlayer();
      }
    }
);
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void instantiateMediaPlayer(){
  try {
    Log.v(TAG,"String_Node_Str" + athanSoundUri);
    mediaPlayer=null;
    mediaPlayer=new MediaPlayer();
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
    mediaPlayer.setDataSource(getContext(),athanSoundUri);
    mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){
      @Override public void onCompletion(      MediaPlayer mp){
        instantiateMediaPlayer();
      }
    }
);
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 8700
Project: 8700
Buggy source:
public void setMonth(int month){
  if (month < 1 || month > 12)   throw new MonthOutOfRangeException("String_Node_Str" + month + "String_Node_Str");
  setDayOfMonth(getDayOfMonth());
  cal.set(Calendar.MONTH,month - 1);
}

Fixed version (ground truth):
public void setMonth(int month){
  if (month < 1 || month > 12)   throw new MonthOutOfRangeException("String_Node_Str" + month + "String_Node_Str");
  setDayOfMonth(getDayOfMonth());
  this.month=month;
}
Program: 8701
Project: 8701
Buggy source:
public void setYear(int year){
  if (year == 0)   throw new YearOutOfRangeException("String_Node_Str");
  cal.set(Calendar.YEAR,year);
}

Fixed version (ground truth):
public void setYear(int year){
  if (year == 0)   throw new YearOutOfRangeException("String_Node_Str");
  this.year=year;
}
Program: 8702
Project: 8702
Buggy source:
public void setDayOfMonth(int day){
  if (day < 1)   throw new DayOutOfRangeException("String_Node_Str" + day + "String_Node_Str");
  if (day > daysInMonth[getMonth() - 1])   throw new DayOutOfRangeException("String_Node_Str" + day + "String_Node_Str");
  cal.set(Calendar.DAY_OF_MONTH,day);
}

Fixed version (ground truth):
public void setDayOfMonth(int day){
  if (day < 1)   throw new DayOutOfRangeException("String_Node_Str" + day + "String_Node_Str");
  if (day > daysInMonth[month])   throw new DayOutOfRangeException("String_Node_Str" + day + "String_Node_Str");
  this.day=day;
}
Program: 8703
Project: 8703
Buggy source:
public int getDayOfWeek(){
  return cal.get(Calendar.DAY_OF_WEEK);
}

Fixed version (ground truth):
public int getDayOfWeek(){
  Calendar cal=Calendar.getInstance();
  cal.set(Calendar.YEAR,year);
  cal.set(Calendar.MONTH,month - 1);
  cal.set(Calendar.DAY_OF_MONTH,day);
  return cal.get(Calendar.DAY_OF_WEEK);
}
Program: 8704
Project: 8704
Buggy source:
public int getYear(){
  return cal.get(Calendar.YEAR);
}

Fixed version (ground truth):
public int getYear(){
  return year;
}
Program: 8705
Project: 8705
Buggy source:
public int getDayOfMonth(){
  return cal.get(Calendar.DAY_OF_MONTH);
}

Fixed version (ground truth):
public int getDayOfMonth(){
  return day;
}
Program: 8706
Project: 8706
Buggy source:
public int getMonth(){
  return cal.get(Calendar.MONTH) + 1;
}

Fixed version (ground truth):
public int getMonth(){
  return month;
}
Program: 8709
Project: 8709
Buggy source:
@Test public void noCallbackTest() throws Exception {
  HourDayMonthBucketer hourDayMonthBucketer=new HourDayMonthBucketer();
  Dimension<DateTime> time=new Dimension<DateTime>("String_Node_Str",hourDayMonthBucketer,false,8);
  Dimension<String> zipcode=new Dimension<String>("String_Node_Str",new StringToBytesBucketer(),true,5);
  Rollup hourAndZipRollup=new Rollup(zipcode,time,HourDayMonthBucketer.hours);
  Rollup dayAndZipRollup=new Rollup(zipcode,time,HourDayMonthBucketer.days);
  Rollup hourRollup=new Rollup(time,HourDayMonthBucketer.hours);
  Rollup dayRollup=new Rollup(time,HourDayMonthBucketer.days);
  List<Dimension<?>> dimensions=ImmutableList.<Dimension<?>>of(time,zipcode);
  List<Rollup> rollups=ImmutableList.of(hourAndZipRollup,dayAndZipRollup,hourRollup,dayRollup);
  DataCube<LongOp> dataCube=new DataCube<LongOp>(dimensions,rollups);
  IdService idService=new MapIdService();
  HTablePool pool=new HTablePool(getTestUtil().getConfiguration(),Integer.MAX_VALUE);
  DbHarness<LongOp> hbaseDbHarness=new HBaseDbHarness<LongOp>(pool,"String_Node_Str".getBytes(),DATA_CUBE_TABLE,CF,LongOp.DESERIALIZER,idService,DbHarness.CommitType.INCREMENT,1,1,1,"String_Node_Str");
  DataCubeIo<LongOp> dataCubeIo=new DataCubeIo<LongOp>(dataCube,hbaseDbHarness,1,100000,SyncLevel.BATCH_SYNC,"String_Node_Str",true);
  dataCubeIo.writeSync(new LongOp(5),new WriteBuilder().at(time,DateTime.now(DateTimeZone.UTC)).at(zipcode,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void noCallbackTest() throws Exception {
  HourDayMonthBucketer hourDayMonthBucketer=new HourDayMonthBucketer();
  Dimension<DateTime> time=new Dimension<DateTime>("String_Node_Str",hourDayMonthBucketer,false,8);
  Dimension<String> zipcode=new Dimension<String>("String_Node_Str",new StringToBytesBucketer(),true,5);
  Rollup hourAndZipRollup=new Rollup(zipcode,time,HourDayMonthBucketer.hours);
  Rollup dayAndZipRollup=new Rollup(zipcode,time,HourDayMonthBucketer.days);
  Rollup hourRollup=new Rollup(time,HourDayMonthBucketer.hours);
  Rollup dayRollup=new Rollup(time,HourDayMonthBucketer.days);
  List<Dimension<?>> dimensions=ImmutableList.<Dimension<?>>of(time,zipcode);
  List<Rollup> rollups=ImmutableList.of(hourAndZipRollup,dayAndZipRollup,hourRollup,dayRollup);
  DataCube<LongOp> dataCube=new DataCube<LongOp>(dimensions,rollups);
  IdService idService=new MapIdService();
  HTablePool pool=new HTablePool(getTestUtil().getConfiguration(),Integer.MAX_VALUE);
  DbHarness<LongOp> hbaseDbHarness=new HBaseDbHarness<LongOp>(pool,"String_Node_Str".getBytes(),DATA_CUBE_TABLE,CF,LongOp.DESERIALIZER,idService,DbHarness.CommitType.INCREMENT,(ignored) -> null,1,1,1,"String_Node_Str",this.batchSize);
  DataCubeIo<LongOp> dataCubeIo=new DataCubeIo<LongOp>(dataCube,hbaseDbHarness,1,100000,SyncLevel.BATCH_SYNC,"String_Node_Str",true);
  dataCubeIo.writeSync(new LongOp(5),new WriteBuilder().at(time,DateTime.now(DateTimeZone.UTC)).at(zipcode,"String_Node_Str"));
}
Program: 8712
Project: 8712
Buggy source:
@Override public byte[] serialize(){
  if (this.bool) {
    return TRUE_SERIAL;
  }
 else {
    return FALSE_SERIAL;
  }
}

Fixed version (ground truth):
@Override public byte[] serialize(){
  return staticSerialize(bool);
}
Program: 8713
Project: 8713
Buggy source:
@Override public byte[] serialize(){
  byte[] ordinalBytes=Util.intToBytes(ordinal);
  int startAtIndex=4 - numFieldBytes;
  return Arrays.copyOfRange(ordinalBytes,startAtIndex,4);
}

Fixed version (ground truth):
@Override public byte[] serialize(){
  return staticSerialize(ordinal,numFieldBytes);
}
Program: 8714
Project: 8714
Buggy source:
@Override public byte[] serialize(){
  return Util.intToBytes(i);
}

Fixed version (ground truth):
@Override public byte[] serialize(){
  return staticSerialize(x);
}
Program: 8715
Project: 8715
Buggy source:
public IntSerializable(int l){
  this.i=l;
}

Fixed version (ground truth):
public IntSerializable(int x){
  this.x=x;
}
Program: 8716
Project: 8716
Buggy source:
@Override public byte[] serialize(){
  return Util.longToBytes(l);
}

Fixed version (ground truth):
@Override public byte[] serialize(){
  return staticSerialize(l);
}
Program: 8717
Project: 8717
Buggy source:
@Override public byte[] serialize(){
  try {
    return s.getBytes("String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public byte[] serialize(){
  return staticSerialize(s);
}
Program: 8718
Project: 8718
Buggy source:
/** 
 * Test StringSerializable Class
 * @throws Exception
 */
@Test public void testStringSerializable() throws Exception {
  Assert.assertArrayEquals(new StringSerializable(TEST_STRING).serialize(),TEST_STRING.getBytes());
}

Fixed version (ground truth):
@Test public void testStringSerializable() throws Exception {
  Assert.assertArrayEquals(new StringSerializable(TEST_STRING).serialize(),TEST_STRING.getBytes());
}
Program: 8719
Project: 8719
Buggy source:
/** 
 * Test BytesSerializable Class
 * @throws Exception
 */
@Test public void testBytesSerializable() throws Exception {
  Assert.assertArrayEquals(new BytesSerializable(new byte[]{1}).serialize(),TRUE_CASE);
  Assert.assertArrayEquals(new BytesSerializable(new byte[]{0}).serialize(),FALSE_CASE);
}

Fixed version (ground truth):
@Test public void testBytesSerializable() throws Exception {
  Assert.assertArrayEquals(new BytesSerializable(new byte[]{1}).serialize(),TRUE_CASE);
  Assert.assertArrayEquals(new BytesSerializable(new byte[]{0}).serialize(),FALSE_CASE);
}
Program: 8720
Project: 8720
Buggy source:
/** 
 * Test LongSerializable (mostly through re-implementation).
 * @throws Exception
 */
@Test public void testLongSerializable() throws Exception {
  Assert.assertArrayEquals(new LongSerializable(TEST_LONG).serialize(),ByteBuffer.allocate(8).putLong(TEST_LONG).array());
}

Fixed version (ground truth):
@Test public void testLongSerializable() throws Exception {
  Assert.assertArrayEquals(new LongSerializable(TEST_LONG).serialize(),ByteBuffer.allocate(8).putLong(TEST_LONG).array());
}
Program: 8721
Project: 8721
Buggy source:
/** 
 * Test Boolean Serializable Class
 * @throws Exception
 */
@Test public void testBooleanSerializable() throws Exception {
  Assert.assertArrayEquals(new BooleanSerializable(true).serialize(),TRUE_CASE);
  Assert.assertArrayEquals(new BooleanSerializable(false).serialize(),FALSE_CASE);
}

Fixed version (ground truth):
@Test public void testBooleanSerializable() throws Exception {
  Assert.assertArrayEquals(new BooleanSerializable(true).serialize(),TRUE_CASE);
  Assert.assertArrayEquals(new BooleanSerializable(false).serialize(),FALSE_CASE);
}
Program: 8722
Project: 8722
Buggy source:
public static void log(String s){
  if (isEnabled) {
    hacklog.HackLog.log(s);
  }
}

Fixed version (ground truth):
/** 
 * Log a message. Note that this will probably be a no-op in a map or reduce task unless you find some way to set the required system properties on those JVMs to enable this code.
 */
public static void log(String s){
  if (isEnabled) {
    hacklog.HackLog.log(s);
  }
}
Program: 8724
Project: 8724
Buggy source:
@Override protected void map(ImmutableBytesWritable key,Result result,Context context) throws IOException, InterruptedException {
  DebugHack.log("String_Node_Str");
  for (  KeyValue kv : result.list()) {
    context.write(key,kv);
  }
}

Fixed version (ground truth):
@Override protected void map(ImmutableBytesWritable key,Result result,Context context) throws IOException, InterruptedException {
  for (  KeyValue kv : result.list()) {
    context.write(key,kv);
  }
}
Program: 8725
Project: 8725
Buggy source:
public void writeOne(Address address,T op) throws IOException {
  byte[] addressAsBytes=address.toKey(idService);
  byte[] rowKey=ArrayUtils.addAll(uniqueCubeName,addressAsBytes);
  if (DebugHack.isEnabled()) {
    DebugHack.log("String_Node_Str" + new String(tableName) + "String_Node_Str"+ new String(cf)+ "String_Node_Str"+ Hex.encodeHexString(rowKey));
  }
  Optional<T> preexistingValInDb=get(address);
  T valToWrite;
  if (preexistingValInDb.isPresent()) {
    valToWrite=(T)(preexistingValInDb.get().add(op));
  }
 else {
    valToWrite=op;
  }
  Put put=new Put(rowKey);
  put.add(cf,QUALIFIER,valToWrite.serialize());
  WithHTable.put(pool,tableName,put);
}

Fixed version (ground truth):
public void writeOne(Address address,T op) throws IOException {
  byte[] addressAsBytes=address.toKey(idService);
  byte[] rowKey=ArrayUtils.addAll(uniqueCubeName,addressAsBytes);
  Optional<T> preexistingValInDb=get(address);
  T valToWrite;
  if (preexistingValInDb.isPresent()) {
    valToWrite=(T)(preexistingValInDb.get().add(op));
  }
 else {
    valToWrite=op;
  }
  byte[] serializedOp=valToWrite.serialize();
  if (DebugHack.isEnabled()) {
    DebugHack.log("String_Node_Str" + new String(tableName) + "String_Node_Str"+ new String(cf)+ "String_Node_Str"+ Base64.encodeBase64String(rowKey)+ "String_Node_Str"+ Base64.encodeBase64String(serializedOp));
  }
  Put put=new Put(rowKey);
  put.add(cf,QUALIFIER,serializedOp);
  WithHTable.put(pool,tableName,put);
}
Program: 8728
Project: 8728
Buggy source:
/** 
 * Creates a copy of this   {@code DocumentNodeState} with the{@link #rootRevision} set to the given {@code root} revision. This methodreturns  {@code this} instance if the given {@code root} revision isthe same as the one in this instance and the  {@link #fromExternalChange}flags are equal.
 * @param root the root revision for the copy of this node state.
 * @param externalChange if the {@link #fromExternalChange} flag must beset on the returned node state.
 * @return a copy of this node state with the given root revision andexternal change flag.
 */
public abstract AbstractDocumentNodeState withRootRevision(@Nonnull RevisionVector root,boolean externalChange);

Fixed version (ground truth):
/** 
 * Creates a copy of this   {@code DocumentNodeState} with the{@link #getRootRevision()} set to the given {@code root} revision. This methodreturns  {@code this} instance if the given {@code root} revision isthe same as the one in this instance and the  {@link #isFromExternalChange()}flags are equal.
 * @param root the root revision for the copy of this node state.
 * @param externalChange if the {@link #isFromExternalChange()} flag must beset on the returned node state.
 * @return a copy of this node state with the given root revision andexternal change flag.
 */
public abstract AbstractDocumentNodeState withRootRevision(@Nonnull RevisionVector root,boolean externalChange);
Program: 8729
Project: 8729
Buggy source:
/** 
 * Adds the provided glob paths to the set of include paths. <p> The definition of a glob path is <a href="https://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathFilter.html">here</a> <p> Note that unlike 'normal' include and exclude paths, this variant doesn't apply Oak's NamePathMapper. <p> This filter property is added in 'or' mode.
 * @param globPath glob path that should be added as include path pattern. Note that the NamePathMapper is not applied on this globPath.
 * @return this filter with the filter change applied
 */
public abstract OakEventFilter withIncludeGlobPaths(String... globPaths);

Fixed version (ground truth):
/** 
 * Adds the provided glob paths to the set of include paths. <p> The definition of a glob path is <a href="https://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathFilter.html">here</a> <p> Note that unlike 'normal' include and exclude paths, this variant doesn't apply Oak's NamePathMapper. <p> This filter property is added in 'or' mode.
 * @param globPaths glob paths that should be added as include path pattern. Note that the NamePathMapper is not applied on these globPaths.
 * @return this filter with the filter change applied
 */
public abstract OakEventFilter withIncludeGlobPaths(String... globPaths);
Program: 8730
Project: 8730
Buggy source:
/** 
 * Returns the File if present or null otherwise. Any usage of the returned file should assert for its existence as the file could be purged from the file system once uploaded using  {@link org.apache.jackrabbit.core.data.CachingDataStore.FilesUploader}.
 * @param key of the file to check
 * @return a File object if found
 */
@Nullable public File getIfPresent(String key){
  cacheStats.markLoad();
  if (map.containsKey(key)) {
    cacheStats.markLoadSuccess();
    return map.get(key);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the File if present or null otherwise. Any usage of the returned file should assert for its existence as the file could be purged from the file system once uploaded using the internal scheduled remove mechanism.
 * @param key of the file to check
 * @return a File object if found
 */
@Nullable public File getIfPresent(String key){
  cacheStats.markLoad();
  if (map.containsKey(key)) {
    cacheStats.markLoadSuccess();
    return map.get(key);
  }
  return null;
}
Program: 8731
Project: 8731
Buggy source:
@Test public void queryOptions() throws ParseException {
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Test public void queryOptions() throws ParseException {
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  verify("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 8736
Project: 8736
Buggy source:
/** 
 * Defines the mapping of internal property names from external values. Only the external properties defined as keys of this map are synced with the mapped internal properties. note that the property names can be relative paths. the intermediate nodes will be created accordingly. Example: <xmp> { "rep:fullname": "cn", "country", "c", "profile/email": "mail", "profile/givenName": "cn" } </xmp> The implicit properties like userid, groupname, password must not be mapped.
 * @return the property mapping where the keys are the local property names and the values the external ones.
 */
@Nonnull public Map<String,String> getPropertyMapping(){
  return propertyMapping == null ? Collections.<String,String>emptyMap() : propertyMapping;
}

Fixed version (ground truth):
/** 
 * Defines the mapping of internal property names from external values. Only the external properties defined as keys of this map are synced with the mapped internal properties. note that the property names can be relative paths. the intermediate nodes will be created accordingly. Example: <pre>  {@code}{ "rep:fullname": "cn", "country", "c", "profile/email": "mail", "profile/givenName": "cn" } }</pre> The implicit properties like userid, groupname, password must not be mapped.
 * @return the property mapping where the keys are the local property names and the values the external ones.
 */
@Nonnull public Map<String,String> getPropertyMapping(){
  return propertyMapping == null ? Collections.<String,String>emptyMap() : propertyMapping;
}
Program: 8737
Project: 8737
Buggy source:
/** 
 * Returns the LDAP filter that is used when searching for groups where an identity is member of. The filter is based on the configuration and has the following format: <pre> (&(${memberAttribute}=${dn})(objectclass=${objectclass})${extraFilter}) </pre> Note that the objectclass part is repeated according to the specified objectclasses in  {@link Identity#getObjectClasses()} of the group configuration.
 * @param dn the dn of the identity to search for
 * @return the search filter
 */
public String getMemberOfSearchFilter(@Nonnull String dn){
  if (memberOfFilterTemplate == null) {
    StringBuilder filter=new StringBuilder("String_Node_Str").append(groupMemberAttribute).append("String_Node_Str");
    for (    String objectClass : groupConfig.objectClasses) {
      filter.append("String_Node_Str").append(encodeFilterValue(objectClass)).append(')');
    }
    if (groupConfig.extraFilter != null && groupConfig.extraFilter.length() > 0) {
      filter.append(groupConfig.extraFilter);
    }
    filter.append(')');
    memberOfFilterTemplate=filter.toString();
  }
  return String.format(memberOfFilterTemplate,encodeFilterValue(dn));
}

Fixed version (ground truth):
/** 
 * Returns the LDAP filter that is used when searching for groups where an identity is member of. The filter is based on the configuration and has the following format: <pre>  {@code}(&($ memberAttribute}=${dn})(objectclass=${objectclass})${extraFilter}) }</pre> Note that the objectclass part is repeated according to the specified objectclasses in  {@link Identity#getObjectClasses()} of the group configuration.
 * @param dn the dn of the identity to search for
 * @return the search filter
 */
public String getMemberOfSearchFilter(@Nonnull String dn){
  if (memberOfFilterTemplate == null) {
    StringBuilder filter=new StringBuilder("String_Node_Str").append(groupMemberAttribute).append("String_Node_Str");
    for (    String objectClass : groupConfig.objectClasses) {
      filter.append("String_Node_Str").append(encodeFilterValue(objectClass)).append(')');
    }
    if (groupConfig.extraFilter != null && groupConfig.extraFilter.length() > 0) {
      filter.append(groupConfig.extraFilter);
    }
    filter.append(')');
    memberOfFilterTemplate=filter.toString();
  }
  return String.format(memberOfFilterTemplate,encodeFilterValue(dn));
}
Program: 8738
Project: 8738
Buggy source:
/** 
 * Returns the LDAP filter that is used when searching this type of identity. The filter is based on the configuration and has the following format: <pre> (&(${idAttr}=${id})(objectclass=${objectclass})${extraFilter}) </pre> Note that the objectclass part is repeated according to the specified objectclasses in   {@link #getObjectClasses()}.
 * @param id the id value
 * @return the search filter
 */
@Nonnull public String getSearchFilter(@Nonnull String id){
  if (filterTemplate == null) {
    StringBuilder filter=new StringBuilder("String_Node_Str").append(idAttribute).append("String_Node_Str");
    for (    String objectClass : objectClasses) {
      filter.append("String_Node_Str").append(encodeFilterValue(objectClass)).append(')');
    }
    if (extraFilter != null && extraFilter.length() > 0) {
      filter.append(extraFilter);
    }
    filter.append(')');
    filterTemplate=filter.toString();
  }
  return String.format(filterTemplate,encodeFilterValue(id));
}

Fixed version (ground truth):
/** 
 * Returns the LDAP filter that is used when searching this type of identity. The filter is based on the configuration and has the following format: <pre>  {@code}(&($ idAttr}=${id})(objectclass=${objectclass})${extraFilter}) }</pre> Note that the objectclass part is repeated according to the specified objectclasses in   {@link #getObjectClasses()}.
 * @param id the id value
 * @return the search filter
 */
@Nonnull public String getSearchFilter(@Nonnull String id){
  if (filterTemplate == null) {
    StringBuilder filter=new StringBuilder("String_Node_Str").append(idAttribute).append("String_Node_Str");
    for (    String objectClass : objectClasses) {
      filter.append("String_Node_Str").append(encodeFilterValue(objectClass)).append(')');
    }
    if (extraFilter != null && extraFilter.length() > 0) {
      filter.append(extraFilter);
    }
    filter.append(')');
    filterTemplate=filter.toString();
  }
  return String.format(filterTemplate,encodeFilterValue(id));
}