Reputation: 21
How can I get the annotations javax.annotation.concurrent.ThreadSafe and GuardedBy to work?
I can't find the source code of an annotation processor for @ThreadSafe
and @GuardedBy
.
Upvotes: 0
Views: 2091
Reputation: 4952
The IntelliJ IDE also has inspections that look for violations of the @GuardedBy annotations.
Upvotes: 0
Reputation: 8137
The Lock Checker that is distributed with the Checker Framework is an annotation processor that does compile-time checking of the @GuardedBy
annotation. If the Lock Checker issues no warnings, you get a guarantee that your program never dereferences a value unless it is holding the appropriate locks.
Upvotes: 2