AI REVIEWED
Module: schema-tools
File: schematools/validation/SchemaValidator.java (~line 381-453)
Severity: Low
Summary
final int minVersion = schemas.stream()
.map(s -> s.version().getVersion())
.min(Comparator.naturalOrder())
.orElse(0);
If the registry is empty after bootstrap, orElse(0) assumes version 0 exists. This could create invalid analysis parameters without any schema data to analyze.
Expected Behavior
Return early with an empty/valid result if no schemas exist.
Suggested Fix
if (schemas.isEmpty()) {
return ValidationResult.empty();
}
AI REVIEWED
Module: schema-tools
File:
schematools/validation/SchemaValidator.java(~line 381-453)Severity: Low
Summary
If the registry is empty after bootstrap,
orElse(0)assumes version 0 exists. This could create invalid analysis parameters without any schema data to analyze.Expected Behavior
Return early with an empty/valid result if no schemas exist.
Suggested Fix