Fix for CARBON-14819 : added Jayanga's fix from carbon-commons repo