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: |
"The assigned value is never used" after "if (true) return;" statement |
Product: |
java
|
Reporter: |
kris001 |
Component: |
Hints | Assignee: |
Svata Dedic <sdedic> |
Status: |
RESOLVED
WONTFIX
|
|
|
Severity: |
normal
|
|
|
Priority: |
P3
|
|
|
Version: |
8.0 | |
|
Hardware: |
PC | |
|
OS: |
Windows 7 | |
|
Issue Type:
|
DEFECT
|
Exception Reporter:
|
|
Bug Depends on: |
|
|
|
Bug Blocks: |
249320
|
|
|
Attachments: |
Screen shot
|
Created attachment 145648 [details] Screen shot Following an "if (true) return;" statement, all following assignments get "Unused Assignment" warnings rather than some sort of error about unreachable code This is not the case when there is a corresponding else, or the if condition is not trivial String test() { if (true) { return null; } String s = "foo"; return s; } String test2() { if (true) { return null; } else {} String s = "foo"; return s; } String test3() { if (1 == 1) { return null; } String s = "foo"; return s; }