private int cleanKeyWord(StringBuffer contentBuffer, char[] array, int currentIndex, VelocityParserContext context,
FilterContext filterContext) throws InvalidVelocityException
{
int i = this.velocityParser.getKeyWord(array, currentIndex, null, context);
if (context.getType() != VelocityType.COMMENT) {
if (context.getType() == VelocityType.DIRECTIVE) {
if (filterContext.wsGroup.length() == 0) {
flushWhiteSpaces(filterContext.wsGroup, filterContext, false);
}
filterContext.wsGroup.append(array, currentIndex, i - currentIndex);
filterContext.removeWhiteSpaces = true;
} else {
flushWhiteSpaces(contentBuffer, filterContext, false);
contentBuffer.append(array, currentIndex, i - currentIndex);
}
}
return i;
}