C#/Java: Content based model generation improvements. #17363
+899
−75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we apply the content based model generator to
Many of these models are undesirable, primarily because of one of the following reasons
With the changes proposed in this PR, applying the content based model generator to
The issues are addressed in the following way:
get
andset
methods that uses a private backing fieldX
. In this case we would like to generate the summariesset : Argument[0] -> Argument[this].SyntheticField[X]
andget : Argument[this].SyntheticField[X] -> ReturnValue
, but we only want to do this in case both methods exists. If only theget
method exists, then it retrieves information from a "dead" synthetic field. The synthetic chaining is currently based on access path equality but that restriction could potentially be loosened a bit, but I suspect that this only has limited impact on the generated summaries.Note that the changes in this PR doesn't change the production version of the model generation and only impacts model generated by the recently introduced
--with-contentbased-summaries
.Further changes are still required for this to be production ready, but the changes in this PR are self contained.