[FIXED JENKINS-20415] Lack of type safety in JENKINS-20143 fix sometimes caused CCEs.