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 201505220001) 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-b14 System: Windows 7 version 6.1 running on amd64; UTF-8; pl_PL (nb) Consider the following code: public class IfToCase { public boolean isAbc(String val) { if (val.equals("abc")) { return true; } else { return false; } } } There is a warning hint to convert to switch over strings, which is useless for a single condition. The description says: "Marks cascades of ifs which can be converted to switch over Strings" - but there is no cascade of ifs, it's a single if. The hint should be offered only when there are at least two conditions (or make it configurable at the Hints page).
Created attachment 153849 [details] Convert to switch hint
Fixed as jet-main#675772c51bd5
Integrated into 'main-silver', will be available in build *201506050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/675772c51bd5 User: Svata Dedic <sdedic@netbeans.org> Log: #252576: added minimum threshold for string-to-switch. Unified with if-to-switch hint
Verified with Build 201507240001.