[YANGTOOLS-1414] Improve trust between DefaultSchemaTreeInference and SchemaInferenceStack Created: 23/Mar/22  Updated: 10/Apr/22  Resolved: 10/Apr/22

Status: Resolved
Project: yangtools
Component/s: model-spi, model-util
Affects Version/s: None
Fix Version/s: 8.0.3, 7.0.16

Type: Improvement Priority: High
Reporter: Robert Varga Assignee: Samuel Schneider
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

DefaultSchemaTreeInference does not trust its callers and SchemaInferenceStack re-validates SchemaTreeInference arguments. This is nice from defensiveness perspective, but both of these classes are providing guarantees of well-formedness.

We can save significant amounts of work if these classes co-operate is some sort of fashion. This probably entails an DefaultSchemaTreeInference.unsafeOf(), with explicit warnings et al. If we go that route, also add a runtime knob (based on a system property) to cause unsafeOf() to treat the input as unsafe and validate it.


Generated at Wed Feb 07 20:56:05 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.