Program: 90953
Project: 90953
Buggy source:
private MbwManager(Context evilContext){
  Queue<LogEntry> unsafeWapiLogs=EvictingQueue.create(100);
  _wapiLogs=Queues.synchronizedQueue(unsafeWapiLogs);
  _applicationContext=Preconditions.checkNotNull(evilContext.getApplicationContext());
  _environment=MbwEnvironment.verifyEnvironment();
  String version=VersionManager.determineVersion(_applicationContext);
  SharedPreferences preferences=getPreferences();
  configuration=new WalletConfiguration(preferences,getNetwork());
  _eventBus=new Bus();
  _eventBus.register(this);
  try {
    setTorMode(ServerEndpointType.Types.valueOf(preferences.getString(Constants.TOR_MODE,"String_Node_Str")));
  }
 catch (  IllegalArgumentException ex) {
    setTorMode(ServerEndpointType.Types.ONLY_HTTPS);
  }
  _wapi=initWapi();
  _httpErrorCollector=HttpErrorCollector.registerInVM(_applicationContext,_wapi);
  _randomSource=new AndroidRandomSource();
  TradeSessionDb tradeSessionDb=new TradeSessionDb(_applicationContext);
  _ltApi=initLt();
  _localTraderManager=new LocalTraderManager(_applicationContext,tradeSessionDb,getLtApi(),this);
  _pin=new Pin(preferences.getString(Constants.PIN_SETTING,"String_Node_Str"),preferences.getString(Constants.PIN_SETTING_RESETTABLE,"String_Node_Str").equals("String_Node_Str"));
  _pinRequiredOnStartup=preferences.getBoolean(Constants.PIN_SETTING_REQUIRED_ON_STARTUP,false);
  randomizePin=preferences.getBoolean(Constants.RANDOMIZE_PIN,true);
  _minerFee=MinerFee.fromString(preferences.getString(Constants.MINER_FEE_SETTING,MinerFee.NORMAL.toString()));
  _enableContinuousFocus=preferences.getBoolean(Constants.ENABLE_CONTINUOUS_FOCUS_SETTING,false);
  _keyManagementLocked=preferences.getBoolean(Constants.KEY_MANAGEMENT_LOCKED_SETTING,false);
  DisplayMetrics dm=new DisplayMetrics();
  WindowManager windowManager=(WindowManager)_applicationContext.getSystemService(Context.WINDOW_SERVICE);
  windowManager.getDefaultDisplay().getMetrics(dm);
  _storage=new MetadataStorage(_applicationContext);
  _language=preferences.getString(Constants.LANGUAGE_SETTING,Locale.getDefault().getLanguage());
  _versionManager=new VersionManager(_applicationContext,_language,new AndroidAsyncApi(_wapi,_eventBus),version,_eventBus);
  Set<String> currencyList=getPreferences().getStringSet(Constants.SELECTED_CURRENCIES,null);
  Set<String> fiatCurrencies=new HashSet<>();
  if (currencyList == null || currencyList.isEmpty()) {
    fiatCurrencies.add(Constants.DEFAULT_CURRENCY);
  }
 else {
    fiatCurrencies.addAll(currencyList);
  }
  _exchangeRateManager=new ExchangeRateManager(_applicationContext,_wapi,getNetwork(),getMetadataStorage());
  _currencySwitcher=new CurrencySwitcher(_exchangeRateManager,fiatCurrencies,getPreferences().getString(Constants.FIAT_CURRENCY_SETTING,Constants.DEFAULT_CURRENCY),Denomination.fromString(preferences.getString(Constants.BITCOIN_DENOMINATION_SETTING,Denomination.BTC.toString())));
  ActivityManager am=(ActivityManager)_applicationContext.getSystemService(Context.ACTIVITY_SERVICE);
  int memoryClass=am.getMemoryClass();
  _deviceScryptParameters=memoryClass > 20 ? MrdExport.V1.ScryptParameters.DEFAULT_PARAMS : MrdExport.V1.ScryptParameters.LOW_MEM_PARAMS;
  _trezorManager=new TrezorManager(_applicationContext,getNetwork(),getEventBus());
  _keepkeyManager=new KeepKeyManager(_applicationContext,getNetwork(),getEventBus());
  _ledgerManager=new LedgerManager(_applicationContext,getNetwork(),getEventBus());
  _walletManager=createWalletManager(_applicationContext,_environment);
  _eventTranslator=new EventTranslator(new Handler(),_eventBus);
  _exchangeRateManager.subscribe(_eventTranslator);
  _walletManager.addObserver(_eventTranslator);
  _coinapultManager=createCoinapultManager();
  if (_coinapultManager.isPresent()) {
    addExtraAccounts(_coinapultManager.get());
  }
  new InitColuManagerTask().execute();
  setCurrencyList(fiatCurrencies);
  migrateOldKeys();
  createTempWalletManager();
  _versionManager.initBackgroundVersionChecker();
  _blockExplorerManager=new BlockExplorerManager(this,_environment.getBlockExplorerList(),getPreferences().getString(Constants.BLOCK_EXPLORER,_environment.getBlockExplorerList().get(0).getIdentifier()));
}

Fixed version (ground truth):
private MbwManager(Context evilContext){
  Queue<LogEntry> unsafeWapiLogs=EvictingQueue.create(100);
  _wapiLogs=Queues.synchronizedQueue(unsafeWapiLogs);
  _applicationContext=Preconditions.checkNotNull(evilContext.getApplicationContext());
  _environment=MbwEnvironment.verifyEnvironment();
  String version=VersionManager.determineVersion(_applicationContext);
  SharedPreferences preferences=getPreferences();
  configuration=new WalletConfiguration(preferences,getNetwork());
  _eventBus=new Bus();
  _eventBus.register(this);
  try {
    setTorMode(ServerEndpointType.Types.valueOf(preferences.getString(Constants.TOR_MODE,"String_Node_Str")));
  }
 catch (  IllegalArgumentException ex) {
    setTorMode(ServerEndpointType.Types.ONLY_HTTPS);
  }
  _wapi=initWapi();
  _httpErrorCollector=HttpErrorCollector.registerInVM(_applicationContext,_wapi);
  _randomSource=new AndroidRandomSource();
  TradeSessionDb tradeSessionDb=new TradeSessionDb(_applicationContext);
  _ltApi=initLt();
  _localTraderManager=new LocalTraderManager(_applicationContext,tradeSessionDb,getLtApi(),this);
  _pin=new Pin(preferences.getString(Constants.PIN_SETTING,"String_Node_Str"),preferences.getString(Constants.PIN_SETTING_RESETTABLE,"String_Node_Str").equals("String_Node_Str"));
  _pinRequiredOnStartup=preferences.getBoolean(Constants.PIN_SETTING_REQUIRED_ON_STARTUP,false);
  randomizePinPad=preferences.getBoolean(Constants.RANDOMIZE_PIN,true);
  _minerFee=MinerFee.fromString(preferences.getString(Constants.MINER_FEE_SETTING,MinerFee.NORMAL.toString()));
  _enableContinuousFocus=preferences.getBoolean(Constants.ENABLE_CONTINUOUS_FOCUS_SETTING,false);
  _keyManagementLocked=preferences.getBoolean(Constants.KEY_MANAGEMENT_LOCKED_SETTING,false);
  DisplayMetrics dm=new DisplayMetrics();
  WindowManager windowManager=(WindowManager)_applicationContext.getSystemService(Context.WINDOW_SERVICE);
  windowManager.getDefaultDisplay().getMetrics(dm);
  _storage=new MetadataStorage(_applicationContext);
  _language=preferences.getString(Constants.LANGUAGE_SETTING,Locale.getDefault().getLanguage());
  _versionManager=new VersionManager(_applicationContext,_language,new AndroidAsyncApi(_wapi,_eventBus),version,_eventBus);
  Set<String> currencyList=getPreferences().getStringSet(Constants.SELECTED_CURRENCIES,null);
  Set<String> fiatCurrencies=new HashSet<>();
  if (currencyList == null || currencyList.isEmpty()) {
    fiatCurrencies.add(Constants.DEFAULT_CURRENCY);
  }
 else {
    fiatCurrencies.addAll(currencyList);
  }
  _exchangeRateManager=new ExchangeRateManager(_applicationContext,_wapi,getNetwork(),getMetadataStorage());
  _currencySwitcher=new CurrencySwitcher(_exchangeRateManager,fiatCurrencies,getPreferences().getString(Constants.FIAT_CURRENCY_SETTING,Constants.DEFAULT_CURRENCY),Denomination.fromString(preferences.getString(Constants.BITCOIN_DENOMINATION_SETTING,Denomination.BTC.toString())));
  ActivityManager am=(ActivityManager)_applicationContext.getSystemService(Context.ACTIVITY_SERVICE);
  int memoryClass=am.getMemoryClass();
  _deviceScryptParameters=memoryClass > 20 ? MrdExport.V1.ScryptParameters.DEFAULT_PARAMS : MrdExport.V1.ScryptParameters.LOW_MEM_PARAMS;
  _trezorManager=new TrezorManager(_applicationContext,getNetwork(),getEventBus());
  _keepkeyManager=new KeepKeyManager(_applicationContext,getNetwork(),getEventBus());
  _ledgerManager=new LedgerManager(_applicationContext,getNetwork(),getEventBus());
  _walletManager=createWalletManager(_applicationContext,_environment);
  _eventTranslator=new EventTranslator(new Handler(),_eventBus);
  _exchangeRateManager.subscribe(_eventTranslator);
  _walletManager.addObserver(_eventTranslator);
  _coinapultManager=createCoinapultManager();
  if (_coinapultManager.isPresent()) {
    addExtraAccounts(_coinapultManager.get());
  }
  new InitColuManagerTask().execute();
  setCurrencyList(fiatCurrencies);
  migrateOldKeys();
  createTempWalletManager();
  _versionManager.initBackgroundVersionChecker();
  _blockExplorerManager=new BlockExplorerManager(this,_environment.getBlockExplorerList(),getPreferences().getString(Constants.BLOCK_EXPLORER,_environment.getBlockExplorerList().get(0).getIdentifier()));
}