Program: 24981
Project: 24981
Buggy source:
private boolean applyPreferences() throws RemoteException {
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
  ENABLE_DEBUG_LOG=prefs.getBoolean("String_Node_Str",false);
  Log.i(TAG,"String_Node_Str" + ENABLE_DEBUG_LOG);
  boolean useBridges=prefs.getBoolean(TorConstants.PREF_BRIDGES_ENABLED,false);
  boolean becomeRelay=prefs.getBoolean(TorConstants.PREF_OR,false);
  boolean ReachableAddresses=prefs.getBoolean(TorConstants.PREF_REACHABLE_ADDRESSES,false);
  boolean enableHiddenServices=prefs.getBoolean("String_Node_Str",false);
  boolean enableStrictNodes=prefs.getBoolean("String_Node_Str",false);
  String entranceNodes=prefs.getString("String_Node_Str",null);
  String exitNodes=prefs.getString("String_Node_Str",null);
  String excludeNodes=prefs.getString("String_Node_Str",null);
  if (currentStatus == STATUS_ON) {
    try {
      setupTransProxy(true);
    }
 catch (    Exception e) {
      logException("String_Node_Str",e);
    }
  }
  mBinder.updateConfiguration("String_Node_Str",entranceNodes,false);
  mBinder.updateConfiguration("String_Node_Str",exitNodes,false);
  mBinder.updateConfiguration("String_Node_Str",excludeNodes,false);
  mBinder.updateConfiguration("String_Node_Str",enableStrictNodes ? "String_Node_Str" : "String_Node_Str",false);
  if (useBridges) {
    String bridgeList=prefs.getString(TorConstants.PREF_BRIDGES_LIST,"String_Node_Str");
    if (bridgeList == null || bridgeList.length() == 0) {
      showAlert("String_Node_Str","String_Node_Str" + "String_Node_Str");
      return false;
    }
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    String bridgeDelim="String_Node_Str";
    if (bridgeList.indexOf("String_Node_Str") != -1) {
      bridgeDelim="String_Node_Str";
    }
    StringTokenizer st=new StringTokenizer(bridgeList,bridgeDelim);
    while (st.hasMoreTokens()) {
      mBinder.updateConfiguration("String_Node_Str",st.nextToken(),false);
    }
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
 else {
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
  try {
    if (ReachableAddresses) {
      String ReachableAddressesPorts=prefs.getString(TorConstants.PREF_REACHABLE_ADDRESSES_PORTS,"String_Node_Str");
      mBinder.updateConfiguration("String_Node_Str",ReachableAddressesPorts,false);
    }
 else {
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
  }
 catch (  Exception e) {
    showAlert("String_Node_Str","String_Node_Str");
    return false;
  }
  try {
    if (becomeRelay && (!useBridges) && (!ReachableAddresses)) {
      int ORPort=Integer.parseInt(prefs.getString(TorConstants.PREF_OR_PORT,"String_Node_Str"));
      String nickname=prefs.getString(TorConstants.PREF_OR_NICKNAME,"String_Node_Str");
      mBinder.updateConfiguration("String_Node_Str",ORPort + "String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str",nickname,false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
 else {
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
  }
 catch (  Exception e) {
    showAlert("String_Node_Str","String_Node_Str");
    return false;
  }
  if (enableHiddenServices) {
    mBinder.updateConfiguration("String_Node_Str",appDataHome,false);
    String hsPorts=prefs.getString("String_Node_Str","String_Node_Str");
    StringTokenizer st=new StringTokenizer(hsPorts,"String_Node_Str");
    String hsPortConfig=null;
    while (st.hasMoreTokens()) {
      hsPortConfig=st.nextToken();
      if (hsPortConfig.indexOf("String_Node_Str") == -1) {
        hsPortConfig=hsPortConfig + "String_Node_Str" + hsPortConfig;
      }
      mBinder.updateConfiguration("String_Node_Str",hsPortConfig,false);
    }
  }
 else {
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
  mBinder.saveConfiguration();
  return true;
}

Fixed version (ground truth):
private boolean applyPreferences() throws RemoteException {
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
  ENABLE_DEBUG_LOG=prefs.getBoolean("String_Node_Str",false);
  Log.i(TAG,"String_Node_Str" + ENABLE_DEBUG_LOG);
  boolean useBridges=prefs.getBoolean(TorConstants.PREF_BRIDGES_ENABLED,false);
  boolean becomeRelay=prefs.getBoolean(TorConstants.PREF_OR,false);
  boolean ReachableAddresses=prefs.getBoolean(TorConstants.PREF_REACHABLE_ADDRESSES,false);
  boolean enableHiddenServices=prefs.getBoolean("String_Node_Str",false);
  boolean enableStrictNodes=prefs.getBoolean("String_Node_Str",false);
  String entranceNodes=prefs.getString("String_Node_Str",null);
  String exitNodes=prefs.getString("String_Node_Str",null);
  String excludeNodes=prefs.getString("String_Node_Str",null);
  if (currentStatus == STATUS_ON) {
    try {
      setupTransProxy(true);
    }
 catch (    Exception e) {
      logException("String_Node_Str",e);
    }
  }
  mBinder.updateConfiguration("String_Node_Str",entranceNodes,false);
  mBinder.updateConfiguration("String_Node_Str",exitNodes,false);
  mBinder.updateConfiguration("String_Node_Str",excludeNodes,false);
  mBinder.updateConfiguration("String_Node_Str",enableStrictNodes ? "String_Node_Str" : "String_Node_Str",false);
  if (useBridges) {
    String bridgeList=prefs.getString(TorConstants.PREF_BRIDGES_LIST,"String_Node_Str");
    if (bridgeList == null || bridgeList.length() == 0) {
      showAlert("String_Node_Str","String_Node_Str" + "String_Node_Str");
      return false;
    }
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    String bridgeDelim="String_Node_Str";
    if (bridgeList.indexOf("String_Node_Str") != -1) {
      bridgeDelim="String_Node_Str";
    }
    StringTokenizer st=new StringTokenizer(bridgeList,bridgeDelim);
    while (st.hasMoreTokens()) {
      mBinder.updateConfiguration("String_Node_Str",st.nextToken(),false);
    }
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
 else {
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
  try {
    if (ReachableAddresses) {
      String ReachableAddressesPorts=prefs.getString(TorConstants.PREF_REACHABLE_ADDRESSES_PORTS,"String_Node_Str");
      mBinder.updateConfiguration("String_Node_Str",ReachableAddressesPorts,false);
    }
 else {
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
  }
 catch (  Exception e) {
    showAlert("String_Node_Str","String_Node_Str");
    return false;
  }
  try {
    if (becomeRelay && (!useBridges) && (!ReachableAddresses)) {
      int ORPort=Integer.parseInt(prefs.getString(TorConstants.PREF_OR_PORT,"String_Node_Str"));
      String nickname=prefs.getString(TorConstants.PREF_OR_NICKNAME,"String_Node_Str");
      mBinder.updateConfiguration("String_Node_Str",ORPort + "String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str",nickname,false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
 else {
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
      mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
    }
  }
 catch (  Exception e) {
    showAlert("String_Node_Str","String_Node_Str");
    return false;
  }
  if (enableHiddenServices) {
    mBinder.updateConfiguration("String_Node_Str",appDataHome.getAbsolutePath(),false);
    String hsPorts=prefs.getString("String_Node_Str","String_Node_Str");
    StringTokenizer st=new StringTokenizer(hsPorts,"String_Node_Str");
    String hsPortConfig=null;
    while (st.hasMoreTokens()) {
      hsPortConfig=st.nextToken();
      if (hsPortConfig.indexOf("String_Node_Str") == -1) {
        hsPortConfig=hsPortConfig + "String_Node_Str" + hsPortConfig;
      }
      mBinder.updateConfiguration("String_Node_Str",hsPortConfig,false);
    }
  }
 else {
    mBinder.updateConfiguration("String_Node_Str","String_Node_Str",false);
  }
  mBinder.saveConfiguration();
  return true;
}