Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'VNA04-J. Ensure that calls to chained methods are atomic' detector with test cases #2986

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PatrikScully
Copy link
Contributor

Method chaining allows multiple method calls on the same object in a single statement by having methods return the this reference. This lets the next method call be made on the return value of the previous one. While individual methods can be atomic, the chain itself is not. Therefore, callers must ensure proper locking to guarantee the entire chain of invocations is atomic, as relying on independently atomic methods is not sufficient.

See https://wiki.sei.cmu.edu/confluence/display/java/VNA04-J.+Ensure+that+calls+to+chained+methods+are+atomic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant