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 269821 - Find Usages: class field initializers in ctor are treated as "read" instead of "write" access.
Summary: Find Usages: class field initializers in ctor are treated as "read" instead o...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-14 13:27 UTC by Vladimir Kvashin
Modified: 2017-04-26 18:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample code (1.37 KB, text/x-chdr)
2017-02-14 13:27 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2017-02-14 13:27:26 UTC
Created attachment 163630 [details]
Sample code

Consider the following code:

class TestClass {
    const char* value;
public:
    TestClass() : value(nullptr) { // this is WRITE access!
        cout << "Default ctor" << endl;
    };
    TestClass& operator=(const TestClass&& other) {
        value = strdup(other.value);
        cout << "Move " << value << endl;
        return *this;
    }
};

Try to find usages of value. All usages are found OK.
Switch "read" access (green button) off.
Usage in constructor initializer disappears.

But it is write access.
Comment 1 Alexander Simon 2017-03-22 17:20:36 UTC
fixed on enum, branch release82, changeset ad8717ba30e5
Comment 2 Quality Engineering 2017-04-02 02:37:29 UTC
Integrated into 'main-silver', will be available in build *201704020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a1f9e5cbde14
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #269821 Find Usages: class field initializers in ctor are treated as "read" instead of "write" access.
(transplanted from ad8717ba30e51cb01010ab7bb04b25ad9e10de1b)
Comment 3 ilia 2017-04-13 11:14:01 UTC
https://netbeans.org/bugzilla/show_bug.cgi?id=269821 Changesets:
    http://hg.netbeans.org/releases/rev/ad8717ba30e5 # fixed Bug #269821 Find Usages: class field initializers in ctor are treated as "read" instead of "write" access.
Comment 4 Alexander Pepin 2017-04-26 18:19:55 UTC
Verified in netbeans-8.2-20170424.