Program: 165037
Project: 165037
Buggy source:
/** 
 * Collect device information for fraud identification purposes. This should be used in conjunction with a non-aggregate fraud id.
 * @param fragment {@link BraintreeFragment}
 * @param merchantId The fraud merchant id from Braintree.
 * @param collectorUrl The fraud collector url from Braintree.
 * @return Device data String to send to Braintree.
 */
public static String collectDeviceData(BraintreeFragment fragment,String merchantId,String collectorUrl){
  JSONObject deviceData=new JSONObject();
  try {
    DeviceCollector deviceCollector=new DeviceCollector(fragment.getActivity());
    sDeviceCollector=deviceCollector;
    deviceCollector.setMerchantId(merchantId);
    deviceCollector.setCollectorUrl(collectorUrl);
    deviceCollector.setStatusListener(new StatusListener(){
      @Override public void onCollectorStart(){
      }
      @Override public void onCollectorSuccess(){
        sDeviceCollector=null;
      }
      @Override public void onCollectorError(      ErrorCode errorCode,      Exception e){
        sDeviceCollector=null;
      }
    }
);
    String deviceSessionId=UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str");
    deviceData.put(DEVICE_SESSION_ID_KEY,deviceSessionId);
    deviceData.put(FRAUD_MERCHANT_ID_KEY,merchantId);
    deviceCollector.collect(deviceSessionId);
  }
 catch (  NoClassDefFoundError|JSONException ignored) {
  }
  try {
    deviceData.put(CORRELATION_ID_KEY,PayPalOneTouchCore.getClientMetadataId(fragment.getContext()));
  }
 catch (  JSONException ignored) {
  }
  return deviceData.toString();
}

Fixed version (ground truth):
/** 
 * Collect device information for fraud identification purposes. This should be used in conjunction with a non-aggregate fraud id.
 * @param fragment {@link BraintreeFragment}
 * @param merchantId The fraud merchant id from Braintree.
 * @param collectorUrl The fraud collector url from Braintree.
 * @return Device data String to send to Braintree.
 */
public static String collectDeviceData(BraintreeFragment fragment,String merchantId,String collectorUrl){
  JSONObject deviceData=new JSONObject();
  try {
    DeviceCollector deviceCollector=new DeviceCollector(fragment.getActivity());
    sDeviceCollector=deviceCollector;
    deviceCollector.setMerchantId(merchantId);
    deviceCollector.setCollectorUrl(collectorUrl);
    deviceCollector.setStatusListener(new StatusListener(){
      @Override public void onCollectorStart(){
      }
      @Override public void onCollectorSuccess(){
        sDeviceCollector=null;
      }
      @Override public void onCollectorError(      ErrorCode errorCode,      Exception e){
        sDeviceCollector=null;
      }
    }
);
    String deviceSessionId=UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str");
    deviceData.put(DEVICE_SESSION_ID_KEY,deviceSessionId);
    deviceData.put(FRAUD_MERCHANT_ID_KEY,merchantId);
    deviceCollector.collect(deviceSessionId);
  }
 catch (  NoClassDefFoundError|JSONException ignored) {
  }
  try {
    deviceData.put(CORRELATION_ID_KEY,PayPalOneTouchCore.getClientMetadataId(fragment.getApplicationContext()));
  }
 catch (  JSONException ignored) {
  }
  return deviceData.toString();
}