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 - False positive for IncompatibleMask hint when using arrays
Summary: False positive for IncompatibleMask hint when using arrays
Status: RESOLVED DUPLICATE of bug 185010
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P4 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-20 18:27 UTC by bc73
Modified: 2010-06-28 06:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***