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.
in the example below public void castTest() { int i = 12312, k = 313; System.out.println("=" + ((float) i / (float) k)); System.out.println("=" + (i / k)); } --> 95321 1006 Removing the (float) cast as proposed by the hint leads to a different behavior of the code. This hint is therefore wrong on such cases.
I have attempted to suppress the 'remove cast' hint+fix for right operand of a binary op, if a) the reundant cast is reported for the left operand, and b) both casts are the same. This does not cover all situations, but should be sufficient for many situations Implemented in jet-main#a8dca55b66bd
Integrated into 'main-silver', will be available in build *201509170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/80875e9b41f1 User: Svata Dedic <sdedic@netbeans.org> Log: #247099: only one of two casts in a binary op is suggested for removal