CID-1256277 use StringBuffer in loop
Merge branch 'hotfix/CID-1256277'