Merge pull request #21415 from owen-mc/java/validate-constructor-summary-models

Java: validate constructor summary models
This commit is contained in:
Owen Mansel-Chan
2026-03-06 09:09:18 +00:00
committed by GitHub
6 changed files with 149 additions and 135 deletions

View File

@@ -367,12 +367,24 @@ module ModelValidation {
)
}
string getIncorrectConstructorSummaryOutput() {
exists(string namespace, string type, string name, string output |
summaryModel(namespace, type, _, name, _, _, _, output, _, _, _)
|
type = name and
output.matches("ReturnValue%") and
result =
"Constructor model for " + namespace + "." + type +
" should use `Argument[this]` in the output, not `ReturnValue`."
)
}
/** Holds if some row in a MaD flow model appears to contain typos. */
query predicate invalidModelRow(string msg) {
msg =
[
getInvalidModelSignature(), getInvalidModelInput(), getInvalidModelOutput(),
KindVal::getInvalidModelKind()
getIncorrectConstructorSummaryOutput(), KindVal::getInvalidModelKind()
]
}
}