We could fix it in liferay-util:buffer, but the code would be ugly and maybe destroyed again when do source formatting, since there're TABs in the code. We may need a code like this "rootNodeNameLink = StringUtil.trim(rootNodeNameLing);", but to fix in the liferay-util:buffer will make the code less readable for human.