Program: 93751
Project: 93751
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=null;
  ViewHolder viewHolder;
  Contacts contacts=getItem(position);
  if (null == convertView) {
    view=LayoutInflater.from(mContext).inflate(mTextViewResourceId,null);
    viewHolder=new ViewHolder();
    viewHolder.mAlphabetTv=(TextView)view.findViewById(R.id.alphabet_text_view);
    viewHolder.mContactsMultiplePhoneOperationPromptIv=(ImageView)view.findViewById(R.id.contacts_multiple_phone_operation_prompt_image_view);
    viewHolder.mSelectContactsCB=(CheckBox)view.findViewById(R.id.select_contacts_check_box);
    viewHolder.mNameTv=(TextView)view.findViewById(R.id.name_text_view);
    viewHolder.mPhoneNumber=(TextView)view.findViewById(R.id.phone_number_text_view);
    viewHolder.mOperationViewIv=(ImageView)view.findViewById(R.id.operation_view_image_view);
    viewHolder.mOperationViewLayout=(View)view.findViewById(R.id.operation_view_layout);
    viewHolder.mCallIv=(ImageView)view.findViewById(R.id.call_image_view);
    viewHolder.mSmsIv=(ImageView)view.findViewById(R.id.sms_image_view);
    view.setTag(viewHolder);
  }
 else {
    view=convertView;
    viewHolder=(ViewHolder)view.getTag();
  }
  showAlphabetIndex(viewHolder.mAlphabetTv,position,contacts);
switch (contacts.getSearchByType()) {
case SearchByNull:
    ViewUtil.showTextNormal(viewHolder.mNameTv,contacts.getName());
  if (null == contacts.getNextContacts()) {
    if ((true == contacts.isBelongMultipleContactsPhone()) && (false == contacts.isHideMultipleContacts())) {
      ViewUtil.invisibleView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
    }
 else {
      ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
    }
    ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber());
  }
 else {
    if (true == contacts.getNextContacts().isHideMultipleContacts()) {
      ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
      ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber() + mContext.getString(R.string.phone_number_count,multipleNumbersContactsCount(contacts) + 1));
    }
 else {
      ViewUtil.showView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
      ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber() + "String_Node_Str" + mContext.getString(R.string.click_to_hide)+ "String_Node_Str");
    }
  }
break;
case SearchByPhoneNumber:
ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
ViewUtil.showTextNormal(viewHolder.mNameTv,contacts.getName());
ViewUtil.showTextHighlight(viewHolder.mPhoneNumber,contacts.getPhoneNumber(),contacts.getMatchKeywords().toString());
break;
case SearchByName:
ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
ViewUtil.showTextHighlight(viewHolder.mNameTv,contacts.getName(),contacts.getMatchKeywords().toString());
ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber());
break;
default :
break;
}
viewHolder.mSelectContactsCB.setTag(position);
viewHolder.mSelectContactsCB.setChecked(contacts.isSelected());
viewHolder.mSelectContactsCB.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
int position=(Integer)buttonView.getTag();
Contacts contacts=getItem(position);
if ((true == isChecked) && (false == contacts.isSelected())) {
contacts.setSelected(isChecked);
addSelectedContacts(contacts);
}
 else if ((false == isChecked) && (true == contacts.isSelected())) {
contacts.setSelected(isChecked);
removeSelectedContacts(contacts);
}
 else {
return;
}
}
}
);
viewHolder.mOperationViewIv.setTag(position);
int resid=(true == contacts.isHideOperationView()) ? (R.drawable.arrow_down) : (R.drawable.arrow_up);
viewHolder.mOperationViewIv.setBackgroundResource(resid);
if (true == contacts.isHideOperationView()) {
ViewUtil.hideView(viewHolder.mOperationViewLayout);
}
 else {
ViewUtil.showView(viewHolder.mOperationViewLayout);
}
viewHolder.mOperationViewIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
contacts.setHideOperationView(!contacts.isHideOperationView());
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsRefreshView();
}
}
}
);
viewHolder.mCallIv.setTag(position);
viewHolder.mCallIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsCall(contacts);
}
}
}
);
viewHolder.mSmsIv.setTag(position);
viewHolder.mSmsIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsSms(contacts);
}
}
}
);
return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=null;
  ViewHolder viewHolder;
  Contacts contacts=getItem(position);
  if (null == convertView) {
    view=LayoutInflater.from(mContext).inflate(mTextViewResourceId,null);
    viewHolder=new ViewHolder();
    viewHolder.mAlphabetTv=(TextView)view.findViewById(R.id.alphabet_text_view);
    viewHolder.mContactsMultiplePhoneOperationPromptIv=(ImageView)view.findViewById(R.id.contacts_multiple_phone_operation_prompt_image_view);
    viewHolder.mSelectContactsCB=(CheckBox)view.findViewById(R.id.select_contacts_check_box);
    viewHolder.mNameTv=(TextView)view.findViewById(R.id.name_text_view);
    viewHolder.mPhoneNumber=(TextView)view.findViewById(R.id.phone_number_text_view);
    viewHolder.mOperationViewIv=(ImageView)view.findViewById(R.id.operation_view_image_view);
    viewHolder.mOperationViewLayout=(View)view.findViewById(R.id.operation_view_layout);
    viewHolder.mCallIv=(ImageView)view.findViewById(R.id.call_image_view);
    viewHolder.mSmsIv=(ImageView)view.findViewById(R.id.sms_image_view);
    view.setTag(viewHolder);
  }
 else {
    view=convertView;
    viewHolder=(ViewHolder)view.getTag();
  }
  showAlphabetIndex(viewHolder.mAlphabetTv,position,contacts);
switch (contacts.getSearchByType()) {
case SearchByNull:
    ViewUtil.showTextNormal(viewHolder.mNameTv,contacts.getName());
  if (false == contacts.isBelongMultipleContactsPhone()) {
    ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
    ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber());
  }
 else {
    if (true == contacts.isFirstMultipleContacts()) {
      if (true == contacts.getNextContacts().isHideMultipleContacts()) {
        ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
        ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber() + mContext.getString(R.string.phone_number_count,multipleNumbersContactsCount(contacts) + 1));
      }
 else {
        ViewUtil.showView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
        ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber() + "String_Node_Str" + mContext.getString(R.string.click_to_hide)+ "String_Node_Str");
      }
    }
 else {
      if (false == contacts.isHideMultipleContacts()) {
        ViewUtil.invisibleView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
      }
 else {
        ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
      }
      ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber());
    }
  }
break;
case SearchByPhoneNumber:
ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
ViewUtil.showTextNormal(viewHolder.mNameTv,contacts.getName());
ViewUtil.showTextHighlight(viewHolder.mPhoneNumber,contacts.getPhoneNumber(),contacts.getMatchKeywords().toString());
break;
case SearchByName:
ViewUtil.hideView(viewHolder.mContactsMultiplePhoneOperationPromptIv);
ViewUtil.showTextHighlight(viewHolder.mNameTv,contacts.getName(),contacts.getMatchKeywords().toString());
ViewUtil.showTextNormal(viewHolder.mPhoneNumber,contacts.getPhoneNumber());
break;
default :
break;
}
viewHolder.mSelectContactsCB.setTag(position);
viewHolder.mSelectContactsCB.setChecked(contacts.isSelected());
viewHolder.mSelectContactsCB.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
int position=(Integer)buttonView.getTag();
Contacts contacts=getItem(position);
if ((true == isChecked) && (false == contacts.isSelected())) {
contacts.setSelected(isChecked);
addSelectedContacts(contacts);
}
 else if ((false == isChecked) && (true == contacts.isSelected())) {
contacts.setSelected(isChecked);
removeSelectedContacts(contacts);
}
 else {
return;
}
}
}
);
viewHolder.mOperationViewIv.setTag(position);
int resid=(true == contacts.isHideOperationView()) ? (R.drawable.arrow_down) : (R.drawable.arrow_up);
viewHolder.mOperationViewIv.setBackgroundResource(resid);
if (true == contacts.isHideOperationView()) {
ViewUtil.hideView(viewHolder.mOperationViewLayout);
}
 else {
ViewUtil.showView(viewHolder.mOperationViewLayout);
}
viewHolder.mOperationViewIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
contacts.setHideOperationView(!contacts.isHideOperationView());
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsRefreshView();
}
}
}
);
viewHolder.mCallIv.setTag(position);
viewHolder.mCallIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsCall(contacts);
}
}
}
);
viewHolder.mSmsIv.setTag(position);
viewHolder.mSmsIv.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
int position=(Integer)v.getTag();
Contacts contacts=getItem(position);
if (null != mOnContactsAdapter) {
mOnContactsAdapter.onContactsSms(contacts);
}
}
}
);
return view;
}