google / google/error-prone

GuardedBy properly supporting ReadWriteLock's exclusive/shared levels

Open
#1,370 0 comments 7 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

### Description of the feature request:

It would be nice if Error Prone supported specification of the desired level of locking (read or write) for ReadWriteLocks e. g. by adding `level` parameter to `@GuardedBy`:

```java
@GuardedBy(value = "lock", level = LockingLevel.WRITE)
void myMethod() { ... }
```

### Feature requests: what underlying problem are you trying to solve with this feature?

https://github.com/google/error-prone/blob/f14fb18bb05c7e9f10794771df692a42b333f18c/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByChecker.java#L99-L102

This feature request is already expressed in a TODO in Error Prone's code itself. The point of this issue then is to identify that other people are interested in this feature and make it more easily discoverable in the repository.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.