Yes, that may not hold up in court if it is a tiny non-essential fragment or, if you revert to old code soon, etc. but that’s not the point; if you end up in court, you already lost.
With BSD-licensed code, that risk is way smaller. The worst you have to do is add a few (or quite a few thousand. Go check Setting/General/About/Legal for an example) attribution lines to the versions of your code that use the BSD-licensed code.
(Also, even if you choose to license your code under the GPL, you have to track licensing, as it isn’t legally possible to combine GPL2 and GPLv3 or APGL and GPLv3 licenses or any GPL with ApAchexlicensed code in a single binary. See https://www.gnu.org/licenses/license-list.en.html. If you want to troll GPL aficionados, license your code under GPLv1)