Program: 58304
Project: 58304
Buggy source:
private void loadStatsFromSource(final View view){
  final UnbounceStatsCollection stats=UnbounceStatsCollection.getInstance();
  final Context c=getActivity();
  String duration=stats.getDurationAllowedFormatted(c,UnbounceStatsCollection.STAT_CURRENT);
  TextView textView=(TextView)view.findViewById(R.id.textLocalWakeTimeAllowed);
  textView.setText(duration);
  textView=(TextView)view.findViewById(R.id.textRunningSince);
  textView.setText(stats.getRunningSinceFormatted());
  textView=(TextView)view.findViewById(R.id.textLocalWakeAcquired);
  textView.setText(String.valueOf(stats.getTotalAllowedWakelockCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalWakeBlocked);
  textView.setText(String.valueOf(stats.getTotalBlockWakelockCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalWakeTimeBlocked);
  textView.setText(stats.getDurationBlockedFormatted(c,UnbounceStatsCollection.STAT_CURRENT));
  textView=(TextView)view.findViewById(R.id.textLocalAlarmsAcquired);
  textView.setText(String.valueOf(stats.getTotalAllowedAlarmCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalAlarmsBlocked);
  textView.setText(String.valueOf(stats.getTotalBlockAlarmCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  stats.getStatsFromNetwork(c,new Handler(){
    @Override public void handleMessage(    Message msg){
      TextView textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationAllowed);
      textView.setText(stats.getDurationAllowedFormatted(c,UnbounceStatsCollection.STAT_GLOBAL));
      textView=(TextView)view.findViewById(R.id.textGlobalWakelockAllowed);
      textView.setText(String.valueOf(stats.getTotalAllowedWakelockCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
      textView=(TextView)view.findViewById(R.id.textGlobalWakelockBlocked);
      textView.setText(String.valueOf(stats.getTotalBlockWakelockCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
      textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationBlocked);
      textView.setText(stats.getDurationBlockedFormatted(c,UnbounceStatsCollection.STAT_GLOBAL));
      textView=(TextView)view.findViewById(R.id.textGlobalAlarmAllowed);
      textView.setText(String.valueOf(stats.getTotalAllowedAlarmCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
      textView=(TextView)view.findViewById(R.id.textGlobalAlarmBlocked);
      textView.setText(String.valueOf(stats.getTotalBlockAlarmCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
    }
  }
);
}

Fixed version (ground truth):
private void loadStatsFromSource(final View view){
  final UnbounceStatsCollection stats=UnbounceStatsCollection.getInstance();
  final Context c=getActivity();
  String duration=stats.getDurationAllowedFormatted(c,UnbounceStatsCollection.STAT_CURRENT);
  TextView textView=(TextView)view.findViewById(R.id.textLocalWakeTimeAllowed);
  textView.setText(duration);
  textView=(TextView)view.findViewById(R.id.textRunningSince);
  textView.setText(stats.getRunningSinceFormatted());
  textView=(TextView)view.findViewById(R.id.textLocalWakeAcquired);
  textView.setText(String.valueOf(stats.getTotalAllowedWakelockCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalWakeBlocked);
  textView.setText(String.valueOf(stats.getTotalBlockWakelockCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalWakeTimeBlocked);
  textView.setText(stats.getDurationBlockedFormatted(c,UnbounceStatsCollection.STAT_CURRENT));
  textView=(TextView)view.findViewById(R.id.textLocalAlarmsAcquired);
  textView.setText(String.valueOf(stats.getTotalAllowedAlarmCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  textView=(TextView)view.findViewById(R.id.textLocalAlarmsBlocked);
  textView.setText(String.valueOf(stats.getTotalBlockAlarmCount(c,UnbounceStatsCollection.STAT_CURRENT)));
  SharedPreferences prefs=getActivity().getSharedPreferences("String_Node_Str" + "String_Node_Str",Context.MODE_WORLD_READABLE);
  if (prefs.getBoolean("String_Node_Str",true)) {
    stats.getStatsFromNetwork(c,new Handler(){
      @Override public void handleMessage(      Message msg){
        TextView textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationAllowed);
        textView.setText(stats.getDurationAllowedFormatted(c,UnbounceStatsCollection.STAT_GLOBAL));
        textView=(TextView)view.findViewById(R.id.textGlobalWakelockAllowed);
        textView.setText(String.valueOf(stats.getTotalAllowedWakelockCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
        textView=(TextView)view.findViewById(R.id.textGlobalWakelockBlocked);
        textView.setText(String.valueOf(stats.getTotalBlockWakelockCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
        textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationBlocked);
        textView.setText(stats.getDurationBlockedFormatted(c,UnbounceStatsCollection.STAT_GLOBAL));
        textView=(TextView)view.findViewById(R.id.textGlobalAlarmAllowed);
        textView.setText(String.valueOf(stats.getTotalAllowedAlarmCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
        textView=(TextView)view.findViewById(R.id.textGlobalAlarmBlocked);
        textView.setText(String.valueOf(stats.getTotalBlockAlarmCount(c,UnbounceStatsCollection.STAT_GLOBAL)));
      }
    }
);
  }
 else {
    textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationAllowed);
    textView.setText(getResources().getString(R.string.stat_disabled));
    textView=(TextView)view.findViewById(R.id.textGlobalWakelockAllowed);
    textView.setText(getResources().getString(R.string.stat_disabled));
    textView=(TextView)view.findViewById(R.id.textGlobalWakelockBlocked);
    textView.setText(getResources().getString(R.string.stat_disabled));
    textView=(TextView)view.findViewById(R.id.textGlobalWakelockDurationBlocked);
    textView.setText(getResources().getString(R.string.stat_disabled));
    textView=(TextView)view.findViewById(R.id.textGlobalAlarmAllowed);
    textView.setText(getResources().getString(R.string.stat_disabled));
    textView=(TextView)view.findViewById(R.id.textGlobalAlarmBlocked);
    textView.setText(getResources().getString(R.string.stat_disabled));
  }
}