Let's recognize that these annotations can give you a false sense of confidence, you still should read at least the docs and probably the code if you REALLY care about thread safety.
There will be mistakes in documentation where the wrong or contradictory annotation will split in and/or will be out of sync with Javadocs. At least that's what is likely to happen _over time_. IOW, its a nice idea but not a panacea for actual thread safety. The other issue is that if we are serious about this we are going to end up with the same annotations in all Commons packages. We could reuse javax.annotation.concurrent from JSR 305 as published in https://search.maven.org/#artifactdetails%7Ccom.google.code.findbugs%7Cjsr305%7C3.0.1%7Cjar (CLASS level retention). Gary On Sat, Nov 19, 2016 at 3:52 AM, Benedikt Ritter <brit...@apache.org> wrote: > Hi, > > after my presentation about Apache Commons, there where some comments about > [lang]. One person said, that it is hard to find out whether our classes > are threadsafe or not. He would like to see that better documented. > > I know that sebb has done some work in that direction, but as far as I know > the information about thread safety is currently only in Java comments. > > How can we improve our docs with regards to thread safety? I see several > ways: > - Custom annotations like @Immutable, @ThreadSafe, @NotThreadSafe > - Custom JavaDoc doclets > - Put the information right into the JavaDoc > > Anything else? > > Benedikt > -- E-Mail: garydgreg...@gmail.com | ggreg...@apache.org Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory