dnrajugade / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Annotate ImmutableCollection as @Immutable #1218

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please annotate ImmutableCollection and subclasses as @Immutable (JSR305). 
Right now, Netbeans warns when a method returns a collection (thread safety 
concerns) because they have no way of knowing the collection is immutable.

Original issue reported on code.google.com by cow...@bbs.darktech.org on 30 Nov 2012 at 11:11

GoogleCodeExporter commented 9 years ago
Note that JSR 305 is officially explicitly abandoned and we have already a bit 
of a pickle in figuring out what to do about @Nullable.

Note also that the set of thread-safety annotations is woefully incomplete, and 
we remain hopeful that someone will pick up the ball to finish fleshing that 
out; we'll be very interested in adopting what they come up with.

Original comment by kevinb@google.com on 1 Dec 2012 at 6:46

GoogleCodeExporter commented 9 years ago
Do I take it Netbeans actually notices the @Immutable annotation?  
That's...interesting.

Original comment by wasserman.louis on 1 Dec 2012 at 6:54

GoogleCodeExporter commented 9 years ago
Louis,

Netbeans alredy scans for @Nullable (and issues warnings/hints accordingly). 
I've recently filed http://netbeans.org/bugzilla/show_bug.cgi?id=223085 asking 
for @Immutable/@ThreadSafe support.

Kevin,

JSR 305 is explicitly abandoned? Since when? Care to point me to a link? Last I 
read it was being considered for JDK 8.

Original comment by cow...@bbs.darktech.org on 1 Dec 2012 at 10:30

GoogleCodeExporter commented 9 years ago
I'm sorry I don't know what official pronouncement to point you too; this 
knowledge comes directly from recent conversations with Bill Pugh and Google's 
rep to the JSR.

Original comment by kevinb@google.com on 4 Dec 2012 at 4:54

GoogleCodeExporter commented 9 years ago
Ugh.

I asked Bill no less than two weeks ago which annotations I should be using and 
he happily told me to use JSR 305 annotations in place of Findbugs because the 
latter were being deprecated in favor of the more "standard" ones. Standard my 
left foot! :)

This leaves me (and I assume many others) in a very sticky situation. See: 
http://stackoverflow.com/questions/4963300/which-notnull-java-annotation-should-
i-use

If JSR 305 is out, what annotations should we be using? Does anyone know? Where 
should this question be asked? :) Someone, somewhere, should make an 
announcement.

Original comment by cow...@bbs.darktech.org on 4 Dec 2012 at 5:39

GoogleCodeExporter commented 9 years ago
It seems the JSR was voted into the "dormant" state: 
http://jcp.org/en/jsr/detail?id=305

I really have no idea what the path forward looks like right now.

Original comment by kevinb@google.com on 4 Dec 2012 at 7:44

GoogleCodeExporter commented 9 years ago
Okay. I posted a message to the mailing list. We'll see what replies we get: 
http://old.nabble.com/JSR305-is-dead--td34758918.html

Original comment by cow...@bbs.darktech.org on 4 Dec 2012 at 7:49

GoogleCodeExporter commented 9 years ago
Sorry, I posted the question in the wrong forum. Here is the updated link: 
http://old.nabble.com/Is-JSR305-dead--td34759199.html

Original comment by cow...@bbs.darktech.org on 4 Dec 2012 at 8:58

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 8 Apr 2013 at 7:01

GoogleCodeExporter commented 9 years ago
We need to be more consistent with @Immutable (either apply it everywhere or 
nowhere).

Greg wants to put together a CL and discuss it.

Original comment by kak@google.com on 22 Aug 2013 at 11:37

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:18

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08