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 187854

Summary: False positive for IncompatibleMask hint when using arrays
Product: java Reporter: bc73
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P4    
Version: 6.x   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:

Description bc73 2010-06-20 18:27:59 UTC
Product Version: NetBeans IDE 6.9 (Build 201006101454)
Java: 1.6.0_20; Java HotSpot(TM) 64-Bit Server VM 16.3-b01
System: Windows 7 version 6.1 running on amd64; Cp1252; en_GB (nb)

I'm getting false positives for the IncompatibleMask hint when using values in arrays. The following code demonstrates this:

public class Main {
    public static void main(String[] args) {
        byte[] a = {Byte.MAX_VALUE};
        // displays a hint that incorrectly says the expression is always false
        System.out.println((a[0] & 32) == 32);
        // if you copy the value out of the array then no hint is displayed
        byte b = a[0];
        System.out.println((b & 32) == 32);
    }
}

The first print statement causes hint that says "IncompatibleMask: (a[0] & 32) == 32 is always false". The second print statement causes no hint to be displayed. Both expressions evaluate to true.
Comment 1 Jan Lahoda 2010-06-28 06:44:16 UTC
Fix for this should be part of the NB6.9.1 release - please see bug #185010 for more details.

*** This bug has been marked as a duplicate of bug 185010 ***