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
Summary: Suppress "Return of Collection field" warning for
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
Depends on:
Reported: 2012-11-30 23:01 UTC by _ gtzabari
Modified: 2013-11-11 11:37 UTC (History)
0 users

See Also:
Exception Reporter:


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