Inquisitive
Inquisitive

Reputation: 7856

@GuardedBy , @ThreadSafe ,@NotThreadSafe

I see that the above annotations are used extensively in the book JCIP . I think it is really useful because even in the absence of proper documentation it says some things about the synchronization policies . I also see that Intellij Idea makes use of these annotations Are they now actually part of the Java language itself ?

Upvotes: 47

Views: 35486

Answers (2)

borino
borino

Reputation: 1750

You can add dependency from maven repository

"Java Concurrency In Practice" Book Annotations » 1.0

jcip-annotations-1.0

Upvotes: 0

assylias
assylias

Reputation: 328737

These are custom annotations that are not part of the standard JDK. To be able to use them in your code, you need to add a dependency.

At jcip.net, there is a link to the library and its source in the bottom part of the page "Concurrency annotations: jar, javadoc, source".

Direct links:

Upvotes: 30

Related Questions