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.

Bug 238150 - "The assigned value is never used" in switch
Summary: "The assigned value is never used" in switch
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 249320
  Show dependency tree
 
Reported: 2013-11-08 11:43 UTC by zimi
Modified: 2015-11-11 07:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
hint bug in IDE (24.67 KB, image/png)
2013-11-08 11:43 UTC, zimi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zimi 2013-11-08 11:43:24 UTC
Created attachment 141980 [details]
hint bug in IDE

I believe this bug is well documented by screen ;)

parsedValue is returned from method as we can see (breakpoint on return) so hint is incorrect in this situation
Comment 1 Jiri Prox 2013-11-08 13:26:39 UTC
reproducible
Comment 2 Jiri Prox 2013-11-08 13:28:03 UTC
Here is code sample to copy into the editor:

 public Object get(String input, char c) {
        Object parsed = null;
        if (input != null) {
            switch (c) {
                case 'a':
                    parsed = Integer.parseInt(input);
                    break;
                default:
                    throw new RuntimeException();
            }
        }
        return parsed;
    }
Comment 3 Svata Dedic 2015-09-10 14:29:36 UTC
Not a deficiency of the algorithm / approach
Comment 4 Svata Dedic 2015-11-11 07:44:05 UTC
Fixed in experimental impl; wait for the umbrella issue to close.