add support to detect accesses of fields by specific methods#1105
Conversation
020ea0e to
3cda1d4
Compare
|
Thanks a lot for adding this! 😃 And sorry that it took me so long to look at it! First of all, what do you mean by | return an ? I don't see how returning that would allow chaining as in the example? But in any case, what you did looks consistent, so thanks 🙂 Only thing I noticed is that for all the other methods we have a positive and negative form and I realized that there might be use cases where users want to combine this with a Independently of that, retrospectively I should have added something smarter like a generic |
|
Anyway, what do you think about the review changes in my commit? If everything looks good to you I'd squash everything into one commit... |
|
Hi, thank your for your feedback 😃
This is meant with regards to the initial suggestion in the issue from April '22. What I meant by this is that the arguments ( Apart from that: thank your for the review changes, they make a lot of sense :) So everything looks good to me 👍 |
Adds `FieldsShould.{be/notBe}AccessedByMethodsThat(predicate)` to the rules API.
Issue: TNG#857
Signed-off-by: Leonard Husmann <leonard.husmann@tum.de>
3cda1d4 to
890c3ce
Compare
|
Cool, then thanks a lot again, squashed, rebased and now merged 😃 |
This PR adds a method to the public API of
FieldsShouldto check if a field has been accessed by methods matching a given predicate. This is checked by a newArchCondition.I've diverged a little bit from the original suggestion of this issue: I chose to stay consistent with the current API and return an
ArchCondition<JavaField>to allow method chaining, e.g.What do you think? Any feedback is highly appreciated :)
Resolves: #857