Program: 92698
Project: 92698
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.show_habits,container,false);
  DisplayMetrics dm=getResources().getDisplayMetrics();
  int width=(int)(dm.widthPixels / dm.density);
  button_count=(int)((width - 160) / 42);
  tvNameWidth=(int)((width - 30 - button_count * 42) * dm.density);
  adapter=new ShowHabitsAdapter(getActivity());
  listView=(DragSortListView)view.findViewById(R.id.listView);
  listView.setAdapter(adapter);
  listView.setOnItemClickListener(this);
  registerForContextMenu(listView);
  listView.setDropListener(this);
  DragSortController controller=new DragSortController(listView);
  controller.setDragHandleId(R.id.tvStar);
  controller.setRemoveEnabled(false);
  controller.setSortEnabled(true);
  controller.setDragInitMode(1);
  listView.setFloatViewManager(controller);
  listView.setOnTouchListener(controller);
  listView.setDragEnabled(true);
  GregorianCalendar day=new GregorianCalendar();
  day.setTimeInMillis(DateHelper.getLocalTime());
  for (int i=0; i < button_count; i++) {
    View check=inflater.inflate(R.layout.show_habits_header_check,null);
    Button btCheck=(Button)check.findViewById(R.id.tvCheck);
    btCheck.setText(day.getDisplayName(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.SHORT,Locale.US) + "String_Node_Str" + Integer.toString(day.get(GregorianCalendar.DAY_OF_MONTH)));
    ((LinearLayout)view.findViewById(R.id.llButtonsHeader)).addView(check);
    day.add(GregorianCalendar.DAY_OF_MONTH,-1);
  }
  setHasOptionsMenu(true);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.show_habits,container,false);
  DisplayMetrics dm=getResources().getDisplayMetrics();
  int width=(int)(dm.widthPixels / dm.density);
  button_count=(int)((width - 160) / 42);
  tvNameWidth=(int)((width - 30 - button_count * 42) * dm.density);
  adapter=new ShowHabitsAdapter(getActivity());
  listView=(DragSortListView)view.findViewById(R.id.listView);
  listView.setAdapter(adapter);
  listView.setOnItemClickListener(this);
  registerForContextMenu(listView);
  listView.setDropListener(this);
  DragSortController controller=new DragSortController(listView);
  controller.setDragHandleId(R.id.tvStar);
  controller.setRemoveEnabled(false);
  controller.setSortEnabled(true);
  controller.setDragInitMode(1);
  listView.setFloatViewManager(controller);
  listView.setOnTouchListener(controller);
  listView.setDragEnabled(true);
  GregorianCalendar day=new GregorianCalendar(TimeZone.getTimeZone("String_Node_Str"));
  day.setTimeInMillis(DateHelper.getStartOfDay(DateHelper.getLocalTime()));
  for (int i=0; i < button_count; i++) {
    View check=inflater.inflate(R.layout.show_habits_header_check,null);
    Button btCheck=(Button)check.findViewById(R.id.tvCheck);
    btCheck.setText(day.getDisplayName(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.SHORT,Locale.US) + "String_Node_Str" + Integer.toString(day.get(GregorianCalendar.DAY_OF_MONTH)));
    ((LinearLayout)view.findViewById(R.id.llButtonsHeader)).addView(check);
    day.add(GregorianCalendar.DAY_OF_MONTH,-1);
  }
  setHasOptionsMenu(true);
  return view;
}