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 8.1 (Build 201510222201) Operating System = Windows 10 version 10.0 running on amd64 Java; VM; Vendor = 1.8.0_65 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.65-b01 Reproducibility: Happens every time In the following code the editor announced that the array count is only written to but never read from. However it is read four lines later in the condition of the if statement public RupStream<T> limit(long maxSize) { final long[] count = {0}; //Variable wrapped into constant Supplier<Optional<T>> outputGenerator = () -> { Optional<T> oInput = generator.get(); if (! oInput.isPresent() || (++count[0] > maxSize)) { return Optional.empty(); } return oInput; }; RupStream<T> output = new RupStream<>(outputGenerator); return output; }
reproducible reduced code: public void test() { final long[] count = {0}; if(++count[0] ==1 ) { } }
Fixed in jet-main#729b9b4e387e
Integrated into 'main-silver', will be available in build *201608110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/729b9b4e387e User: Svata Dedic <sdedic@netbeans.org> Log: #257008: inc/dec operators are treated as read+write