Why should transformed Java code be kept in source control alongside the rest of the codebase?
Select an answer to reveal the explanation.
Short Explanation
Keep it in source control so you can see what changed, review it, and roll it back. That applies to generated code just as much as hand-written code.
Full Explanation
Keeping transformed Java code in source control preserves a versioned, auditable history of every generated and refined iteration, which review, rollback and governance all depend on. Versioned history lets reviewers see what a transformation produced, lets a rollout be rolled back cleanly, and gives governance an audit trail of how the transformed system came to be.
The claim that source control is only required for hand-written code, not for anything a tool generates, is incorrect because generated code carries exactly the same operational risk as hand-written code once it is running in production.
The claim that storing generated code outside version control makes it easier to regenerate later if needed is incorrect because storing outside version control makes regeneration harder to reason about, not easier - there is no record of what was there before.
The claim that source control adds unnecessary overhead once code has already been transformed once is incorrect because the overhead of committing is trivial next to the cost of losing traceability on production code.
For the exam, treat generated code as first-class code that belongs in source control.