[BUG #7156] taking over fix from master for statementEnd() issue in dense code