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.
Product Version: NetBeans IDE Dev (Build 201507170001) Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b15 System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb) Steps to reproduce: 1. Create a dialog. 2. Add the following constant: private static String[] ITEMS = {"AA", "BB", "CC"}; 3. Add a combo with a custom code: jComboBox1.setModel(new DefaultComboBoxModel(ITEMS)); Expected: no warnings on ITEMS. Actual: the warning "The array is only written to, never read from".
Created attachment 154704 [details] Sample project
I see ... the hint needs to be reimplemented; it uses the tree kind matcher to identify reads - but the matcher purposely skips guarded code... so write is found (field initializer is not in the guarded section), but the read is not passed from the infrastructure to the hint :)
Fixed in jet-main#ee478d3d4ad8
Integrated into 'main-silver', will be available in build *201508050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ee478d3d4ad8 User: Svata Dedic <sdedic@netbeans.org> Log: #253553: hint scans reads in guarded blocks