Program: 38133
Project: 38133
Buggy source:
private void buildHFR(){
  ListPreference hfrPref=mPreferenceGroup.findPreference(KEY_VIDEO_HIGH_FRAME_RATE);
  Size[] highSpeedVideoSize=getSupportedHighSpeedVideoSize(mCameraId);
  if (highSpeedVideoSize.length == 0) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    hfrPref.setValueIndex(0);
    return;
  }
  ListPreference videoQuality=mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
  String video=videoQuality.getValue();
  int x=video.indexOf('x');
  Size videoSize=new Size(Integer.parseInt(video.substring(0,x)),Integer.parseInt(video.substring(x + 1)));
  boolean found=false;
  for (  Size s : highSpeedVideoSize) {
    if (videoSize.equals(s)) {
      found=true;
      break;
    }
  }
  if (!found) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    hfrPref.setValueIndex(0);
    return;
  }
  Range[] range=getSupportedHighSpeedVideoFPSRange(mCameraId,highSpeedVideoSize[0]);
  ArrayList<Range> list=new ArrayList<>();
  for (  Range r : range) {
    if (r.getLower() == r.getUpper()) {
      list.add(r);
    }
  }
  if (list.size() == 0) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    hfrPref.setValueIndex(0);
    return;
  }
  CharSequence[] entryValues=new CharSequence[list.size() * 2 + 1];
  CharSequence[] entries=new CharSequence[list.size() * 2 + 1];
  entryValues[0]="String_Node_Str";
  entries[0]="String_Node_Str";
  int i=1;
  for (  Range r : list) {
    entries[i]="String_Node_Str" + r.getLower();
    entryValues[i]="String_Node_Str" + r.getLower();
    i++;
  }
  for (  Range r : list) {
    entries[i]="String_Node_Str" + r.getLower();
    entryValues[i]="String_Node_Str" + r.getLower();
    i++;
  }
  hfrPref.setEntryValues(entryValues);
  hfrPref.setEntries(entries);
}

Fixed version (ground truth):
private void buildHFR(){
  ListPreference hfrPref=mPreferenceGroup.findPreference(KEY_VIDEO_HIGH_FRAME_RATE);
  Size[] highSpeedVideoSize=getSupportedHighSpeedVideoSize(mCameraId);
  if (highSpeedVideoSize.length == 0) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    setValueIndex(KEY_VIDEO_HIGH_FRAME_RATE,0);
    return;
  }
  ListPreference videoQuality=mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
  String video=videoQuality.getValue();
  int x=video.indexOf('x');
  Size videoSize=new Size(Integer.parseInt(video.substring(0,x)),Integer.parseInt(video.substring(x + 1)));
  boolean found=false;
  for (  Size s : highSpeedVideoSize) {
    if (videoSize.equals(s)) {
      found=true;
      break;
    }
  }
  if (!found) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    setValueIndex(KEY_VIDEO_HIGH_FRAME_RATE,0);
    return;
  }
  Range[] range=getSupportedHighSpeedVideoFPSRange(mCameraId,videoSize);
  ArrayList<Range> list=new ArrayList<>();
  for (  Range r : range) {
    if (r.getLower() == r.getUpper()) {
      list.add(r);
    }
  }
  if (list.size() == 0) {
    CharSequence[] entryValues=new CharSequence[1];
    CharSequence[] entries=new CharSequence[1];
    entryValues[0]="String_Node_Str";
    entries[0]="String_Node_Str";
    hfrPref.setEntryValues(entryValues);
    hfrPref.setEntries(entries);
    setValueIndex(KEY_VIDEO_HIGH_FRAME_RATE,0);
    return;
  }
  CharSequence[] entryValues=new CharSequence[list.size() * 2 + 1];
  CharSequence[] entries=new CharSequence[list.size() * 2 + 1];
  entryValues[0]="String_Node_Str";
  entries[0]="String_Node_Str";
  int i=1;
  for (  Range r : list) {
    entries[i]="String_Node_Str" + r.getLower();
    entryValues[i]="String_Node_Str" + r.getLower();
    i++;
  }
  for (  Range r : list) {
    entries[i]="String_Node_Str" + r.getLower();
    entryValues[i]="String_Node_Str" + r.getLower();
    i++;
  }
  hfrPref.setEntryValues(entryValues);
  hfrPref.setEntries(entries);
  int index=getValueIndex(KEY_VIDEO_HIGH_FRAME_RATE);
  if (index == -1) {
    setValueIndex(KEY_VIDEO_HIGH_FRAME_RATE,0);
  }
}