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.
Summary: | Converting enhanced-for to forEach via "use functional operations" hint is incorrect | ||
---|---|---|---|
Product: | java | Reporter: | jbosboom <jbosboom> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | Windows 8.1 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
jbosboom
2015-12-13 21:04:23 UTC
Increasing priority; such transformation may create hard to spot bugs - ideally surfacing with some new JDK version or fancy collection which really cares about stream performance. I am tempted, ;) for your this very case, to change NB's behaviour to rewrite to collection.forEach(target::add) ... which will rule out streams altogether but that obviously does not solve the more complicated ones. I've fixed this issue. After a LOT of thinking I just changed forEach into forEachOrdered without adding much of logic and filed an issue #262189, which seems to take a LOT of time to fix. I fixed just some little but annoing bugs this time. Committed as jet-main#035ef8f5311b Integrated into 'main-silver', will be available in build *201605250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/035ef8f5311b User: Svata Dedic <sdedic@netbeans.org> Log: #257129: use forEachOrdered to maintain iteration order; fixed linearization when a statement follows a nested block. |