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: | hint "break outside of switch or loop" doesn't work for labeled breaks | ||
---|---|---|---|
Product: | java | Reporter: | almson |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Windows 8 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
almson
2013-08-17 11:51:47 UTC
To my surprise, breaking to a non-loop/switch label is perfectly valid as per the Java Language Specification (JLS 14.15). So not showing a compile-time error is absolutely correct. Showing a warning might be reasonable (mostly because such break can be considered to be a code smell), but does not qualify as a defect, IMO. Oh I see. It does work. It's a very limited form of goto. I don't think a warning is necessary for this (I'm not one of those goto zealots). Your call. |