This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 223085 - Suppress "Return of Collection field" warning for com.google.common.collect.ImmutableCollection
Summary: Suppress "Return of Collection field" warning for com.google.common.collect.I...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-30 23:01 UTC by _ gtzabari
Modified: 2013-11-11 11:37 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2012-11-30 23:01:11 UTC
A method that returns com.google.common.collect.ImmutableCollection (or its subclasses) should not the "return of Collection field" warning since there is no thread-safety risk.
Comment 1 _ gtzabari 2012-11-30 23:03:28 UTC
Perhaps a better approach would be to convince the Guava project to mark up their classes using @Immutable (JSR305) and scan for that instead? Let me know what you think.
Comment 2 _ gtzabari 2012-11-30 23:05:23 UTC
There is also @ThreadSafe (Immutable implies thead-safe but I think you'd have to scan for both annotations separately).