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

Summary: Suppress "Return of Collection field" warning for com.google.common.collect.ImmutableCollection
Product: java Reporter: _ gtzabari <gtzabari>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

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).