Program: 13464
Project: 13464
Buggy source:
protected void updateUI(){
  super.updateUI();
  if (!isAdded() || !hasDataAvailable()) {
    return;
  }
  LinearLayout ll=(LinearLayout)getActivity().getLayoutInflater().inflate(R.layout.stats_insights_most_popular_item,(ViewGroup)mResultContainer.getRootView(),false);
  int dayOfTheWeek=mInsightsPopularModel.getHighestDayOfWeek();
  Calendar c=Calendar.getInstance();
  c.setFirstDayOfWeek(Calendar.MONDAY);
  c.setTimeInMillis(System.currentTimeMillis());
switch (dayOfTheWeek) {
case 0:
    c.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
  break;
case 1:
c.set(Calendar.DAY_OF_WEEK,Calendar.TUESDAY);
break;
case 2:
c.set(Calendar.DAY_OF_WEEK,Calendar.WEDNESDAY);
break;
case 3:
c.set(Calendar.DAY_OF_WEEK,Calendar.THURSDAY);
break;
case 4:
c.set(Calendar.DAY_OF_WEEK,Calendar.FRIDAY);
break;
case 5:
c.set(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
break;
case 6:
c.set(Calendar.DAY_OF_WEEK,Calendar.SUNDAY);
break;
}
DateFormat formatter=new SimpleDateFormat("String_Node_Str");
final TextView mostPopularDayTextView=(TextView)ll.findViewById(R.id.stats_most_popular_day);
mostPopularDayTextView.setText(formatter.format(c.getTime()));
final TextView mostPopularDayPercentTextView=(TextView)ll.findViewById(R.id.stats_most_popular_day_percent);
mostPopularDayPercentTextView.setText(String.format(getString(R.string.stats_insights_most_popular_percent_views),roundToInteger(mInsightsPopularModel.getHighestDayPercent())));
TextView mostPopularHourTextView=(TextView)ll.findViewById(R.id.stats_most_popular_hour);
DateFormat timeFormat=android.text.format.DateFormat.getTimeFormat(getActivity());
c.set(Calendar.HOUR_OF_DAY,mInsightsPopularModel.getHighestHour());
c.set(Calendar.MINUTE,0);
mostPopularHourTextView.setText(timeFormat.format(c.getTime()));
final TextView mostPopularHourPercentTextView=(TextView)ll.findViewById(R.id.stats_most_popular_hour_percent);
mostPopularHourPercentTextView.setText(String.format(getString(R.string.stats_insights_most_popular_percent_views),roundToInteger(mInsightsPopularModel.getHighestHourPercent())));
mResultContainer.addView(ll);
}

Fixed version (ground truth):
protected void updateUI(){
  super.updateUI();
  if (!isAdded() || !hasDataAvailable()) {
    return;
  }
  LinearLayout ll=(LinearLayout)getActivity().getLayoutInflater().inflate(R.layout.stats_insights_most_popular_item,(ViewGroup)mResultContainer.getRootView(),false);
  int dayOfTheWeek=mInsightsPopularModel.getHighestDayOfWeek();
  Calendar c=Calendar.getInstance();
  c.setFirstDayOfWeek(Calendar.MONDAY);
  c.setTimeInMillis(System.currentTimeMillis());
switch (dayOfTheWeek) {
case 0:
    c.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
  break;
case 1:
c.set(Calendar.DAY_OF_WEEK,Calendar.TUESDAY);
break;
case 2:
c.set(Calendar.DAY_OF_WEEK,Calendar.WEDNESDAY);
break;
case 3:
c.set(Calendar.DAY_OF_WEEK,Calendar.THURSDAY);
break;
case 4:
c.set(Calendar.DAY_OF_WEEK,Calendar.FRIDAY);
break;
case 5:
c.set(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
break;
case 6:
c.set(Calendar.DAY_OF_WEEK,Calendar.SUNDAY);
break;
}
DateFormat formatter=new SimpleDateFormat("String_Node_Str",Locale.getDefault());
final TextView mostPopularDayTextView=(TextView)ll.findViewById(R.id.stats_most_popular_day);
mostPopularDayTextView.setText(formatter.format(c.getTime()));
final TextView mostPopularDayPercentTextView=(TextView)ll.findViewById(R.id.stats_most_popular_day_percent);
mostPopularDayPercentTextView.setText(String.format(getString(R.string.stats_insights_most_popular_percent_views),roundToInteger(mInsightsPopularModel.getHighestDayPercent())));
TextView mostPopularHourTextView=(TextView)ll.findViewById(R.id.stats_most_popular_hour);
DateFormat timeFormat=android.text.format.DateFormat.getTimeFormat(getActivity());
c.set(Calendar.HOUR_OF_DAY,mInsightsPopularModel.getHighestHour());
c.set(Calendar.MINUTE,0);
mostPopularHourTextView.setText(timeFormat.format(c.getTime()));
final TextView mostPopularHourPercentTextView=(TextView)ll.findViewById(R.id.stats_most_popular_hour_percent);
mostPopularHourPercentTextView.setText(String.format(getString(R.string.stats_insights_most_popular_percent_views),roundToInteger(mInsightsPopularModel.getHighestHourPercent())));
mResultContainer.addView(ll);
}