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.
In the attached example, a String array is returned and it's elements are stored in two class members. The hint message is "The array is only written to, never read from" which is obviously wrong. However, if you store array elements in local variables instead of class members, the hint turns to "The array is only read from, never written to" which is correct. Product Version: NetBeans IDE Dev (Build 201204100400) Java: 1.6.0_31; Java HotSpot(TM) Client VM 20.6-b01 System: Windows XP version 5.1 running on x86; Cp1252; fr_FR (nb)
Created attachment 118329 [details] Exemple class (do not execute, just compile)
Fixed in NetBeans daily builds: http://hg.netbeans.org/jet-main/rev/deb6b75f9030 Thanks for the report.
*** Bug 211589 has been marked as a duplicate of this bug. ***
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/deb6b75f9030 User: Jan Lahoda <jlahoda@netbeans.org> Log: #211248: fixing handling of variable initializer in the Unbalaced array access hint: all should be considered to be writes, except plain array creation. Also correcting reads from arrays inside assignment-like trees.