We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97a0b9f commit 4f1ad0fCopy full SHA for 4f1ad0f
java/ql/lib/semmle/code/java/Concurrency.qll
@@ -6,12 +6,16 @@ import semmle.code.java.frameworks.Mockito
6
7
/**
8
* A Java type representing a lock.
9
- * We identify a lock type as one that has both `lock` and `unlock` methods.
+ *
10
+ * We exclude types with a name ending in "Pool" as they typically manage a
11
+ * collection of resources and the `lock` and `unlock` methods typically only
12
+ * lock one resource at a time.
13
*/
14
class LockType extends RefType {
15
LockType() {
16
this.getAMethod().hasName("lock") and
- this.getAMethod().hasName("unlock")
17
+ this.getAMethod().hasName("unlock") and
18
+ not this.getName().matches("%Pool")
19
}
20
21
/** Gets a method that is locking this lock type. */
0 commit comments