XCOMMONS-521: Merge bug in some rare case where current and new are similar

(cherry picked from commit 08e3e3097c4e1d0c67c7f64bbe213dd663b08bd3)