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 ?
Asked
Active
Viewed 3.4k times
46
-
2No it is not part of the standard JDK - you need to import a dependency. – assylias Jul 06 '12 at 12:38
-
On [jcip.net](http://jcip.net), the jar link in "Concurrency annotations: jar, javadoc, source" at the bottom of the page. – assylias Jul 06 '12 at 12:40
-
http://jcip.net/jcip-annotations.jar – Marko Topolnik Jul 06 '12 at 12:42
-
1thanks for this info. How can I accept a comment as an answer -:)? @assylias since you were the first to provide the link would you write something so that i can accept ? – Inquisitive Jul 06 '12 at 12:44
2 Answers
29
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:
-
14These were standardized in JSR-305 (com.google.code.findbugs:jsr305:2.0.0) – Ben Manes Jul 07 '12 at 00:10
-
1The project's status is dormant. Do you know if there's any chance that it will be included at some stage? – assylias Jul 07 '12 at 07:14
-
4They may be bundled in JSR-308 which is still active. The jsr305 annotations were intended for documentation only, so they offer value even if the jsr is dorment. – Ben Manes Jul 07 '12 at 08:30
-
4I'm disappointed that these annotations aren't standard. I won't include a library in my project just for documentation. So I'll just include the guarding details in my javadoc. – Erick Robertson Apr 17 '14 at 12:37
0
You can add dependency from maven repository
"Java Concurrency In Practice" Book Annotations » 1.0

borino
- 1,720
- 1
- 16
- 24