Program: 86949
Project: 86949
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  int arrayIndex;
  ListItemViewHolder viewHolder;
switch (getItemViewType(position)) {
case ITEM_TYPE_SEPARATOR:
    if (convertView == null) {
      convertView=inflater.inflate(R.layout.shadow_separator,parent,false);
    }
  break;
case ITEM_TYPE_MAIN:
if (convertView == null) {
  convertView=inflater.inflate(R.layout.nav_drawer_list_item_main,null,false);
  viewHolder=new ListItemViewHolder();
  viewHolder.iconView=(ImageView)convertView.findViewById(R.id.list_item_icon);
  viewHolder.itemName=(TextView)convertView.findViewById(R.id.list_item_text_view);
  convertView.setTag(viewHolder);
}
 else {
  viewHolder=(ListItemViewHolder)convertView.getTag();
}
arrayIndex=position;
if (mMainItemImageRIds != null && arrayIndex < mMainItemImageRIds.size() && mMainItemImageRIds.get(arrayIndex) != null) {
viewHolder.iconView.setImageResource(mMainItemImageRIds.get(arrayIndex));
}
viewHolder.itemName.setText(mMainItems.get(arrayIndex));
if (arrayIndex == selectedMainItemIndex) {
viewHolder.itemName.setTypeface(selectedItemTypeface);
}
 else {
viewHolder.itemName.setTypeface(unSelectedItemTypeface);
}
break;
case ITEM_TYPE_SECONDARY:
if (convertView == null) {
convertView=inflater.inflate(R.layout.nav_drawer_list_item_secondary,parent,false);
viewHolder=new ListItemViewHolder();
viewHolder.iconView=(ImageView)convertView.findViewById(R.id.list_item_icon);
viewHolder.itemName=(TextView)convertView.findViewById(R.id.list_item_text_view);
convertView.setTag(viewHolder);
}
 else {
viewHolder=(ListItemViewHolder)convertView.getTag();
}
arrayIndex=position - mMainItems.size() - 1;
if (mSecondaryItemImageRIds != null && arrayIndex < mSecondaryItemImageRIds.size() && mSecondaryItemImageRIds.get(arrayIndex) != null) {
viewHolder.iconView.setImageResource(mSecondaryItemImageRIds.get(arrayIndex));
}
viewHolder.itemName=(TextView)convertView.findViewById(R.id.list_item_text_view);
viewHolder.itemName.setText(mSecondaryItems.get(arrayIndex));
break;
}
return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  int arrayIndex;
  ListItemViewHolder viewHolder;
switch (getItemViewType(position)) {
case ITEM_TYPE_SEPARATOR:
    if (convertView == null) {
      convertView=inflater.inflate(R.layout.shadow_separator,parent,false);
    }
  break;
case ITEM_TYPE_MAIN:
if (convertView == null) {
  convertView=inflater.inflate(R.layout.nav_drawer_list_item_main,null,false);
  viewHolder=new ListItemViewHolder();
  viewHolder.iconView=(ImageView)convertView.findViewById(R.id.list_item_icon);
  viewHolder.itemName=(TextView)convertView.findViewById(R.id.list_item_text_view);
  convertView.setTag(viewHolder);
}
 else {
  viewHolder=(ListItemViewHolder)convertView.getTag();
}
arrayIndex=position;
if (mMainItemImageRIds != null && arrayIndex < mMainItemImageRIds.size() && mMainItemImageRIds.get(arrayIndex) != null) {
viewHolder.iconView.setImageResource(mMainItemImageRIds.get(arrayIndex));
}
viewHolder.itemName.setTypeface(itemTypeface);
viewHolder.itemName.setText(mMainItems.get(arrayIndex));
if (arrayIndex == selectedMainItemIndex) {
convertView.setBackgroundColor(selectedItemBackgroundColor);
}
 else {
convertView.setBackgroundColor(Color.TRANSPARENT);
}
break;
case ITEM_TYPE_SECONDARY:
if (convertView == null) {
convertView=inflater.inflate(R.layout.nav_drawer_list_item_secondary,parent,false);
viewHolder=new ListItemViewHolder();
viewHolder.iconView=(ImageView)convertView.findViewById(R.id.list_item_icon);
viewHolder.itemName=(TextView)convertView.findViewById(R.id.list_item_text_view);
convertView.setTag(viewHolder);
}
 else {
viewHolder=(ListItemViewHolder)convertView.getTag();
}
arrayIndex=position - mMainItems.size() - 1;
if (mSecondaryItemImageRIds != null && arrayIndex < mSecondaryItemImageRIds.size() && mSecondaryItemImageRIds.get(arrayIndex) != null) {
viewHolder.iconView.setImageResource(mSecondaryItemImageRIds.get(arrayIndex));
}
viewHolder.itemName.setTypeface(itemTypeface);
viewHolder.itemName.setText(mSecondaryItems.get(arrayIndex));
break;
}
return convertView;
}