Reputation: 56934
Recently read up on JCIP annotations and they seem cool. Went to the website and took a look at the source. The only problem is that the src jar just contains the annotations...I'm not seeing where I can find the annotation processors that actually do anything! Am I just looking in the wrong place, or are these not real Java annotations (meaning, is there no way to enforce @Immutable
when it is used to mark a class)?
@Immutable
@GuardedBy
Upvotes: 11
Views: 2556
Reputation: 4952
The IntelliJ IDE will use these annotations to look for bugs in your code. If you annotate a variable is @GuardedBy(some_lock), the IDE will flag cases where you access it without properly synchronizing on it. This is very useful.
Upvotes: 4
Reputation: 16510
The JCIP annotations are a formal way to document a concurrency contract such as this member is "@GuardedBy" this field.
They don't do anything functionally in your code.
Upvotes: 1
Reputation: 692023
FindBugs supports those annotations. The support for those annotations and others is described in this documentation page.
Upvotes: 11