AI REVIEWED
Module: spring-boot-starter
File: spring/service/DefaultMigrationService.java (~line 413-414)
Severity: High
Summary
Builder validation uses assert statements which are disabled by default in production JVMs:
assert from != null : "fromVersion must be set";
assert to != null : "toVersion must be set";
Expected Behavior
Validation should always execute, throwing IllegalStateException for invalid builder state.
Actual Behavior
With -ea disabled (production default), invalid builder states pass silently to the migration call, causing confusing NPEs later.
Suggested Fix
if (from == null) throw new IllegalStateException("fromVersion must be set");
if (to == null) throw new IllegalStateException("toVersion must be set");