Program: 92841
Project: 92841
Buggy source:
protected void swapPref(boolean toTemp){
  String TAG1="String_Node_Str";
  String TAG2=TEMP_TAG;
  if (!toTemp) {
    TAG1=TEMP_TAG;
    TAG2="String_Node_Str";
  }
  Set<String> keySet=SDViewPref.getInstance().fontPref.keySet();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      font.setPreferenceName((String)prefName + TAG1);
      font.load();
      font.setPreferenceName((String)prefName + TAG2);
      font.store();
    }
  }
  keySet=SDViewPref.getInstance().backColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      backGroundColor.setPreferenceName((String)prefName + TAG1);
      backGroundColor.load();
      backGroundColor.setPreferenceName((String)prefName + TAG2);
      backGroundColor.store();
    }
  }
  keySet=SDViewPref.getInstance().foreColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      lineColor.setPreferenceName((String)prefName + TAG1);
      lineColor.load();
      lineColor.setPreferenceName((String)prefName + TAG2);
      lineColor.store();
    }
  }
  keySet=SDViewPref.getInstance().textColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      textColor.setPreferenceName((String)prefName + TAG1);
      textColor.load();
      textColor.setPreferenceName((String)prefName + TAG2);
      textColor.store();
    }
  }
  if (toTemp) {
    font.setPreferenceName(SDViewPref.fontList[classItemList.getSelectionIndex()] + TEMP_TAG);
    font.load();
    backGroundColor.setPreferenceName(SDViewPref.fontList[classItemList.getSelectionIndex()] + SDViewPref.BACK_COLOR_POSTFIX + TEMP_TAG);
    backGroundColor.load();
    lineColor.setPreferenceName(SDViewPref.fontList[classItemList.getSelectionIndex()] + SDViewPref.FORE_COLOR_POSTFIX + TEMP_TAG);
    lineColor.load();
    textColor.setPreferenceName(SDViewPref.fontList[classItemList.getSelectionIndex()] + SDViewPref.TEXT_COLOR_POSTFIX + TEMP_TAG);
    textColor.load();
  }
}

Fixed version (ground truth):
protected void swapPref(boolean toTemp){
  String TAG1="String_Node_Str";
  String TAG2=TEMP_TAG;
  if (!toTemp) {
    TAG1=TEMP_TAG;
    TAG2="String_Node_Str";
  }
  Set<String> keySet=SDViewPref.getInstance().fontPref.keySet();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      font.setPreferenceName((String)prefName + TAG1);
      font.load();
      font.setPreferenceName((String)prefName + TAG2);
      font.store();
    }
  }
  keySet=SDViewPref.getInstance().backColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      backGroundColor.setPreferenceName((String)prefName + TAG1);
      backGroundColor.load();
      backGroundColor.setPreferenceName((String)prefName + TAG2);
      backGroundColor.store();
    }
  }
  keySet=SDViewPref.getInstance().foreColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      lineColor.setPreferenceName((String)prefName + TAG1);
      lineColor.load();
      lineColor.setPreferenceName((String)prefName + TAG2);
      lineColor.store();
    }
  }
  keySet=SDViewPref.getInstance().textColorPref.keySet();
  it=keySet.iterator();
  while (it.hasNext()) {
    Object prefName=it.next();
    if (prefName instanceof String) {
      textColor.setPreferenceName((String)prefName + TAG1);
      textColor.load();
      textColor.setPreferenceName((String)prefName + TAG2);
      textColor.store();
    }
  }
  String[] fontList=SDViewPref.getFontList();
  if (toTemp) {
    font.setPreferenceName(fontList[classItemList.getSelectionIndex()] + TEMP_TAG);
    font.load();
    backGroundColor.setPreferenceName(fontList[classItemList.getSelectionIndex()] + SDViewPref.BACK_COLOR_POSTFIX + TEMP_TAG);
    backGroundColor.load();
    lineColor.setPreferenceName(fontList[classItemList.getSelectionIndex()] + SDViewPref.FORE_COLOR_POSTFIX + TEMP_TAG);
    lineColor.load();
    textColor.setPreferenceName(fontList[classItemList.getSelectionIndex()] + SDViewPref.TEXT_COLOR_POSTFIX + TEMP_TAG);
    textColor.load();
  }
}