Pricing/EventListener/TaxGroupListener.php
protected function fixDefault(TaxGroupInterface $taxGroup)
    {
        if (!$this->persistenceHelper->isChanged($taxGroup, ['default'])) {
            return;
        }

        if ($taxGroup->isDefault()) {
            try {
                $previousTaxGroup = $this->taxGroupRepository->findDefault();
            } catch (RuntimeException $e) {
                return;
            }

            if (null === $previousTaxGroup || $previousTaxGroup === $taxGroup) {
                return;
            }

            $previousTaxGroup->setDefault(false);

            $this->persistenceHelper->persistAndRecompute($previousTaxGroup, false);
        }
    }
protected function fixDefault(TaxGroupInterface $taxGroup)
    {
        if (!$this->persistenceHelper->isChanged($taxGroup, ['default'])) {
            return;
        }

        if ($taxGroup->isDefault()) {
            try {
                $previousTaxGroup = $this->taxGroupRepository->findDefault();
            } catch (RuntimeException $e) {
                return;
            }

            if (null === $previousTaxGroup || $previousTaxGroup === $taxGroup) {
                return;
            }

            $previousTaxGroup->setDefault(false);

            $this->persistenceHelper->persistAndRecompute($previousTaxGroup, false);
        }
    }
Fixes the default tax group.

@param TaxGroupInterface $taxGroup