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.0.2 (Build 201411181905) Operating System = Mac OS X version 10.9.5 running on x86_64 Java; VM; Vendor = 1.8.0_20 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.20-b23 Recently I updated NetBeans (updated some modules automatically), today I noticed it now show warning on all "instance of" conditions. For example: if (o instance of BigDecimal) { return (BigDecimal) o; } The warning (NetBeans hint) as below: Dead instanceof. Object cannot be assigned to BigDecimal ---- (Alt-Enter shows hints)
sorry, example code is: if (o instanceof BigDecimal) { return (BigDecimal) o; }
I can confirm this, using Netbeans 8.0.2 on Ubuntu Linux 14.04, using Oracle java 7, all x86_64. The hint is flagging instanceof statements where the instance under test is an Object, or at least is a Supertype of the class being tested.
I checked the github repository for the hints plugin: https://github.com/markiewb/nb-additional-hints, and found that this bug was already submitted (issue #50 on github) and fixed in versions 1.4.1.1 and 1.5 of the nb-additional-hints plugin. I updated the plugin to 1.5 and no longer see the false-positives.
According to comment #3, marking as fixed (in the 3rd party plugin)