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 223032 - Find usages: constructors usages are not properly found and marked in the source code
Summary: Find usages: constructors usages are not properly found and marked in the sou...
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: PC All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
: 220977 228290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-30 08:49 UTC by crimcat
Modified: 2016-10-31 10:13 UTC (History)
2 users (show)

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 crimcat 2012-11-30 08:49:51 UTC
Let's consider the following code;
------------------
class class_a {
public:
    explicit class_a(int a) : _a(a) { }
    class_a(int a, int b): _a(a), _b(b) { }
    class_a(int a, int b, int c) : _a(c), _b(b), _c(c) { }
    virtual ~class_a() { }
    
private:
    int _a;
    int _b;
    int _c;
};

class class_b: public class_a {
public:
    class_b(int a, int b, int c, int d, int e): class_a(a, b, c), _a(d), _b(e) { }
    explicit class_b(int a): class_a(a, 0, 0), _a(-1), _b(-1) { }
    class_b(int a, int c): class_a(a, c), _a(0), _b(0) { }
    virtual ~class_b() { }
    
private:
    int _a;
    int _b;
};
------------------
If I select any constructor of, say, class_a in the editor I see all usages of this constructor marked in the editor window. If I use 'Find Usages' from the right-click context menu - I would see the same result.
Now I select exactly the class name - so I navigate the cursor to the class_a name in the declaration of the class:
class class_a {
Then the editor highlights me all usages of this class name (identifier). And this is correct. But, when I select 'Find Usages' from the right-click context menu I have in the result list along with the all constructor calls in the initialization lists, which is wrong, because I did not search for a constructor usages.
And then just add implicit constructors below this code:
------------------
int
main(int argc, char** argv) {
    
    class_b b_obj1(1, 2, 3, 4, 5);
    class_b b_obj2(7);
    class_b b_obj3(0, 0);
    
    class_a a_obj1(100);
    class_a a_obj2(1, 2, 3);

    return 0;
}
------------------
These constructors are not highlighted in the editor if selected, and not present in the results of the 'Find Usages'. It seems also to be wrong.
Comment 1 Egor Ushakov 2013-08-02 15:09:18 UTC
*** Bug 228290 has been marked as a duplicate of this bug. ***
Comment 2 Egor Ushakov 2013-08-02 15:09:42 UTC
See more examples in the Bug 228290
Comment 3 Vladimir Voskresensky 2014-11-20 11:05:15 UTC
*** Bug 220977 has been marked as a duplicate of this bug. ***