Program: 165038
Project: 165038
Buggy source:
/** 
 * Starts the Pay With PayPal flow with additional scopes. This will launch the PayPal app if installed or switch to the browser for user authorization. The Billing Agreement flow will be used if enabled, otherwise the Future Payment flow will be used.
 * @param fragment A {@link BraintreeFragment} used to process the request.
 * @param additionalScopes A {@link java.util.List} of additional scopes. Ex: {@link #SCOPE_ADDRESS}. Acceptable scopes are defined in   {@link com.braintreepayments.api.PayPal}.
 */
public static void authorizeAccount(final BraintreeFragment fragment,final List<String> additionalScopes){
  fragment.waitForConfiguration(new ConfigurationListener(){
    @Override public void onConfigurationFetched(    Configuration configuration){
      fragment.sendAnalyticsEvent("String_Node_Str");
      if (fragment.getConfiguration().getPayPal().getUseBillingAgreement()) {
        PayPalCheckout checkout=new PayPalCheckout();
        billingAgreement(fragment,checkout);
        return;
      }
      sBraintreeFragmentBroadcastReceiver.setFragment(fragment);
      BraintreeBroadcastManager.getInstance(fragment.getContext()).registerReceiver(sBraintreeFragmentBroadcastReceiver,new IntentFilter(BraintreeBrowserSwitchActivity.LOCAL_BROADCAST_BROWSER_SWITCH_COMPLETED));
      try {
        sPendingRequest=buildPayPalAuthorizationConfiguration(fragment.getActivity(),fragment.getConfiguration(),fragment.getClientToken().toJson());
        if (additionalScopes != null) {
          for (          String scope : additionalScopes) {
            ((AuthorizationRequest)sPendingRequest).withScopeValue(scope);
          }
        }
        sPendingRequestStatus=PayPalOneTouchCore.performRequest(fragment.getActivity(),sPendingRequest,PAYPAL_AUTHORIZATION_REQUEST_CODE,sEnableSignatureVerification,new BrowserSwitchAdapter(){
          @Override public void handleBrowserSwitchIntent(          Intent intent){
            fragment.getActivity().startActivityForResult(new Intent(fragment.getActivity(),BraintreeBrowserSwitchActivity.class).setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION).putExtra(BraintreeBrowserSwitchActivity.EXTRA_INTENT,intent),PAYPAL_AUTHORIZATION_REQUEST_CODE);
          }
        }
);
        sendAnalyticsForPayPalPerformRequestStatus(fragment,sPendingRequestStatus,false);
      }
 catch (      BraintreeException ignored) {
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts the Pay With PayPal flow with additional scopes. This will launch the PayPal app if installed or switch to the browser for user authorization. The Billing Agreement flow will be used if enabled, otherwise the Future Payment flow will be used.
 * @param fragment A {@link BraintreeFragment} used to process the request.
 * @param additionalScopes A {@link java.util.List} of additional scopes. Ex: {@link #SCOPE_ADDRESS}. Acceptable scopes are defined in   {@link com.braintreepayments.api.PayPal}.
 */
public static void authorizeAccount(final BraintreeFragment fragment,final List<String> additionalScopes){
  fragment.waitForConfiguration(new ConfigurationListener(){
    @Override public void onConfigurationFetched(    Configuration configuration){
      fragment.sendAnalyticsEvent("String_Node_Str");
      if (fragment.getConfiguration().getPayPal().getUseBillingAgreement()) {
        PayPalCheckout checkout=new PayPalCheckout();
        billingAgreement(fragment,checkout);
        return;
      }
      sBraintreeFragmentBroadcastReceiver.setFragment(fragment);
      BraintreeBroadcastManager.getInstance(fragment.getApplicationContext()).registerReceiver(sBraintreeFragmentBroadcastReceiver,new IntentFilter(BraintreeBrowserSwitchActivity.LOCAL_BROADCAST_BROWSER_SWITCH_COMPLETED));
      try {
        sPendingRequest=buildPayPalAuthorizationConfiguration(fragment.getActivity(),fragment.getConfiguration(),fragment.getClientToken().toJson());
        if (additionalScopes != null) {
          for (          String scope : additionalScopes) {
            ((AuthorizationRequest)sPendingRequest).withScopeValue(scope);
          }
        }
        sPendingRequestStatus=PayPalOneTouchCore.performRequest(fragment.getActivity(),sPendingRequest,PAYPAL_AUTHORIZATION_REQUEST_CODE,sEnableSignatureVerification,new BrowserSwitchAdapter(){
          @Override public void handleBrowserSwitchIntent(          Intent intent){
            fragment.getActivity().startActivityForResult(new Intent(fragment.getActivity(),BraintreeBrowserSwitchActivity.class).setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION).putExtra(BraintreeBrowserSwitchActivity.EXTRA_INTENT,intent),PAYPAL_AUTHORIZATION_REQUEST_CODE);
          }
        }
);
        sendAnalyticsForPayPalPerformRequestStatus(fragment,sPendingRequestStatus,false);
      }
 catch (      BraintreeException ignored) {
      }
    }
  }
);
}