Move conversion to SubmitRecords into SubmitRuleEvaluator
Much of this logic is shared between TestSubmitRule and
ChangeControl.canSubmit(), which both depend on this output format.
Move the logic into SubmitRuleEvaluator to lessen the leakage of Term
objects.
The main difference in behavior between these two classes is how
errors are treated. canSubmit() is called by non-admin end users who
get bland error messages telling them to check the server logs;
TestSubmitRule is for admins who need to debug submit rules, and
errors are expected to happen. So we need to distinguish the case when
detailed error messages should go to the user vs. in the logs. Do this
explicitly with a setLogErrors() method on SubmitRuleEvaluator.
Change-Id: Ia61310e4fb6dea255ab721893eea070ca95d216c
3 files changed