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 201112250601) Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb) User directory: C:\Users\g.tzabari\.netbeans\dev Cache directory: C:\Users\g.tzabari\.netbeans\dev\var\cache 1. Given: void foo() { int value = 5; switch (value) { case 1: { System.out.println("1"); return; } case 2: { System.out.println("2"); break; } } } 2. A hint will pop up recommending the removal of the return statement, but in this particular case its removal causes case 1 to leak into case 2, which is not equivalent to the original logic. 3. Expected behavior: Suppress the hint for this condition.
reproducible
Thank you very much for the report, should be OK: http://hg.netbeans.org/jet-main/rev/dcdfeea082b8
Integrated into 'main-golden', will be available in build *201201080601* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/dcdfeea082b8 User: Jan Lahoda <jlahoda@netbeans.org> Log: #206787: more precise handling of returns in switch's cases in unnecessary return hint
verified in the trunk
releases71_fixes: http://hg.netbeans.org/releases/rev/5fca317aa749
Integrated into 'releases', will be available in build *201202072200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/5fca317aa749 User: Jan Lahoda <jlahoda@netbeans.org> Log: #206787: more precise handling of returns in switch's cases in unnecessary return hint (transplanted from dcdfeea082b85f164354189b1d232f13850d0f2c)
verified in patch1