Program: 93952
Project: 93952
Buggy source:
private void startNativeScan_postLollipop(){
  final BleScanMode scanMode_abstracted=getManager().m_config.scanMode;
  final int scanMode;
  if (scanMode_abstracted == null || scanMode_abstracted == BleScanMode.AUTO) {
    if (getManager().isForegrounded()) {
      if (m_isPoll || m_scanTime == Double.POSITIVE_INFINITY) {
        scanMode=ScanSettings.SCAN_MODE_BALANCED;
      }
 else {
        scanMode=ScanSettings.SCAN_MODE_LOW_LATENCY;
      }
    }
 else {
      scanMode=ScanSettings.SCAN_MODE_LOW_POWER;
    }
  }
 else {
    scanMode=scanMode_abstracted.getNativeMode();
  }
  if (false == Utils.isLollipop()) {
    getManager().ASSERT(false,"String_Node_Str");
  }
 else {
    final ScanSettings.Builder builder=new ScanSettings.Builder();
    builder.setScanMode(scanMode);
    if (getManager().getNativeAdapter().isOffloadedScanBatchingSupported()) {
      final Interval scanReportDelay=getManager().m_config.scanReportDelay;
      final long scanReportDelay_millis=false == Interval.isDisabled(scanReportDelay) ? scanReportDelay.millis() : 0;
      builder.setReportDelay(scanReportDelay_millis);
    }
 else {
      builder.setReportDelay(0);
    }
    if (Utils.isMarshmallow()) {
      builder.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES);
      builder.setMatchMode(ScanSettings.MATCH_MODE_AGGRESSIVE);
      builder.setNumOfMatches(ScanSettings.MATCH_NUM_MAX_ADVERTISEMENT);
    }
    final ScanSettings scanSettings=builder.build();
    getManager().getNativeAdapter().getBluetoothLeScanner().startScan(null,scanSettings,m_scanCallback_postLollipop);
  }
}

Fixed version (ground truth):
private void startNativeScan_postLollipop(){
  final BleScanMode scanMode_abstracted=getManager().m_config.scanMode;
  final int scanMode;
  if (scanMode_abstracted == null || scanMode_abstracted == BleScanMode.AUTO) {
    if (getManager().isForegrounded()) {
      if (m_isPoll || m_scanTime == Double.POSITIVE_INFINITY) {
        scanMode=ScanSettings.SCAN_MODE_BALANCED;
      }
 else {
        scanMode=ScanSettings.SCAN_MODE_LOW_LATENCY;
      }
    }
 else {
      scanMode=ScanSettings.SCAN_MODE_LOW_POWER;
    }
  }
 else {
    scanMode=scanMode_abstracted.getNativeMode();
  }
  if (false == Utils.isLollipop()) {
    getManager().ASSERT(false,"String_Node_Str");
    fail();
  }
 else {
    final ScanSettings.Builder builder=new ScanSettings.Builder();
    builder.setScanMode(scanMode);
    if (getManager().getNativeAdapter().isOffloadedScanBatchingSupported()) {
      final Interval scanReportDelay=getManager().m_config.scanReportDelay;
      final long scanReportDelay_millis=false == Interval.isDisabled(scanReportDelay) ? scanReportDelay.millis() : 0;
      builder.setReportDelay(scanReportDelay_millis);
    }
 else {
      builder.setReportDelay(0);
    }
    if (Utils.isMarshmallow()) {
      builder.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES);
      builder.setMatchMode(ScanSettings.MATCH_MODE_AGGRESSIVE);
      builder.setNumOfMatches(ScanSettings.MATCH_NUM_MAX_ADVERTISEMENT);
    }
    final ScanSettings scanSettings=builder.build();
    getManager().getNativeAdapter().getBluetoothLeScanner().startScan(null,scanSettings,m_scanCallback_postLollipop);
  }
}