Skip to content

Conversation

calumgrant
Copy link
Contributor

I have improved this query:

  • Detect lock sequences globally across method calls, not just locally.
  • Removed duplicate outputs - previously, both sequences were reported as violations which doubled the number of violations.
  • Reformatted QL.
  • Renamed the example files.
  • Rewritten the tests.
  • Added the samples to the tests.
  • Reformatted the output.

I initially tried reporting results for locks that were non-static fields, but there was no real way to be sure that the locks were the same instances in both cases, and it produced quite a lot of results that were quite suspicious but hard to defend.

The other problem I found was that there would often be very many pairs of lock statements for the same problem, resulting in many violations. So I changed the query so that the reported entity was the variable itself, and put the lock statements as inserts into the result.

@tom

@calumgrant calumgrant requested a review from a team as a code owner October 5, 2018 13:50
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good; I just have a few comments.

@hvitved hvitved merged commit 135271e into github:master Oct 22, 2018
aibaars pushed a commit that referenced this pull request Oct 14, 2021
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.

2 participants