nus-yam/ex-repair huggingface dataset:
Program: 96176
Project: 96176
Buggy source:
private void updateWeaknessUI(){
  int fire, water, thunder, ice, dragon, poison, paralysis, sleep, pitfalltrap, shocktrap, flashbomb, sonicbomb, dungbomb, meat;
  ArrayList<MonsterWeakness> weaknesses=DataManager.get(getActivity()).queryMonsterWeaknessArray(mMonster.getId());
  mWeakness=weaknesses.get(0);
  evalWeakness(mWeakness.getFire(),mWeaknessData,getResources().getString(R.string.image_location_fire));
  evalWeakness(mWeakness.getWater(),mWeaknessData,getResources().getString(R.string.image_location_water));
  evalWeakness(mWeakness.getThunder(),mWeaknessData,getResources().getString(R.string.image_location_thunder));
  evalWeakness(mWeakness.getIce(),mWeaknessData,getResources().getString(R.string.image_location_ice));
  evalWeakness(mWeakness.getDragon(),mWeaknessData,getResources().getString(R.string.image_location_dragon));
  evalWeakness(mWeakness.getPoison(),mWeaknessData,getResources().getString(R.string.image_location_poison));
  evalWeakness(mWeakness.getParalysis(),mWeaknessData,getResources().getString(R.string.image_location_paralysis));
  evalWeakness(mWeakness.getSleep(),mWeaknessData,getResources().getString(R.string.image_location_sleep));
}

Fixed version (ground truth):
private void updateWeaknessUI(){
  int fire, water, thunder, ice, dragon, poison, paralysis, sleep, pitfalltrap, shocktrap, flashbomb, sonicbomb, dungbomb, meat;
  ArrayList<MonsterWeakness> weaknesses=DataManager.get(getActivity()).queryMonsterWeaknessArray(mMonster.getId());
  mWeakness=weaknesses.get(0);
  evalWeakness(mWeakness.getFire(),mWeaknessData,getResources().getString(R.string.image_location_fire));
  evalWeakness(mWeakness.getWater(),mWeaknessData,getResources().getString(R.string.image_location_water));
  evalWeakness(mWeakness.getThunder(),mWeaknessData,getResources().getString(R.string.image_location_thunder));
  evalWeakness(mWeakness.getIce(),mWeaknessData,getResources().getString(R.string.image_location_ice));
  evalWeakness(mWeakness.getDragon(),mWeaknessData,getResources().getString(R.string.image_location_dragon));
  evalWeakness(mWeakness.getPoison(),mWeaknessData,getResources().getString(R.string.image_location_poison));
  evalWeakness(mWeakness.getParalysis(),mWeaknessData,getResources().getString(R.string.image_location_paralysis));
  evalWeakness(mWeakness.getSleep(),mWeaknessData,getResources().getString(R.string.image_location_sleep));
  if (mWeakness.getPitfalltrap() != 0)   addIcon(mTrapData,getResources().getString(R.string.image_location_pitfall_trap),null);
  if (mWeakness.getShocktrap() != 0)   addIcon(mTrapData,getResources().getString(R.string.image_location_shock_trap),null);
  if (mWeakness.getFlashbomb() != 0)   addIcon(mBombData,getResources().getString(R.string.image_location_flash_bomb),null);
  if (mWeakness.getSonicbomb() != 0)   addIcon(mBombData,getResources().getString(R.string.image_location_sonic_bomb),null);
  if (mWeakness.getDungbomb() != 0)   addIcon(mBombData,getResources().getString(R.string.image_location_dung_bomb),null);
}
Program: 96177
Project: 96177
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor cursor){
  MonsterSummaryFragment.MonsterAilmentsCursorAdapter adapter=new MonsterSummaryFragment.MonsterAilmentsCursorAdapter(getActivity(),(MonsterAilmentCursor)cursor);
  for (int i=0; i < adapter.getCount(); i++) {
    LinearLayout v=(LinearLayout)adapter.getView(i,null,null);
  }
  updateUI();
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor cursor){
  MonsterSummaryFragment.MonsterAilmentsCursorAdapter adapter=new MonsterSummaryFragment.MonsterAilmentsCursorAdapter(getActivity(),(MonsterAilmentCursor)cursor);
  for (int i=0; i < adapter.getCount(); i++) {
    LinearLayout v=(LinearLayout)adapter.getView(i,null,null);
    mAilments.addView(v);
  }
  updateUI();
}
Program: 96178
Project: 96178
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_monster_summary,container,false);
  mMonsterLabelTextView=(TextView)view.findViewById(R.id.detail_monster_label);
  mMonsterIconImageView=(ImageView)view.findViewById(R.id.detail_monster_image);
  mWeaknessData=(LinearLayout)view.findViewById(R.id.weakness_data);
  mAttackData=(LinearLayout)view.findViewById(R.id.attack_data);
  mEarplugData=(LinearLayout)view.findViewById(R.id.earplugs_data);
  mWindpressData=(LinearLayout)view.findViewById(R.id.windpress_data);
  mTrapData=(LinearLayout)view.findViewById(R.id.trap_data);
  mBombData=(LinearLayout)view.findViewById(R.id.bomb_data);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_monster_summary,container,false);
  mMonsterLabelTextView=(TextView)view.findViewById(R.id.detail_monster_label);
  mMonsterIconImageView=(ImageView)view.findViewById(R.id.detail_monster_image);
  mWeaknessData=(LinearLayout)view.findViewById(R.id.weakness_data);
  mAttackData=(LinearLayout)view.findViewById(R.id.attack_data);
  mEarplugData=(LinearLayout)view.findViewById(R.id.earplugs_data);
  mWindpressData=(LinearLayout)view.findViewById(R.id.windpress_data);
  mTrapData=(LinearLayout)view.findViewById(R.id.trap_data);
  mBombData=(LinearLayout)view.findViewById(R.id.bomb_data);
  mAilments=(LinearLayout)view.findViewById(R.id.ailments_data);
  return view;
}
Program: 96179
Project: 96179
Buggy source:
/** 
 * Adds any skills to the armor set's skill trees that were not there before, and removes those no longer there.
 */
public void updateSkillTreePointsSets(Context context){
  skillTreePointsSets.clear();
  Map<SkillTree,SkillTreePointsSet> skillTreeToSkillTreePointsSet=new HashMap<>();
  for (  SkillTreePointsSet pointsSet : skillTreePointsSets) {
    skillTreeToSkillTreePointsSet.put(pointsSet.getSkillTree(),pointsSet);
  }
  for (int i=0; i < equipment.length; i++) {
    Log.v("String_Node_Str","String_Node_Str" + i);
    Map<SkillTree,Integer> armorSkillTreePoints=getSkillsFromArmorPiece(i,context);
    for (    SkillTree skillTree : armorSkillTreePoints.keySet()) {
      SkillTreePointsSet s;
      if (!skillTreeToSkillTreePointsSet.containsKey(skillTree)) {
        Log.d("String_Node_Str","String_Node_Str" + skillTree.getName() + "String_Node_Str");
        s=new SkillTreePointsSet();
        s.setSkillTree(skillTree);
        skillTreePointsSets.add(s);
        skillTreeToSkillTreePointsSet.put(skillTree,s);
      }
 else {
        Log.d("String_Node_Str","String_Node_Str" + skillTree.getName() + "String_Node_Str");
        s=skillTreeToSkillTreePointsSet.get(skillTree);
      }
      s.setPoints(i,armorSkillTreePoints.get(skillTree));
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds any skills to the armor set's skill trees that were not there before, and removes those no longer there.
 */
public void updateSkillTreePointsSets(Context context){
  skillTreePointsSets.clear();
  Map<Long,SkillTreePointsSet> skillTreeToSkillTreePointsSet=new HashMap<>();
  for (  SkillTreePointsSet pointsSet : skillTreePointsSets) {
    skillTreeToSkillTreePointsSet.put(pointsSet.getSkillTree().getId(),pointsSet);
  }
  for (int i=0; i < equipment.length; i++) {
    Log.v("String_Node_Str","String_Node_Str" + i);
    Map<SkillTree,Integer> armorSkillTreePoints=getSkillsFromArmorPiece(i,context);
    for (    SkillTree skillTree : armorSkillTreePoints.keySet()) {
      SkillTreePointsSet s;
      if (!skillTreeToSkillTreePointsSet.containsKey(skillTree.getId())) {
        Log.d("String_Node_Str","String_Node_Str" + skillTree.getName() + "String_Node_Str");
        s=new SkillTreePointsSet();
        s.setSkillTree(skillTree);
        skillTreePointsSets.add(s);
        skillTreeToSkillTreePointsSet.put(skillTree.getId(),s);
      }
 else {
        Log.d("String_Node_Str","String_Node_Str" + skillTree.getName() + "String_Node_Str");
        s=skillTreeToSkillTreePointsSet.get(skillTree.getId());
      }
      s.setPoints(i,armorSkillTreePoints.get(skillTree));
    }
  }
}
Program: 96181
Project: 96181
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  if (skillTreeViews[0].hasSkillDefined()) {
    Intent i=new Intent();
    long skill1Id=skillTreeViews[0].getSkillTree().getId();
    int skill1Points=skillTreeViews[0].getSkillPoints();
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_TREE_1,skill1Id);
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_POINTS_1,skill1Points);
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_TYPE_INDEX,talismanTypeIndex);
    if (skillTreeViews[1].hasSkillDefined()) {
      Log.d("String_Node_Str","String_Node_Str");
      long skill2Id=skillTreeViews[0].getSkillTree().getId();
      int skill2Points=skillTreeViews[1].getSkillPoints();
      i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_TREE_2,skill2Id);
      i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_POINTS_2,skill2Points);
    }
    getTargetFragment().onActivityResult(ArmorSetBuilderActivity.REQUEST_CODE_CREATE_TALISMAN,Activity.RESULT_OK,i);
  }
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  if (skillTreeViews[0].hasSkillDefined()) {
    Intent i=new Intent();
    long skill1Id=skillTreeViews[0].getSkillTree().getId();
    int skill1Points=skillTreeViews[0].getSkillPoints();
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_TREE_1,skill1Id);
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_POINTS_1,skill1Points);
    i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_TYPE_INDEX,talismanTypeIndex);
    if (skillTreeViews[1].hasSkillDefined()) {
      Log.d("String_Node_Str","String_Node_Str");
      long skill2Id=skillTreeViews[1].getSkillTree().getId();
      int skill2Points=skillTreeViews[1].getSkillPoints();
      i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_TREE_2,skill2Id);
      i.putExtra(ArmorSetBuilderActivity.EXTRA_TALISMAN_SKILL_POINTS_2,skill2Points);
    }
    getTargetFragment().onActivityResult(ArmorSetBuilderActivity.REQUEST_CODE_CREATE_TALISMAN,Activity.RESULT_OK,i);
  }
}
Program: 96182
Project: 96182
Buggy source:
public ArmorSetBuilderSkillsAdapter(Context context,List<ArmorSetBuilderSession.SkillTreePointsSet> trees,ArmorSetBuilderSession session){
  super(context,R.layout.fragment_armor_set_builder_skills_item,trees);
  this.session=session;
}

Fixed version (ground truth):
public ArmorSetBuilderSkillsAdapter(Context context,List<ArmorSetBuilderSession.SkillTreePointsSet> trees,ArmorSetBuilderSession session){
  super(context,R.layout.fragment_armor_set_builder_skills_item,trees);
}
Program: 96184
Project: 96184
Buggy source:
public void removeArmor(int pieceIndex){
  armors[pieceIndex]=noArmor;
  removeAllDecorations(pieceIndex);
}

Fixed version (ground truth):
public void removeArmor(int pieceIndex){
  armors[pieceIndex]=noArmor;
  removeAllDecorations(pieceIndex);
  notifyArmorSetChangedListeners();
}
Program: 96185
Project: 96185
Buggy source:
public void setArmor(int pieceIndex,Armor armor){
  armors[pieceIndex]=armor;
}

Fixed version (ground truth):
public void setArmor(int pieceIndex,Armor armor){
  armors[pieceIndex]=armor;
  notifyArmorSetChangedListeners();
}
Program: 96186
Project: 96186
Buggy source:
public void removeAllDecorations(int pieceIndex){
  for (int i=0; i < decorations[pieceIndex].length; i++) {
    decorations[pieceIndex][i]=noDecoration;
  }
}

Fixed version (ground truth):
public void removeAllDecorations(int pieceIndex){
  for (int i=0; i < decorations[pieceIndex].length; i++) {
    decorations[pieceIndex][i]=noDecoration;
  }
  notifyArmorSetChangedListeners();
}
Program: 96187
Project: 96187
Buggy source:
/** 
 * Default constructor.
 */
public ArmorSetBuilderSession(){
  armors=new Armor[5];
  for (int i=0; i < armors.length; i++) {
    armors[i]=noArmor;
  }
  decorations=new Decoration[5][3];
  for (int i=0; i < decorations.length; i++) {
    for (int j=0; j < decorations[i].length; j++) {
      decorations[i][j]=noDecoration;
    }
  }
  skillTreePointsSets=new ArrayList<>();
}

Fixed version (ground truth):
/** 
 * Default constructor.
 */
public ArmorSetBuilderSession(){
  armors=new Armor[5];
  for (int i=0; i < armors.length; i++) {
    armors[i]=noArmor;
  }
  decorations=new Decoration[5][3];
  for (int i=0; i < decorations.length; i++) {
    for (int j=0; j < decorations[i].length; j++) {
      decorations[i][j]=noDecoration;
    }
  }
  skillTreePointsSets=new ArrayList<>();
  changedListeners=new ArrayList<>();
}
Program: 96188
Project: 96188
Buggy source:
/** 
 * Attempts to add a decoration to the specified armor piece.
 * @param pieceIndex The index of a piece in the set to fetch, according to {@link com.daviancorp.android.data.classes.ArmorSetBuilderSession}.
 * @param decoration The decoration to add.
 * @return True if the piece was successfuly added, otherwise false.
 */
public boolean addDecoration(int pieceIndex,Decoration decoration){
  if (getAvailableSlots(pieceIndex) >= decoration.getNumSlots()) {
    int i=0;
    while (decorations[pieceIndex][i] != noDecoration) {
      i++;
    }
    decorations[pieceIndex][i]=decoration;
    if (decoration.getNumSlots() == 2) {
      decorations[pieceIndex][i + 1]=dummy;
    }
    if (decoration.getNumSlots() == 3) {
      decorations[pieceIndex][i + 1]=dummy;
      decorations[pieceIndex][i + 2]=dummy;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Attempts to add a decoration to the specified armor piece.
 * @param pieceIndex The index of a piece in the set to fetch, according to {@link com.daviancorp.android.data.classes.ArmorSetBuilderSession}.
 * @param decoration The decoration to add.
 * @return True if the piece was successfuly added, otherwise false.
 */
public boolean addDecoration(int pieceIndex,Decoration decoration){
  if (getAvailableSlots(pieceIndex) >= decoration.getNumSlots()) {
    int i=0;
    while (decorations[pieceIndex][i] != noDecoration) {
      i++;
    }
    decorations[pieceIndex][i]=decoration;
    if (decoration.getNumSlots() == 2) {
      decorations[pieceIndex][i + 1]=dummy;
    }
    if (decoration.getNumSlots() == 3) {
      decorations[pieceIndex][i + 1]=dummy;
      decorations[pieceIndex][i + 2]=dummy;
    }
    notifyArmorSetChangedListeners();
    return true;
  }
 else {
    return false;
  }
}
Program: 96189
Project: 96189
Buggy source:
public void removeDecoration(int pieceIndex,int decorationIndex){
  if (decorations[pieceIndex][decorationIndex] != dummy) {
    decorations[pieceIndex][decorationIndex]=noDecoration;
    for (int j=decorationIndex + 1; j < decorations[pieceIndex].length; j++) {
      if (decorations[pieceIndex][j] == dummy) {
        decorations[pieceIndex][j]=noDecoration;
      }
 else {
        break;
      }
    }
  }
  int i=0;
  Decoration[] newDecorations=new Decoration[3];
  for (  Decoration d : decorations[pieceIndex]) {
    if (d != noDecoration) {
      newDecorations[i++]=d;
    }
  }
  while (i < newDecorations.length) {
    newDecorations[i++]=noDecoration;
  }
  decorations[pieceIndex]=newDecorations;
}

Fixed version (ground truth):
public void removeDecoration(int pieceIndex,int decorationIndex){
  if (decorations[pieceIndex][decorationIndex] != dummy) {
    decorations[pieceIndex][decorationIndex]=noDecoration;
    for (int j=decorationIndex + 1; j < decorations[pieceIndex].length; j++) {
      if (decorations[pieceIndex][j] == dummy) {
        decorations[pieceIndex][j]=noDecoration;
      }
 else {
        break;
      }
    }
  }
  int i=0;
  Decoration[] newDecorations=new Decoration[3];
  for (  Decoration d : decorations[pieceIndex]) {
    if (d != noDecoration) {
      newDecorations[i++]=d;
    }
  }
  while (i < newDecorations.length) {
    newDecorations[i++]=noDecoration;
  }
  decorations[pieceIndex]=newDecorations;
  notifyArmorSetChangedListeners();
}
Program: 96190
Project: 96190
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  session=new ArmorSetBuilderSession();
  viewPager=(ViewPager)findViewById(R.id.pager);
  adapter=new ArmorSetBuilderPagerAdapter(getSupportFragmentManager(),session);
  viewPager.setAdapter(adapter);
  mSlidingTabLayout.setViewPager(viewPager);
  armorSetChangedListeners=new ArrayList<>();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  session=new ArmorSetBuilderSession();
  session.addOnArmorSetChangedListener(this);
  viewPager=(ViewPager)findViewById(R.id.pager);
  adapter=new ArmorSetBuilderPagerAdapter(getSupportFragmentManager(),session);
  viewPager.setAdapter(adapter);
  mSlidingTabLayout.setViewPager(viewPager);
  onArmorSetActivityUpdateListeners=new ArrayList<>();
}
Program: 96191
Project: 96191
Buggy source:
public void addArmorSetChangedListener(ArmorSetChangedListener a){
  armorSetChangedListeners.add(a);
}

Fixed version (ground truth):
public void addArmorSetChangedListener(OnArmorSetActivityUpdateListener a){
  onArmorSetActivityUpdateListeners.add(a);
}
Program: 96192
Project: 96192
Buggy source:
public void fragmentResultReceived(int requestCode,int resultCode,Intent data){
  onActivityResult(requestCode,resultCode,data);
}

Fixed version (ground truth):
/** 
 * To be called when a fragment contained within this activity has   {@code onActivityResult} manually called on it. 
 */
public void fragmentResultReceived(int requestCode,int resultCode,Intent data){
  onActivityResult(requestCode,resultCode,data);
}
Program: 96194
Project: 96194
Buggy source:
public void removeDecoration(int pieceIndex,int decorationIndex){
  if (decorations[pieceIndex][decorationIndex] != dummy) {
    decorations[pieceIndex][decorationIndex]=noDecoration;
    for (int j=decorationIndex + 1; j < decorations[pieceIndex].length; j++) {
      if (decorations[pieceIndex][j] == dummy) {
        decorations[pieceIndex][j]=noDecoration;
      }
 else {
        break;
      }
    }
  }
  int i=0;
  Decoration[] newDecorations=new Decoration[3];
  for (  Decoration d : decorations[pieceIndex]) {
    newDecorations[i++]=d;
  }
  decorations[pieceIndex]=newDecorations;
}

Fixed version (ground truth):
public void removeDecoration(int pieceIndex,int decorationIndex){
  if (decorations[pieceIndex][decorationIndex] != dummy) {
    decorations[pieceIndex][decorationIndex]=noDecoration;
    for (int j=decorationIndex + 1; j < decorations[pieceIndex].length; j++) {
      if (decorations[pieceIndex][j] == dummy) {
        decorations[pieceIndex][j]=noDecoration;
      }
 else {
        break;
      }
    }
  }
  int i=0;
  Decoration[] newDecorations=new Decoration[3];
  for (  Decoration d : decorations[pieceIndex]) {
    if (d != noDecoration) {
      newDecorations[i++]=d;
    }
  }
  while (i < newDecorations.length) {
    newDecorations[i++]=noDecoration;
  }
  decorations[pieceIndex]=newDecorations;
}
Program: 96195
Project: 96195
Buggy source:
private PopupMenu createPopupMenu(){
  Context context=getContext();
  context.setTheme(R.style.PopupMenuStyle);
  PopupMenu popup=new PopupMenu(context,popupMenuButton);
  if (!session.isPieceSelected(pieceIndex)) {
    popup.getMenu().add(Menu.NONE,MENU_ADD_PIECE,Menu.NONE,R.string.armor_set_builder_add_piece);
  }
 else {
    popup.getMenu().add(Menu.NONE,MENU_REMOVE_PIECE,Menu.NONE,R.string.armor_set_builder_remove_piece);
    popup.getMenu().add(Menu.NONE,MENU_PIECE_INFO,Menu.NONE,R.string.armor_set_builder_piece_info);
  }
  if (session.getAvailableSlots(pieceIndex) > 0) {
    popup.getMenu().add(Menu.NONE,MENU_ADD_DECORATION,Menu.NONE,R.string.armor_set_builder_add_decoration);
  }
  if (session.hasDecorations(pieceIndex)) {
    popup.getMenu().add(Menu.NONE,MENU_REMOVE_DECORATION,Menu.NONE,R.string.armor_set_builder_remove_decoration);
  }
  popup.setOnMenuItemClickListener(new PiecePopupMenuClickListener());
  return popup;
}

Fixed version (ground truth):
private PopupMenu createPopupMenu(){
  PopupMenu popup=new PopupMenu(getContext(),popupMenuButton);
  if (!session.isPieceSelected(pieceIndex)) {
    popup.getMenu().add(Menu.NONE,MENU_ADD_PIECE,Menu.NONE,R.string.armor_set_builder_add_piece);
  }
 else {
    popup.getMenu().add(Menu.NONE,MENU_REMOVE_PIECE,Menu.NONE,R.string.armor_set_builder_remove_piece);
    popup.getMenu().add(Menu.NONE,MENU_PIECE_INFO,Menu.NONE,R.string.armor_set_builder_piece_info);
  }
  if (session.getAvailableSlots(pieceIndex) > 0) {
    popup.getMenu().add(Menu.NONE,MENU_ADD_DECORATION,Menu.NONE,R.string.armor_set_builder_add_decoration);
  }
  if (session.hasDecorations(pieceIndex)) {
    popup.getMenu().add(Menu.NONE,MENU_REMOVE_DECORATION,Menu.NONE,R.string.armor_set_builder_remove_decoration);
  }
  popup.setOnMenuItemClickListener(new PiecePopupMenuClickListener());
  return popup;
}
Program: 96198
Project: 96198
Buggy source:
@Override public void bindView(View view,Context context,Cursor cursor){
  super.bindView(view,context,cursor);
  Weapon weapon=mWeaponCursor.getWeapon();
  TextView specialtv=(TextView)view.findViewById(R.id.special_text);
  DrawSharpness sharpnessDrawable=(DrawSharpness)view.findViewById(R.id.sharpness);
  specialtv.setText("String_Node_Str");
  String type=weapon.getWtype();
  if (type.equals("String_Node_Str")) {
    String special=weapon.getHornNotes();
    ImageView note1v=(ImageView)view.findViewById(R.id.note_image_1);
    ImageView note2v=(ImageView)view.findViewById(R.id.note_image_2);
    ImageView note3v=(ImageView)view.findViewById(R.id.note_image_3);
    note1v.setImageDrawable(getNoteDrawable(context,special.charAt(0)));
    note2v.setImageDrawable(getNoteDrawable(context,special.charAt(1)));
    note3v.setImageDrawable(getNoteDrawable(context,special.charAt(2)));
  }
 else   if (type.equals("String_Node_Str")) {
    String special=weapon.getShellingType();
    specialtv.setText(special);
    specialtv.setGravity(Gravity.CENTER);
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    String special=weapon.getPhial();
    specialtv.setText(special);
    specialtv.setGravity(Gravity.CENTER);
  }
  String sharpString=weapon.getSharpness();
  sharpnessDrawable.init(sharpString);
}

Fixed version (ground truth):
@Override public void bindView(View view,Context context,Cursor cursor){
  super.bindView(view,context,cursor);
  Weapon weapon=mWeaponCursor.getWeapon();
  TextView specialtv=(TextView)view.findViewById(R.id.special_text);
  DrawSharpness sharpnessDrawable=(DrawSharpness)view.findViewById(R.id.sharpness);
  sharpnessDrawable.invalidate();
  specialtv.setText("String_Node_Str");
  String type=weapon.getWtype();
  if (type.equals("String_Node_Str")) {
    String special=weapon.getHornNotes();
    ImageView note1v=(ImageView)view.findViewById(R.id.note_image_1);
    ImageView note2v=(ImageView)view.findViewById(R.id.note_image_2);
    ImageView note3v=(ImageView)view.findViewById(R.id.note_image_3);
    note1v.setImageDrawable(getNoteDrawable(context,special.charAt(0)));
    note2v.setImageDrawable(getNoteDrawable(context,special.charAt(1)));
    note3v.setImageDrawable(getNoteDrawable(context,special.charAt(2)));
  }
 else   if (type.equals("String_Node_Str")) {
    String special=weapon.getShellingType();
    specialtv.setText(special);
    specialtv.setGravity(Gravity.CENTER);
  }
 else   if (type.equals("String_Node_Str") || type.equals("String_Node_Str")) {
    String special=weapon.getPhial();
    specialtv.setText(special);
    specialtv.setGravity(Gravity.CENTER);
  }
  String sharpString=weapon.getSharpness();
  sharpnessDrawable.init(sharpString);
}
Program: 96199
Project: 96199
Buggy source:
@Override public Fragment getItem(int index){
switch (index) {
case 0:
    return MonsterGridFragment.newInstance(null);
case 1:
  return MonsterGridFragment.newInstance("String_Node_Str");
case 2:
return MonsterGridFragment.newInstance("String_Node_Str");
default :
return null;
}
}

Fixed version (ground truth):
@Override public Fragment getItem(int index){
switch (index) {
case 0:
    return MonsterGridFragment.newInstance("String_Node_Str");
case 1:
  return MonsterGridFragment.newInstance("String_Node_Str");
case 2:
return MonsterGridFragment.newInstance(null);
default :
return null;
}
}
Program: 96201
Project: 96201
Buggy source:
/** 
 * Sets the image for the title-bar, so IF it shows in the task-bar, it will have the corresponding image as the SystemTray image
 */
public void setTitleBarImage(final File imageFile){
  if (this.iconFile == null || !this.iconFile.equals(imageFile)) {
    this.iconFile=imageFile;
    try {
      Image image=new ImageIcon(ImageIO.read(imageFile)).getImage();
      image.flush();
      hiddenDialog.setIconImage(image);
    }
 catch (    IOException e) {
      SystemTray.logger.error("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the image for the title-bar, so IF it shows in the task-bar, it will have the corresponding image as the SystemTray image
 */
public void setTitleBarImage(final File imageFile){
  if (this.iconFile == null || !this.iconFile.equals(imageFile)) {
    this.iconFile=imageFile;
    try {
      if (imageFile != null) {
        Image image=new ImageIcon(ImageIO.read(imageFile)).getImage();
        image.flush();
        hiddenDialog.setIconImage(image);
      }
    }
 catch (    IOException e) {
      SystemTray.logger.error("String_Node_Str");
    }
  }
}
Program: 96202
Project: 96202
Buggy source:
/** 
 * Removes this menu entry from the menu and releases all system resources associated with this menu entry
 */
public void remove(){
  if (peer != null) {
    peer.remove();
    this.parent=null;
    this.systemTray=null;
    peer=null;
  }
}

Fixed version (ground truth):
/** 
 * Removes this menu entry from the menu and releases all system resources associated with this menu entry.
 */
public void remove(){
  if (peer != null) {
    peer.remove();
    this.parent=null;
    this.systemTray=null;
    peer=null;
  }
}
Program: 96203
Project: 96203
Buggy source:
/** 
 * This removes all menu entries from this menu AND this menu from it's parent
 */
@Override public void remove(){
  clear();
  super.remove();
}

Fixed version (ground truth):
/** 
 * This removes all menu entries from this menu AND this menu from it's parent
 */
@Override public void remove(){
synchronized (menuEntries) {
    menuEntries.clear();
  }
  super.remove();
}
Program: 96205
Project: 96205
Buggy source:
/** 
 * Shuts-down the SystemTray, by removing the menus + tray icon. After calling this method, you MUST call `get()` or `getNative()` again to obtain a new reference to the SystemTray.
 */
public void shutdown(){
  final Menu menu=systemTrayMenu;
  if (menu != null) {
    menu.remove();
  }
  systemTrayMenu=null;
}

Fixed version (ground truth):
/** 
 * Shuts-down the SystemTray, by removing the menus + tray icon. After calling this method, you MUST call `get()` or `getNative()` again to obtain a new reference to the SystemTray.
 */
public void shutdown(){
  final Menu menu=systemTrayMenu;
  if (menu != null) {
    menu.remove();
  }
  systemTrayMenu=null;
  EventDispatch.shutdown();
}
Program: 96206
Project: 96206
Buggy source:
/** 
 * the menu entry looks FUNKY when there are a mis-match of entries WITH and WITHOUT images. This is primarily only with AppIndicators, although not always. <p> called on the DISPATCH thread
 */
public void setSpacerImage(final boolean everyoneElseHasImages){
  if (hasLegitImage) {
    return;
  }
  if (spacerImage != null) {
    Gtk2.gtk_container_remove(_native,spacerImage);
    spacerImage=null;
    Gtk2.gtk_widget_show_all(_native);
  }
  if (everyoneElseHasImages) {
    spacerImage=Gtk2.gtk_image_new_from_file(transparentIcon.getAbsolutePath());
    Gtk2.gtk_image_menu_item_set_image(_native,spacerImage);
    Gtk2.gtk_image_menu_item_set_always_show_image(_native,true);
  }
  Gtk2.gtk_widget_show_all(_native);
}

Fixed version (ground truth):
/** 
 * the menu entry looks FUNKY when there are a mis-match of entries WITH and WITHOUT images. This is primarily only with AppIndicators, although not always. <p> called on the DISPATCH thread
 */
public void setSpacerImage(final boolean everyoneElseHasImages){
  if (hasLegitImage) {
    return;
  }
  removeSpacerImage();
  if (everyoneElseHasImages) {
    addSpacerImage();
  }
  Gtk2.gtk_widget_show_all(_native);
}
Program: 96207
Project: 96207
Buggy source:
@Override public void add(final Menu parentMenu,final Entry entry,final int index){
  GtkEventDispatch.dispatchAndWait(new Runnable(){
    @Override public void run(){
      deleteMenu();
      if (entry instanceof Menu) {
        GtkMenu item=new GtkMenu(GtkMenu.this);
        menuEntries.add(index,item);
        ((Menu)entry).bind(item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Separator) {
        GtkMenuItemSeparator item=new GtkMenuItemSeparator(GtkMenu.this);
        menuEntries.add(index,item);
        entry.bind(item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Checkbox) {
        GtkMenuItemCheckbox item=new GtkMenuItemCheckbox(GtkMenu.this);
        menuEntries.add(index,item);
        ((Checkbox)entry).bind(item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Status) {
        GtkMenuItemStatus item=new GtkMenuItemStatus(GtkMenu.this);
        menuEntries.add(index,item);
        ((Status)entry).bind(item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof MenuItem) {
        GtkMenuItem item=new GtkMenuItem(GtkMenu.this);
        menuEntries.add(index,item);
        ((MenuItem)entry).bind(item,parentMenu,parentMenu.getSystemTray());
      }
      createMenu();
    }
  }
);
}

Fixed version (ground truth):
@Override public void add(final Menu parentMenu,final Entry entry,final int index){
  GtkEventDispatch.dispatchAndWait(new Runnable(){
    @Override public void run(){
      deleteMenu();
      GtkBaseMenuItem item=null;
      if (entry instanceof Menu) {
        item=new GtkMenu(GtkMenu.this);
        menuEntries.add(index,item);
      }
 else       if (entry instanceof Separator) {
        item=new GtkMenuItemSeparator(GtkMenu.this);
        menuEntries.add(index,item);
      }
 else       if (entry instanceof Checkbox) {
        item=new GtkMenuItemCheckbox(GtkMenu.this);
        menuEntries.add(index,item);
      }
 else       if (entry instanceof Status) {
        item=new GtkMenuItemStatus(GtkMenu.this);
        menuEntries.add(index,item);
      }
 else       if (entry instanceof MenuItem) {
        item=new GtkMenuItem(GtkMenu.this);
        menuEntries.add(index,item);
      }
      createMenu();
      if (entry instanceof Menu) {
        ((Menu)entry).bind((GtkMenu)item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Separator) {
        ((Separator)entry).bind((GtkMenuItemSeparator)item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Checkbox) {
        ((Checkbox)entry).bind((GtkMenuItemCheckbox)item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof Status) {
        ((Status)entry).bind((GtkMenuItemStatus)item,parentMenu,parentMenu.getSystemTray());
      }
 else       if (entry instanceof MenuItem) {
        ((MenuItem)entry).bind((GtkMenuItem)item,parentMenu,parentMenu.getSystemTray());
      }
    }
  }
);
}
Program: 96208
Project: 96208
Buggy source:
@Override public void remove(){
  Runnable runnable=new Runnable(){
    @Override public void run(){
      GtkMenu parent=getParent();
      if (parent != null) {
        parent.menuEntries.remove(GtkMenu.this);
      }
      obliterateMenu();
      if (parent != null) {
        Gtk2.gtk_menu_item_set_submenu(_native,null);
        parent.deleteMenu();
        parent.createMenu();
      }
    }
  }
;
  if (GtkEventDispatch.isDispatch.get()) {
    runnable.run();
  }
 else {
    GtkEventDispatch.dispatch(runnable);
  }
}

Fixed version (ground truth):
@Override public void remove(){
  GtkEventDispatch.dispatch(new Runnable(){
    @Override public void run(){
      GtkMenu parent=getParent();
      if (parent != null) {
        parent.menuEntries.remove(GtkMenu.this);
      }
      obliterateMenu();
      if (parent != null) {
        Gtk2.gtk_menu_item_set_submenu(_native,null);
        parent.deleteMenu();
        parent.createMenu();
      }
    }
  }
);
}
Program: 96209
Project: 96209
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void setImage(final MenuItem menuItem){
  setLegitImage(menuItem.getImage() != null);
  Runnable runnable=new Runnable(){
    @Override public void run(){
      if (image != null) {
        Gtk2.gtk_container_remove(_native,image);
        image=null;
        Gtk2.gtk_widget_show_all(_native);
      }
      if (menuItem.getImage() != null) {
        image=Gtk2.gtk_image_new_from_file(menuItem.getImage().getAbsolutePath());
        Gtk2.gtk_image_menu_item_set_image(_native,image);
        Gtk2.gtk_image_menu_item_set_always_show_image(_native,true);
      }
      Gtk2.gtk_widget_show_all(_native);
    }
  }
;
  if (GtkEventDispatch.isDispatch.get()) {
    runnable.run();
  }
 else {
    GtkEventDispatch.dispatch(runnable);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void setImage(final MenuItem menuItem){
  setLegitImage(menuItem.getImage() != null);
  GtkEventDispatch.dispatch(new Runnable(){
    @Override public void run(){
      if (image != null) {
        Gtk2.gtk_container_remove(_native,image);
        image=null;
        Gtk2.gtk_widget_show_all(_native);
      }
      if (menuItem.getImage() != null) {
        image=Gtk2.gtk_image_new_from_file(menuItem.getImage().getAbsolutePath());
        Gtk2.gtk_image_menu_item_set_image(_native,image);
        Gtk2.gtk_image_menu_item_set_always_show_image(_native,true);
      }
      Gtk2.gtk_widget_show_all(_native);
    }
  }
);
}
Program: 96210
Project: 96210
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void setCallback(final Checkbox menuItem){
  if (callback != null) {
    _native.removeActionListener(callback);
  }
  callback=menuItem.getCallback();
  if (callback != null) {
    callback=new ActionListener(){
      final ActionListener cb=menuItem.getCallback();
      @Override public void actionPerformed(      ActionEvent e){
        menuItem.setChecked(!isChecked);
        EventDispatch.runLater(new Runnable(){
          @Override public void run(){
            try {
              cb.actionPerformed(new ActionEvent(menuItem,ActionEvent.ACTION_PERFORMED,"String_Node_Str"));
            }
 catch (            Throwable throwable) {
              SystemTray.logger.error("String_Node_Str",menuItem.getText(),throwable);
            }
          }
        }
);
      }
    }
;
    _native.addActionListener(callback);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void setCallback(final Checkbox menuItem){
  if (callback != null) {
    _native.removeItemListener(callback);
  }
  ActionListener callback=menuItem.getCallback();
  if (callback != null) {
    this.callback=new ItemListener(){
      final ActionListener cb=menuItem.getCallback();
      @Override public void itemStateChanged(      final ItemEvent e){
        menuItem.setChecked(!isChecked);
        EventDispatch.runLater(new Runnable(){
          @Override public void run(){
            try {
              cb.actionPerformed(new ActionEvent(menuItem,ActionEvent.ACTION_PERFORMED,"String_Node_Str"));
            }
 catch (            Throwable throwable) {
              SystemTray.logger.error("String_Node_Str",menuItem.getText(),throwable);
            }
          }
        }
);
      }
    }
;
    _native.addItemListener(this.callback);
  }
}
Program: 96211
Project: 96211
Buggy source:
@Override public void run(){
  _native.deleteShortcut();
  _native.setEnabled(false);
  if (callback != null) {
    _native.removeActionListener(callback);
    callback=null;
  }
  parent._native.remove(_native);
  _native.removeNotify();
}

Fixed version (ground truth):
@Override public void run(){
  _native.deleteShortcut();
  _native.setEnabled(false);
  if (callback != null) {
    _native.removeItemListener(callback);
    callback=null;
  }
  parent._native.remove(_native);
  _native.removeNotify();
}
Program: 96212
Project: 96212
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void remove(){
  SwingUtil.invokeLater(new Runnable(){
    @Override public void run(){
      _native.deleteShortcut();
      _native.setEnabled(false);
      if (callback != null) {
        _native.removeActionListener(callback);
        callback=null;
      }
      parent._native.remove(_native);
      _native.removeNotify();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void remove(){
  SwingUtil.invokeLater(new Runnable(){
    @Override public void run(){
      _native.deleteShortcut();
      _native.setEnabled(false);
      if (callback != null) {
        _native.removeItemListener(callback);
        callback=null;
      }
      parent._native.remove(_native);
      _native.removeNotify();
    }
  }
);
}
Program: 96213
Project: 96213
Buggy source:
private static boolean isOracleVM(){
  String vendor=System.getProperty("String_Node_Str").toLowerCase(Locale.US);
  return !(vendor.contains("String_Node_Str") || vendor.contains("String_Node_Str"));
}

Fixed version (ground truth):
private static boolean isOracleVM(){
  String vendor=System.getProperty("String_Node_Str").toLowerCase(Locale.US);
  return vendor.contains("String_Node_Str") || vendor.contains("String_Node_Str");
}
Program: 96214
Project: 96214
Buggy source:
/** 
 * Allows one to specify the Look & Feel of a menu entry
 * @param jMenuItem the swing JMenuItem that is displayed in the menu
 * @param entry the entry which is bound to the JMenuItem. Can be null during initialization.
 * @return the UI used to customize the Look & Feel of the menu entry
 */
@Override public MenuItemUI getItemUI(final JMenuItem jMenuItem,final Entry entry){
  return new DefaultMenuItemUI(jMenuItem){
    @Override public void installUI(    final JComponent c){
      super.installUI(c);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Allows one to specify the Look & Feel of a menu entry
 * @param jMenuItem the swing JMenuItem that is displayed in the menu
 * @param entry the entry which is bound to the JMenuItem. Can be null during initialization.
 * @return the UI used to customize the Look & Feel of the menu entry
 */
@Override public MenuItemUI getItemUI(final JMenuItem jMenuItem,final Entry entry){
  if (isWindowsXP) {
    if (jMenuItem instanceof JMenu) {
      return new WindowsMenuUI(){
        @Override public void installUI(        final JComponent c){
          super.installUI(c);
        }
        @Override protected void paintMenuItem(        Graphics g,        JComponent c,        Icon checkIcon,        Icon arrowIcon,        Color background,        Color foreground,        int defaultTextIconGap){
          super.paintMenuItem(g,c,null,arrowIcon,background,foreground,defaultTextIconGap);
        }
        @Override public Dimension getPreferredSize(        JComponent c){
          return getPreferredMenuItemSize(c,null,arrowIcon,defaultTextIconGap);
        }
        @Override protected Dimension getPreferredMenuItemSize(        final JComponent c,        final Icon checkIcon,        final Icon arrowIcon,        final int defaultTextIconGap){
          return super.getPreferredMenuItemSize(c,null,arrowIcon,defaultTextIconGap);
        }
      }
;
    }
 else {
      return new WindowsMenuItemUI(){
        @Override public void installUI(        final JComponent c){
          super.installUI(c);
        }
        @Override protected void paintMenuItem(        Graphics g,        JComponent c,        Icon checkIcon,        Icon arrowIcon,        Color background,        Color foreground,        int defaultTextIconGap){
          super.paintMenuItem(g,c,null,arrowIcon,background,foreground,defaultTextIconGap);
        }
        @Override public Dimension getPreferredSize(        JComponent c){
          return getPreferredMenuItemSize(c,null,arrowIcon,defaultTextIconGap);
        }
      }
;
    }
  }
 else {
    return new DefaultMenuItemUI(jMenuItem){
      @Override public void installUI(      final JComponent c){
        super.installUI(c);
      }
    }
;
  }
}
Program: 96215
Project: 96215
Buggy source:
@Override public void setTooltip(final MenuItem menuItem){
  SwingUtil.invokeLater(new Runnable(){
    @Override public void run(){
      _native.setLabel(menuItem.getTooltip());
    }
  }
);
}

Fixed version (ground truth):
@Override public void setTooltip(final MenuItem menuItem){
}
Program: 96216
Project: 96216
Buggy source:
public Color getColor(){
  return new Color(red(),green(),blue());
}

Fixed version (ground truth):
public Color getColor(){
  read();
  return new Color(red(),green(),blue());
}
Program: 96217
Project: 96217
Buggy source:
public static native void g_object_get(Pointer instance,String property_name,PointerByReference value,Pointer terminator);

Fixed version (ground truth):
public static native void g_object_get(Pointer instance,String property_name,Pointer value,Pointer terminator);
Program: 96218
Project: 96218
Buggy source:
@SuppressWarnings("String_Node_Str") private static synchronized File resizeAndCache(final int height,InputStream imageStream){
  if (imageStream == null) {
    return null;
  }
  final String cacheName;
  boolean needsResize=true;
  try {
    imageStream=makeByteArrayInputStream(imageStream);
    imageStream.mark(0);
    cacheName=height + "String_Node_Str" + CacheUtil.createNameAsHash(imageStream);
    ((ByteArrayInputStream)imageStream).reset();
    final File check=CacheUtil.check(cacheName);
    if (check != null) {
      return check;
    }
    imageStream.mark(0);
    Dimension imageSize=ImageUtil.getImageSize(imageStream);
    if (height == (int)imageSize.getHeight()) {
      needsResize=false;
    }
  }
 catch (  Exception e) {
    SystemTray.logger.error("String_Node_Str",e);
    return getErrorImage(height);
  }
 finally {
    ((ByteArrayInputStream)imageStream).reset();
  }
  if (needsResize) {
    try {
      File resizedFile=resizeFileNoCheck(height,imageStream);
      try {
        return CacheUtil.save(cacheName,resizedFile);
      }
 catch (      Exception e) {
        SystemTray.logger.error("String_Node_Str",e);
        return getErrorImage(height);
      }
    }
 catch (    Exception e) {
      SystemTray.logger.error("String_Node_Str",e);
      return getErrorImage(height);
    }
  }
 else {
    try {
      return CacheUtil.save(cacheName,imageStream);
    }
 catch (    Exception e) {
      SystemTray.logger.error("String_Node_Str",e);
      return getErrorImage(height);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static synchronized File resizeAndCache(final int size,InputStream imageStream){
  if (imageStream == null) {
    return null;
  }
  final String cacheName;
  boolean needsResize=true;
  try {
    imageStream=makeByteArrayInputStream(imageStream);
    imageStream.mark(0);
    cacheName=size + "String_Node_Str" + CacheUtil.createNameAsHash(imageStream);
    ((ByteArrayInputStream)imageStream).reset();
    final File check=CacheUtil.check(cacheName);
    if (check != null) {
      return check;
    }
    imageStream.mark(0);
    Dimension imageSize=ImageUtil.getImageSize(imageStream);
    if (size == (int)imageSize.getHeight() && size == (int)imageSize.getWidth()) {
      needsResize=false;
    }
  }
 catch (  Exception e) {
    SystemTray.logger.error("String_Node_Str",e);
    return getErrorImage(size);
  }
 finally {
    ((ByteArrayInputStream)imageStream).reset();
  }
  if (needsResize) {
    try {
      File resizedFile=resizeFileNoCheck(size,imageStream);
      try {
        return CacheUtil.save(cacheName,resizedFile);
      }
 catch (      Exception e) {
        SystemTray.logger.error("String_Node_Str",e);
        return getErrorImage(size);
      }
    }
 catch (    Exception e) {
      SystemTray.logger.error("String_Node_Str",e);
      return getErrorImage(size);
    }
  }
 else {
    try {
      return CacheUtil.save(cacheName,imageStream);
    }
 catch (    Exception e) {
      SystemTray.logger.error("String_Node_Str",e);
      return getErrorImage(size);
    }
  }
}
Program: 96219
Project: 96219
Buggy source:
/** 
 * Resizes the given InputStream to the specified size. No checks are performed if it's the correct size to begin with.
 * @return the file on disk that is the resized icon
 */
@SuppressWarnings("String_Node_Str") private static File resizeFileNoCheck(final int size,InputStream inputStream) throws IOException {
  File newFile=CacheUtil.create("String_Node_Str");
  Image image;
  image=ImageUtil.getImageImmediate(ImageIO.read(inputStream));
  image=image.getScaledInstance(-1,size,Image.SCALE_SMOOTH);
  newFile.delete();
  BufferedImage bufferedImage=getBufferedImage(image);
  ImageIO.write(bufferedImage,"String_Node_Str",newFile);
  return newFile;
}

Fixed version (ground truth):
/** 
 * Resizes the given InputStream to the specified height. No checks are performed if it's the correct height to begin with. Additionally, the image is scaled to where it's largest dimension will always be <= to the size.
 * @return the file on disk that is the resized icon
 */
@SuppressWarnings("String_Node_Str") private static File resizeFileNoCheck(final int size,InputStream inputStream) throws IOException {
  File newFile=CacheUtil.create("String_Node_Str");
  newFile.delete();
  Image image=ImageUtil.getImageImmediate(ImageIO.read(inputStream));
  int height=image.getHeight(null);
  int width=image.getWidth(null);
  if (width > height) {
    image=image.getScaledInstance(size,-1,Image.SCALE_SMOOTH);
  }
 else {
    image=image.getScaledInstance(-1,size,Image.SCALE_SMOOTH);
  }
  BufferedImage bufferedImage=ImageUtil.getSquareBufferedImage(image);
  ImageIO.write(bufferedImage,"String_Node_Str",newFile);
  return newFile;
}
Program: 96224
Project: 96224
Buggy source:
private static void fixTraySize(final CtBehavior[] behaviors,final int traySize){
  for (  CtBehavior behavior : behaviors) {
    MethodInfo methodInfo=behavior.getMethodInfo();
    CodeIterator methodIterator=methodInfo.getCodeAttribute().iterator();
    while (methodIterator.hasNext()) {
      int index;
      try {
        index=methodIterator.next();
        int opcode=methodIterator.byteAt(index);
switch (opcode) {
case BIPUSH:
{
            int i=methodIterator.byteAt(index + 1);
            if (i == 24) {
              methodIterator.writeByte((byte)traySize,index + 1);
            }
          }
      }
    }
 catch (    BadBytecode badBytecode) {
      badBytecode.printStackTrace();
    }
  }
}
}

Fixed version (ground truth):
private static void fixTraySize(final CtBehavior[] behaviors,final int oldTraySize,final int newTraySize){
  for (  CtBehavior behavior : behaviors) {
    MethodInfo methodInfo=behavior.getMethodInfo();
    CodeIterator methodIterator=methodInfo.getCodeAttribute().iterator();
    while (methodIterator.hasNext()) {
      int index;
      try {
        index=methodIterator.next();
        int opcode=methodIterator.byteAt(index);
switch (opcode) {
case BIPUSH:
{
            int i=methodIterator.byteAt(index + 1);
            if (i == oldTraySize) {
              methodIterator.writeByte((byte)newTraySize,index + 1);
            }
          }
      }
    }
 catch (    BadBytecode badBytecode) {
      badBytecode.printStackTrace();
    }
  }
}
}
Program: 96226
Project: 96226
Buggy source:
private static boolean isTrayType(final Class<? extends Tray> tray,final TrayType trayType){
switch (trayType) {
case GtkStatusIcon:
    return tray == _GtkStatusIconNativeTray.class;
case AppIndicator:
  return tray == _AppIndicatorNativeTray.class;
case Swing:
return tray == _SwingTray.class;
case AWT:
return tray == _AwtTray.class;
}
return false;
}

Fixed version (ground truth):
void isTrayType(){
}