[NUCCORE-1094] Convert StringBuffer to StringBuilder in places where we
can get away with it