Program: 58316
Project: 58316
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  int itemType=this.getItemViewType(position);
switch (itemType) {
case WAKELOCK_TYPE:
    WakelockStats wakelock=(WakelockStats)getItem(position);
  WakelockViewHolder viewHolder;
if (convertView == null) {
  viewHolder=new WakelockViewHolder();
  LayoutInflater inflater=LayoutInflater.from(getContext());
  convertView=inflater.inflate(R.layout.fragment_wakelocks_listitem,parent,false);
  viewHolder.name=(TextView)convertView.findViewById(R.id.textviewWakelockName);
  viewHolder.wakeTime=(TextView)convertView.findViewById(R.id.textviewWakelockTime);
  viewHolder.wakeCount=(TextView)convertView.findViewById(R.id.textViewWakelockCount);
  convertView.setTag(viewHolder);
}
 else {
  viewHolder=(WakelockViewHolder)convertView.getTag();
}
viewHolder.name.setText(wakelock.getName());
viewHolder.name.setSelected(true);
viewHolder.wakeTime.setText(String.valueOf(wakelock.getDurationAllowedFormatted()));
viewHolder.wakeCount.setText(String.valueOf(wakelock.getAllowedCount()));
viewHolder.wakeCount.measure(View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED),View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED));
int height=viewHolder.wakeCount.getMeasuredHeight();
int width=viewHolder.wakeCount.getMeasuredWidth();
if (height > width) {
viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(height,height));
}
 else {
viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(width,width));
}
float correctedStat=wakelock.getAllowedCount() - mLowCount;
float point=120 - ((correctedStat / mScale) * 120);
float[] hsv={point,1,1};
viewHolder.wakeCount.setBackgroundColor(Color.HSVToColor(hsv));
break;
case CATEGORY_TYPE:
CategoryViewHolder categoryViewHolder=null;
if (convertView == null) {
categoryViewHolder=new CategoryViewHolder();
LayoutInflater inflater=LayoutInflater.from(getContext());
convertView=inflater.inflate(R.layout.fragment_wakelocks_listgroup,parent,false);
categoryViewHolder.name=(TextView)convertView.findViewById(R.id.textviewCategoryName);
convertView.setTag(categoryViewHolder);
}
 else {
categoryViewHolder=(CategoryViewHolder)convertView.getTag();
}
if (position == mCategoryBlockedIndex) {
categoryViewHolder.name.setText("String_Node_Str");
}
 else if (position == mCategorySafeIndex) {
categoryViewHolder.name.setText("String_Node_Str");
}
 else if (position == mCategoryUnknownIndex) {
categoryViewHolder.name.setText("String_Node_Str");
}
 else if (position == mCategoryUnsafeIndex) {
categoryViewHolder.name.setText("String_Node_Str");
}
 else {
categoryViewHolder.name.setText("String_Node_Str");
}
break;
}
return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  int itemType=this.getItemViewType(position);
switch (itemType) {
case WAKELOCK_TYPE:
    WakelockStats wakelock=(WakelockStats)getItem(position);
  WakelockViewHolder viewHolder;
if (convertView == null) {
  viewHolder=new WakelockViewHolder();
  LayoutInflater inflater=LayoutInflater.from(getContext());
  convertView=inflater.inflate(R.layout.fragment_wakelocks_listitem,parent,false);
  viewHolder.name=(TextView)convertView.findViewById(R.id.textviewWakelockName);
  viewHolder.wakeTime=(TextView)convertView.findViewById(R.id.textviewWakelockTime);
  viewHolder.wakeCount=(TextView)convertView.findViewById(R.id.textViewWakelockCount);
  convertView.setTag(viewHolder);
}
 else {
  viewHolder=(WakelockViewHolder)convertView.getTag();
}
viewHolder.name.setText(wakelock.getName());
viewHolder.name.setSelected(true);
viewHolder.wakeTime.setText(String.valueOf(wakelock.getDurationAllowedFormatted()));
viewHolder.wakeCount.setText(String.valueOf(wakelock.getAllowedCount()));
viewHolder.wakeCount.measure(View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED),View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED));
int height=viewHolder.wakeCount.getMeasuredHeight();
int width=viewHolder.wakeCount.getMeasuredWidth();
if (height > width) {
viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(height,height));
}
 else {
viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(width,width));
}
float correctedStat=wakelock.getAllowedCount() - mLowCount;
float point=120 - ((correctedStat / mScale) * 120);
float[] hsv={point,1,1};
viewHolder.wakeCount.setBackgroundColor(Color.HSVToColor(hsv));
break;
case CATEGORY_TYPE:
CategoryViewHolder categoryViewHolder=null;
if (convertView == null) {
categoryViewHolder=new CategoryViewHolder();
LayoutInflater inflater=LayoutInflater.from(getContext());
convertView=inflater.inflate(R.layout.fragment_wakelocks_listgroup,parent,false);
categoryViewHolder.name=(TextView)convertView.findViewById(R.id.textviewCategoryName);
convertView.setTag(categoryViewHolder);
}
 else {
categoryViewHolder=(CategoryViewHolder)convertView.getTag();
}
if (position == mCategoryBlockedIndex) {
categoryViewHolder.name.setText(R.string.category_unbounced);
}
 else if (position == mCategorySafeIndex) {
categoryViewHolder.name.setText(R.string.category_safe);
}
 else if (position == mCategoryUnknownIndex) {
categoryViewHolder.name.setText(R.string.category_unknown);
}
 else if (position == mCategoryUnsafeIndex) {
categoryViewHolder.name.setText(R.string.category_not_safe);
}
 else {
categoryViewHolder.name.setText(R.string.category_error);
}
break;
}
return convertView;
}