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.
Link: http://services.netbeans.org/synergy/client/app/#/case/4989/suite/1691 Product Version: NetBeans IDE Dev (Build 201507240001) Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16 System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb) public class _EqualsOnIncompatibleTypes { public void test() { char[] array1 = {'a', 'b', 'c'}; int[] array2 = {1, 2}; if (array1.equals(array2)) { //HINT: .equals on Incompatible Types } } } There is no expected hint in this case. There's only a hint ".equals() called on array". The hint works however for example on the following test case: public void test() { Integer integer = 10; Character character = 'a'; if (integer.equals(character)) { } }
BTW: why some of the test cases' files start with an underscore, and some start with lowercase letter? Does it mean something?
if (array1.equals(array2)) does not equal incompatible types, but rather two arrays. Here, equals is misleading, since array object does not define hashCode() or equals(), so array1.equals(array2) <=> array1 == array2.
(In reply to cezariusz from comment #1) > BTW: why some of the test cases' files start with an underscore, and some > start with lowercase letter? Does it mean something? The name of class should match the name of the hint. Only the leading '.' is replaced by '_'
I've fixed the sample file, thanks for providing the correct code