Program: 165030
Project: 165030
Buggy source:
/** 
 * Starts the Checkout With PayPal flow. This will launch the PayPal app if installed or switch to the browser for user authorization. <p> This requires that the merchant uses a   {@link com.braintreepayments.api.models.ClientToken}
 * @param fragment A {@link BraintreeFragment} used to process the request.
 * @param request A {@link PayPalRequest} used to customize the request.
 * @param isBillingAgreement A boolean. If true, this will use the Billing Agreement. Otherwise,PayPal will perform a Single Payment.
 */
private static void requestOneTimePayment(final BraintreeFragment fragment,final PayPalRequest request,final boolean isBillingAgreement){
  final HttpResponseCallback callback=new HttpResponseCallback(){
    @Override public void success(    String responseBody){
      final PayPalPaymentResource paypalPaymentResource;
      try {
        paypalPaymentResource=PayPalPaymentResource.fromJson(responseBody);
      }
 catch (      JSONException e) {
        fragment.postCallback(e);
        return;
      }
      if (isBillingAgreement) {
        sPendingRequest=getBillingAgreementRequest(paypalPaymentResource.getRedirectUrl(),fragment.getApplicationContext(),fragment.getConfiguration().getPayPal());
      }
 else {
        sPendingRequest=getCheckoutRequest(paypalPaymentResource.getRedirectUrl(),fragment.getApplicationContext(),fragment.getConfiguration().getPayPal());
      }
      sPendingRequestStatus=PayPalOneTouchCore.performRequest(fragment.getActivity(),sPendingRequest,PAYPAL_REQUEST_CODE,sEnableSignatureVerification,getBrowserSwitchAdapter(fragment));
      sendAnalyticsForPayPalPerformRequestStatus(fragment,sPendingRequestStatus);
    }
    @Override public void failure(    Exception e){
      fragment.postCallback(e);
    }
  }
;
  fragment.waitForConfiguration(new ConfigurationListener(){
    @Override public void onConfigurationFetched(    Configuration configuration){
      if (!configuration.isPayPalEnabled()) {
        fragment.postCallback(new ConfigurationException("String_Node_Str"));
        return;
      }
      try {
        createPaymentResource(fragment,request,isBillingAgreement,callback);
      }
 catch (      JSONException|ErrorWithResponse|BraintreeException ex) {
        fragment.postCallback(ex);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts the Checkout With PayPal flow. This will launch the PayPal app if installed or switch to the browser for user authorization. <p> This requires that the merchant uses a   {@link com.braintreepayments.api.models.ClientToken}
 * @param fragment A {@link BraintreeFragment} used to process the request.
 * @param request A {@link PayPalRequest} used to customize the request.
 * @param isBillingAgreement A boolean. If true, this will use the Billing Agreement. Otherwise,PayPal will perform a Single Payment.
 */
private static void requestOneTimePayment(final BraintreeFragment fragment,final PayPalRequest request,final boolean isBillingAgreement){
  final HttpResponseCallback callback=new HttpResponseCallback(){
    @Override public void success(    String responseBody){
      final PayPalPaymentResource paypalPaymentResource;
      try {
        paypalPaymentResource=PayPalPaymentResource.fromJson(responseBody);
      }
 catch (      JSONException e) {
        fragment.postCallback(e);
        return;
      }
      if (isBillingAgreement) {
        sPendingRequest=getBillingAgreementRequest(paypalPaymentResource.getRedirectUrl(),fragment.getApplicationContext(),fragment.getConfiguration().getPayPal());
      }
 else {
        sPendingRequest=getCheckoutRequest(paypalPaymentResource.getRedirectUrl(),fragment.getApplicationContext(),fragment.getConfiguration().getPayPal());
      }
      startPayPal(fragment,PayPalOneTouchCore.getStartIntent(fragment.getActivity(),sPendingRequest,sEnableSignatureVerification));
    }
    @Override public void failure(    Exception e){
      fragment.postCallback(e);
    }
  }
;
  fragment.waitForConfiguration(new ConfigurationListener(){
    @Override public void onConfigurationFetched(    Configuration configuration){
      if (!configuration.isPayPalEnabled()) {
        fragment.postCallback(new ConfigurationException("String_Node_Str"));
        return;
      }
      try {
        createPaymentResource(fragment,request,isBillingAgreement,callback);
      }
 catch (      JSONException|ErrorWithResponse|BraintreeException ex) {
        fragment.postCallback(ex);
      }
    }
  }
);
}