Program: 91117
Project: 91117
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  _mbwManager=MbwManager.getInstance(SettingsActivity.this.getApplication());
  _ltManager=_mbwManager.getLocalTraderManager();
  _bitcoinDenomination=(ListPreference)findPreference("String_Node_Str");
  _bitcoinDenomination.setTitle(bitcoinDenominationTitle());
  _bitcoinDenomination.setDefaultValue(_mbwManager.getBitcoinDenomination().toString());
  _bitcoinDenomination.setValue(_mbwManager.getBitcoinDenomination().toString());
  CharSequence[] denominations=new CharSequence[]{Denomination.BTC.toString(),Denomination.mBTC.toString(),Denomination.uBTC.toString(),Denomination.BITS.toString()};
  _bitcoinDenomination.setEntries(denominations);
  _bitcoinDenomination.setEntryValues(denominations);
  _bitcoinDenomination.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setBitcoinDenomination(Denomination.fromString(newValue.toString()));
      _bitcoinDenomination.setTitle(bitcoinDenominationTitle());
      return true;
    }
  }
);
  _minerFee=(ListPreference)findPreference("String_Node_Str");
  _minerFee.setTitle(getMinerFeeTitle());
  _minerFee.setSummary(getMinerFeeSummary());
  _minerFee.setValue(_mbwManager.getMinerFee().toString());
  CharSequence[] minerFees=new CharSequence[]{MinerFee.LOWPRIO.toString(),MinerFee.ECONOMIC.toString(),MinerFee.NORMAL.toString(),MinerFee.PRIORITY.toString()};
  CharSequence[] minerFeeNames=new CharSequence[]{getString(R.string.miner_fee_lowprio_name),getString(R.string.miner_fee_economic_name),getString(R.string.miner_fee_normal_name),getString(R.string.miner_fee_priority_name)};
  _minerFee.setEntries(minerFeeNames);
  _minerFee.setEntryValues(minerFees);
  _minerFee.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setMinerFee(MinerFee.fromString(newValue.toString()));
      _minerFee.setTitle(getMinerFeeTitle());
      _minerFee.setSummary(getMinerFeeSummary());
      String description=_mbwManager.getMinerFee().getMinerFeeDescription(SettingsActivity.this);
      Utils.showSimpleMessageDialog(SettingsActivity.this,description);
      return true;
    }
  }
);
  _blockExplorer=(ListPreference)findPreference("String_Node_Str");
  _blockExplorer.setTitle(getBlockExplorerTitle());
  _blockExplorer.setSummary(getBlockExplorerSummary());
  _blockExplorer.setValue(_mbwManager._blockExplorerManager.getBlockExplorer().getIdentifier());
  CharSequence[] blockExplorerNames=_mbwManager._blockExplorerManager.getBlockExplorerNames(_mbwManager._blockExplorerManager.getAllBlockExplorer());
  CharSequence[] blockExplorerValues=_mbwManager._blockExplorerManager.getBlockExplorerIds();
  _blockExplorer.setEntries(blockExplorerNames);
  _blockExplorer.setEntryValues(blockExplorerValues);
  _blockExplorer.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setBlockExplorer(_mbwManager._blockExplorerManager.getBlockExplorerById(newValue.toString()));
      _blockExplorer.setTitle(getBlockExplorerTitle());
      _blockExplorer.setSummary(getBlockExplorerSummary());
      return true;
    }
  }
);
  _localCurrency=findPreference("String_Node_Str");
  _localCurrency.setOnPreferenceClickListener(localCurrencyClickListener);
  _localCurrency.setTitle(localCurrencyTitle());
  _exchangeSource=(ListPreference)findPreference("String_Node_Str");
  ExchangeRateManager exchangeManager=_mbwManager.getExchangeRateManager();
  List<String> exchangeSourceNamesList=exchangeManager.getExchangeSourceNames();
  CharSequence[] exchangeNames=exchangeSourceNamesList.toArray(new String[exchangeSourceNamesList.size()]);
  _exchangeSource.setEntries(exchangeNames);
  if (exchangeNames.length == 0) {
    _exchangeSource.setEnabled(false);
  }
 else {
    String currentName=exchangeManager.getCurrentExchangeSourceName();
    if (currentName == null) {
      currentName="String_Node_Str";
    }
    _exchangeSource.setEntries(exchangeNames);
    _exchangeSource.setEntryValues(exchangeNames);
    _exchangeSource.setDefaultValue(currentName);
    _exchangeSource.setValue(currentName);
  }
  _exchangeSource.setTitle(exchangeSourceTitle());
  _exchangeSource.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.getExchangeRateManager().setCurrentExchangeSourceName(newValue.toString());
      _exchangeSource.setTitle(exchangeSourceTitle());
      return true;
    }
  }
);
  ListPreference language=(ListPreference)findPreference(Constants.LANGUAGE_SETTING);
  language.setTitle(getLanguageSettingTitle());
  language.setDefaultValue(Locale.getDefault().getLanguage());
  language.setSummary(_mbwManager.getLanguage());
  language.setValue(_mbwManager.getLanguage());
  ImmutableMap<String,String> languageLookup=loadLanguageLookups();
  language.setSummary(languageLookup.get(_mbwManager.getLanguage()));
  language.setEntries(R.array.languages_desc);
  language.setEntryValues(R.array.languages);
  language.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      String lang=newValue.toString();
      _mbwManager.setLanguage(lang);
      WalletApplication app=(WalletApplication)getApplication();
      app.applyLanguageChange(lang);
      restart();
      return true;
    }
  }
);
  Preference setPin=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  setPin.setOnPreferenceClickListener(setPinClickListener);
  updateClearPin();
  CheckBoxPreference setPinRequiredStartup=(CheckBoxPreference)Preconditions.checkNotNull(findPreference("String_Node_Str"));
  setPinRequiredStartup.setOnPreferenceChangeListener(setPinOnStartupClickListener);
  setPinRequiredStartup.setChecked(_mbwManager.getPinRequiredOnStartup());
  Preference legacyBackup=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  legacyBackup.setOnPreferenceClickListener(legacyBackupClickListener);
  Preference legacyBackupVerify=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  legacyBackupVerify.setOnPreferenceClickListener(legacyBackupVerifyClickListener);
  CheckBoxPreference ltDisable=(CheckBoxPreference)findPreference("String_Node_Str");
  ltDisable.setChecked(_ltManager.isLocalTraderDisabled());
  ltDisable.setOnPreferenceClickListener(ltDisableLocalTraderClickListener);
  _ltNotificationSound=(CheckBoxPreference)findPreference("String_Node_Str");
  _ltNotificationSound.setChecked(_ltManager.getPlaySoundOnTradeNotification());
  _ltNotificationSound.setOnPreferenceClickListener(ltNotificationSoundClickListener);
  _ltMilesKilometers=(CheckBoxPreference)findPreference("String_Node_Str");
  _ltMilesKilometers.setChecked(_ltManager.useMiles());
  _ltMilesKilometers.setOnPreferenceClickListener(ltMilesKilometersClickListener);
  CheckBoxPreference showBip44Path=(CheckBoxPreference)findPreference("String_Node_Str");
  showBip44Path.setChecked(_mbwManager.getMetadataStorage().getShowBip44Path());
  showBip44Path.setOnPreferenceClickListener(showBip44PathClickListener);
  final ListPreference useTor=Preconditions.checkNotNull((ListPreference)findPreference("String_Node_Str"));
  useTor.setTitle(getUseTorTitle());
  useTor.setEntries(new String[]{getString(R.string.use_https),getString(R.string.use_external_tor)});
  useTor.setEntryValues(new String[]{ServerEndpointType.Types.ONLY_HTTPS.toString(),ServerEndpointType.Types.ONLY_TOR.toString()});
  useTor.setValue(_mbwManager.getTorMode().toString());
  useTor.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      if (newValue.equals(ServerEndpointType.Types.ONLY_TOR.toString())) {
        OrbotHelper obh=new OrbotHelper(SettingsActivity.this);
        if (!obh.isOrbotInstalled()) {
          obh.promptToInstall(SettingsActivity.this);
        }
      }
      _mbwManager.setTorMode(ServerEndpointType.Types.valueOf((String)newValue));
      useTor.setTitle(getUseTorTitle());
      return true;
    }
  }
);
  CheckBoxPreference ledgerDisableTee=(CheckBoxPreference)findPreference("String_Node_Str");
  Preference ledgerSetUnpluggedAID=findPreference("String_Node_Str");
  boolean isTeeAvailable=LedgerTransportTEEProxyFactory.isServiceAvailable(this);
  if (isTeeAvailable) {
    ledgerDisableTee.setChecked(_mbwManager.getLedgerManager().getDisableTEE());
    ledgerDisableTee.setOnPreferenceClickListener(onClickLedgerNotificationDisableTee);
  }
 else {
    PreferenceCategory ledger=(PreferenceCategory)findPreference("String_Node_Str");
    ledger.removePreference(ledgerDisableTee);
  }
  ledgerSetUnpluggedAID.setOnPreferenceClickListener(onClickLedgerSetUnpluggedAID);
  applyLocalTraderEnablement();
  initExternalSettings();
  PreferenceCategory modulesPrefs=(PreferenceCategory)findPreference("String_Node_Str");
  if (!CommunicationManager.getInstance(this).getPairedModules().isEmpty()) {
    for (    final Module module : CommunicationManager.getInstance(this).getPairedModules()) {
      Preference preference=new Preference(this);
      preference.setLayoutResource(R.layout.preference_layout);
      preference.setTitle(Html.fromHtml(module.getName()));
      preference.setSummary(module.getDescription());
      preference.setOnPreferenceClickListener(new OnPreferenceClickListener(){
        @Override public boolean onPreferenceClick(        Preference preference){
          Intent intent=new Intent(com.mycelium.modularizationtools.Constants.Companion.getSETTINGS());
          intent.setPackage(module.getModulePackage());
          startActivity(intent);
          return true;
        }
      }
);
      modulesPrefs.addPreference(preference);
    }
  }
 else {
    Preference preference=new Preference(this);
    preference.setTitle(R.string.no_connected_modules);
    modulesPrefs.addPreference(preference);
  }
  for (  final Module module : GooglePlayModuleCollection.INSTANCE.getModules(this).values()) {
    if (!CommunicationManager.getInstance(this).getPairedModules().contains(module)) {
      ButtonPreference installPreference=new ButtonPreference(this);
      installPreference.setButtonText(getString(R.string.install));
      installPreference.setButtonClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          Intent installIntent=new Intent(Intent.ACTION_VIEW);
          installIntent.setData(Uri.parse("String_Node_Str" + module.getModulePackage()));
          startActivity(installIntent);
        }
      }
);
      installPreference.setTitle(Html.fromHtml(module.getName()));
      installPreference.setSummary(module.getDescription());
      modulesPrefs.addPreference(installPreference);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  _mbwManager=MbwManager.getInstance(SettingsActivity.this.getApplication());
  _ltManager=_mbwManager.getLocalTraderManager();
  _bitcoinDenomination=(ListPreference)findPreference("String_Node_Str");
  _bitcoinDenomination.setTitle(bitcoinDenominationTitle());
  _bitcoinDenomination.setDefaultValue(_mbwManager.getBitcoinDenomination().toString());
  _bitcoinDenomination.setValue(_mbwManager.getBitcoinDenomination().toString());
  CharSequence[] denominations=new CharSequence[]{Denomination.BTC.toString(),Denomination.mBTC.toString(),Denomination.uBTC.toString(),Denomination.BITS.toString()};
  _bitcoinDenomination.setEntries(denominations);
  _bitcoinDenomination.setEntryValues(denominations);
  _bitcoinDenomination.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setBitcoinDenomination(Denomination.fromString(newValue.toString()));
      _bitcoinDenomination.setTitle(bitcoinDenominationTitle());
      return true;
    }
  }
);
  _minerFee=(ListPreference)findPreference("String_Node_Str");
  _minerFee.setTitle(getMinerFeeTitle());
  _minerFee.setSummary(getMinerFeeSummary());
  _minerFee.setValue(_mbwManager.getMinerFee().toString());
  CharSequence[] minerFees=new CharSequence[]{MinerFee.LOWPRIO.toString(),MinerFee.ECONOMIC.toString(),MinerFee.NORMAL.toString(),MinerFee.PRIORITY.toString()};
  CharSequence[] minerFeeNames=new CharSequence[]{getString(R.string.miner_fee_lowprio_name),getString(R.string.miner_fee_economic_name),getString(R.string.miner_fee_normal_name),getString(R.string.miner_fee_priority_name)};
  _minerFee.setEntries(minerFeeNames);
  _minerFee.setEntryValues(minerFees);
  _minerFee.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setMinerFee(MinerFee.fromString(newValue.toString()));
      _minerFee.setTitle(getMinerFeeTitle());
      _minerFee.setSummary(getMinerFeeSummary());
      String description=_mbwManager.getMinerFee().getMinerFeeDescription(SettingsActivity.this);
      Utils.showSimpleMessageDialog(SettingsActivity.this,description);
      return true;
    }
  }
);
  _blockExplorer=(ListPreference)findPreference("String_Node_Str");
  _blockExplorer.setTitle(getBlockExplorerTitle());
  _blockExplorer.setSummary(getBlockExplorerSummary());
  _blockExplorer.setValue(_mbwManager._blockExplorerManager.getBlockExplorer().getIdentifier());
  CharSequence[] blockExplorerNames=_mbwManager._blockExplorerManager.getBlockExplorerNames(_mbwManager._blockExplorerManager.getAllBlockExplorer());
  CharSequence[] blockExplorerValues=_mbwManager._blockExplorerManager.getBlockExplorerIds();
  _blockExplorer.setEntries(blockExplorerNames);
  _blockExplorer.setEntryValues(blockExplorerValues);
  _blockExplorer.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.setBlockExplorer(_mbwManager._blockExplorerManager.getBlockExplorerById(newValue.toString()));
      _blockExplorer.setTitle(getBlockExplorerTitle());
      _blockExplorer.setSummary(getBlockExplorerSummary());
      return true;
    }
  }
);
  _localCurrency=findPreference("String_Node_Str");
  _localCurrency.setOnPreferenceClickListener(localCurrencyClickListener);
  _localCurrency.setTitle(localCurrencyTitle());
  _exchangeSource=(ListPreference)findPreference("String_Node_Str");
  ExchangeRateManager exchangeManager=_mbwManager.getExchangeRateManager();
  List<String> exchangeSourceNamesList=exchangeManager.getExchangeSourceNames();
  CharSequence[] exchangeNames=exchangeSourceNamesList.toArray(new String[exchangeSourceNamesList.size()]);
  _exchangeSource.setEntries(exchangeNames);
  if (exchangeNames.length == 0) {
    _exchangeSource.setEnabled(false);
  }
 else {
    String currentName=exchangeManager.getCurrentExchangeSourceName();
    if (currentName == null) {
      currentName="String_Node_Str";
    }
    _exchangeSource.setEntries(exchangeNames);
    _exchangeSource.setEntryValues(exchangeNames);
    _exchangeSource.setDefaultValue(currentName);
    _exchangeSource.setValue(currentName);
  }
  _exchangeSource.setTitle(exchangeSourceTitle());
  _exchangeSource.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      _mbwManager.getExchangeRateManager().setCurrentExchangeSourceName(newValue.toString());
      _exchangeSource.setTitle(exchangeSourceTitle());
      return true;
    }
  }
);
  ListPreference language=(ListPreference)findPreference(Constants.LANGUAGE_SETTING);
  language.setTitle(getLanguageSettingTitle());
  language.setDefaultValue(Locale.getDefault().getLanguage());
  language.setSummary(_mbwManager.getLanguage());
  language.setValue(_mbwManager.getLanguage());
  ImmutableMap<String,String> languageLookup=loadLanguageLookups();
  language.setSummary(languageLookup.get(_mbwManager.getLanguage()));
  language.setEntries(R.array.languages_desc);
  language.setEntryValues(R.array.languages);
  language.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      String lang=newValue.toString();
      _mbwManager.setLanguage(lang);
      WalletApplication app=(WalletApplication)getApplication();
      app.applyLanguageChange(lang);
      restart();
      return true;
    }
  }
);
  Preference setPin=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  setPin.setOnPreferenceClickListener(setPinClickListener);
  updateClearPin();
  CheckBoxPreference setPinRequiredStartup=(CheckBoxPreference)Preconditions.checkNotNull(findPreference("String_Node_Str"));
  setPinRequiredStartup.setOnPreferenceChangeListener(setPinOnStartupClickListener);
  setPinRequiredStartup.setChecked(_mbwManager.getPinRequiredOnStartup());
  Preference legacyBackup=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  legacyBackup.setOnPreferenceClickListener(legacyBackupClickListener);
  Preference legacyBackupVerify=Preconditions.checkNotNull(findPreference("String_Node_Str"));
  legacyBackupVerify.setOnPreferenceClickListener(legacyBackupVerifyClickListener);
  CheckBoxPreference ltDisable=(CheckBoxPreference)findPreference("String_Node_Str");
  ltDisable.setChecked(_ltManager.isLocalTraderDisabled());
  ltDisable.setOnPreferenceClickListener(ltDisableLocalTraderClickListener);
  _ltNotificationSound=(CheckBoxPreference)findPreference("String_Node_Str");
  _ltNotificationSound.setChecked(_ltManager.getPlaySoundOnTradeNotification());
  _ltNotificationSound.setOnPreferenceClickListener(ltNotificationSoundClickListener);
  _ltMilesKilometers=(CheckBoxPreference)findPreference("String_Node_Str");
  _ltMilesKilometers.setChecked(_ltManager.useMiles());
  _ltMilesKilometers.setOnPreferenceClickListener(ltMilesKilometersClickListener);
  CheckBoxPreference showBip44Path=(CheckBoxPreference)findPreference("String_Node_Str");
  showBip44Path.setChecked(_mbwManager.getMetadataStorage().getShowBip44Path());
  showBip44Path.setOnPreferenceClickListener(showBip44PathClickListener);
  final ListPreference useTor=Preconditions.checkNotNull((ListPreference)findPreference("String_Node_Str"));
  useTor.setTitle(getUseTorTitle());
  useTor.setEntries(new String[]{getString(R.string.use_https),getString(R.string.use_external_tor)});
  useTor.setEntryValues(new String[]{ServerEndpointType.Types.ONLY_HTTPS.toString(),ServerEndpointType.Types.ONLY_TOR.toString()});
  useTor.setValue(_mbwManager.getTorMode().toString());
  useTor.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object newValue){
      if (newValue.equals(ServerEndpointType.Types.ONLY_TOR.toString())) {
        OrbotHelper obh=new OrbotHelper(SettingsActivity.this);
        if (!obh.isOrbotInstalled()) {
          obh.promptToInstall(SettingsActivity.this);
        }
      }
      _mbwManager.setTorMode(ServerEndpointType.Types.valueOf((String)newValue));
      useTor.setTitle(getUseTorTitle());
      return true;
    }
  }
);
  CheckBoxPreference ledgerDisableTee=(CheckBoxPreference)findPreference("String_Node_Str");
  Preference ledgerSetUnpluggedAID=findPreference("String_Node_Str");
  boolean isTeeAvailable=LedgerTransportTEEProxyFactory.isServiceAvailable(this);
  if (isTeeAvailable) {
    ledgerDisableTee.setChecked(_mbwManager.getLedgerManager().getDisableTEE());
    ledgerDisableTee.setOnPreferenceClickListener(onClickLedgerNotificationDisableTee);
  }
 else {
    PreferenceCategory ledger=(PreferenceCategory)findPreference("String_Node_Str");
    ledger.removePreference(ledgerDisableTee);
  }
  ledgerSetUnpluggedAID.setOnPreferenceClickListener(onClickLedgerSetUnpluggedAID);
  applyLocalTraderEnablement();
  initExternalSettings();
  PreferenceCategory modulesPrefs=(PreferenceCategory)findPreference("String_Node_Str");
  if (!CommunicationManager.getInstance(this).getPairedModules().isEmpty()) {
    for (    final Module module : CommunicationManager.getInstance(this).getPairedModules()) {
      Preference preference=new Preference(this);
      preference.setLayoutResource(R.layout.preference_layout);
      preference.setTitle(Html.fromHtml(module.getName()));
      preference.setSummary(module.getDescription());
      preference.setOnPreferenceClickListener(new OnPreferenceClickListener(){
        @Override public boolean onPreferenceClick(        Preference preference){
          Intent intent=new Intent(com.mycelium.modularizationtools.Constants.getSETTINGS());
          intent.setPackage(module.getModulePackage());
          startActivity(intent);
          return true;
        }
      }
);
      modulesPrefs.addPreference(preference);
    }
  }
 else {
    Preference preference=new Preference(this);
    preference.setTitle(R.string.no_connected_modules);
    modulesPrefs.addPreference(preference);
  }
  for (  final Module module : GooglePlayModuleCollection.getModules(this).values()) {
    if (!CommunicationManager.getInstance(this).getPairedModules().contains(module)) {
      ButtonPreference installPreference=new ButtonPreference(this);
      installPreference.setButtonText(getString(R.string.install));
      installPreference.setButtonClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          Intent installIntent=new Intent(Intent.ACTION_VIEW);
          installIntent.setData(Uri.parse("String_Node_Str" + module.getModulePackage()));
          startActivity(installIntent);
        }
      }
);
      installPreference.setTitle(Html.fromHtml(module.getName()));
      installPreference.setSummary(module.getDescription());
      modulesPrefs.addPreference(installPreference);
    }
  }
}