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 8.1 (Build 201510222201) Operating System = Windows 10 version 10.0 running on amd64 Java; VM; Vendor = 1.8.0_72 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.72-b15 Reproducibility: Happens every time STEPS: * Open dialog Foo * Click on button "Click me" ACTUAL: nothing happens EXPECTED: message pops up Assume an enumeration public enumeration testEnum{ ONE, TWO, THREE; } Assume a method in some class public String toString(testEnum t) { String s; if (t == testEnum.ONE) { s = "1"; } else if (t == testEnum.TWO) { s = "2"; } else { s = "3"; } return "number is " + s; } On the first if statement a hint is given "replace chain of ifs with switch". Applying this hint will give: public String toString(testEnum t) { String s; if (null != t) switch (t) { case ONE: s = "1"; case TWO: s = "2"; default: s = "3"; } return "number is " + s; } First of all now suddenly an error appears in the code because s might not have been initialized. Apart from that, why is there a need for the additional null != t check, because whenever in the initial code t would be null on entry of the toString function the default switch case/label would have been applied or am I wrong?
Will be fixed by jet-main#92ded844705a
Correction: the fix changeset is: jet-main#aa6dec4f79fe
Integrated into 'main-silver', will be available in build *201605070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/92ded844705a User: Svata Dedic <sdedic@netbeans.org> Log: #259071: Do not produce any fixes if thrown exceptions are not subclass of caught ones (errorenous sources))