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 188099 - Zero constant in array index is wrongly recognized as Zero constant
Summary: Zero constant in array index is wrongly recognized as Zero constant
Status: RESOLVED DUPLICATE of bug 185010
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-25 17:20 UTC by albert_kurucz
Modified: 2010-06-29 11:23 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 albert_kurucz 2010-06-25 17:20:47 UTC
Example code:

    int intValue(byte[] a) {
        return (0xff & a[0]) + (0xff & a[1]) << 8;
    }


The part "0xff & a[0]" is underlined in Netbeans 6.9 editor as "Pointless bitwise expression".

Clicking on the hint bulb shows: "Zero constant should be removed"

After accepting the hint, the code shows:

    int intValue(byte[] a) {
        return (0xff) + (0xff & a[1]) << 8;
    }


This is wrong!
Comment 1 Jan Lahoda 2010-06-29 11:23:38 UTC
Has been fixed as bug #185010, should be part of NB6.9.1. Thanks for the report.

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