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 244622 - Undefined arguments order in generated constructor
Summary: Undefined arguments order in generated constructor
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0.1
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-21 10:21 UTC by soldatov
Modified: 2014-06-05 14:59 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 soldatov 2014-05-21 10:21:20 UTC
Code:
class A {
public:
    A(int a) : a(a) {}
    int a;
};

class B : public A {
public:
    B(int b) : b(b) {}
    int b;
};

class C : public A {
public:
    C(int c) : c(c) {}
    int c;
};

class D : public B, public C {
public:
    // <-- generate constructor
    int d;
};

int main() {
    D d;
    return 0;
}

Scenario:
- Press Alt-Ins in class D
- Select "Constructor..." menu item
- Press Generate button
==> sometimes IDE generates "D(int c, int b) : C(c), B(b) {" line, in order cases IDE generates "D(int b, int c) : B(b), C(c) {"
Comment 1 soldatov 2014-05-21 10:25:15 UTC
I think if code contains "class A : public C, public B" declaration, then user or test expects "A(int c, int b) :  C(c), B(b)"
Comment 2 Alexander Simon 2014-05-21 10:47:55 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/05bc008420c6
Comment 3 Quality Engineering 2014-05-30 02:22:42 UTC
Integrated into 'main-silver', will be available in build *201405300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/05bc008420c6
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #244622 Undefined arguments order in generated constructor
Comment 4 Quality Engineering 2014-06-04 15:27:32 UTC
Integrated into 'releases/release80', will be available in build *201406041415* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/eaafd0711f47
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #244622 Undefined arguments order in generated constructor
(transplanted from 05bc008420c6bb746c2b3d201abc5e9a7fc06d04)
Comment 5 soldatov 2014-06-05 14:13:25 UTC
Fix doesn't resolve original scenario.
Comment 6 Alexander Simon 2014-06-05 14:59:40 UTC
(In reply to soldatov from comment #5)
> Fix doesn't resolve original scenario.
additional fix:
http://hg.netbeans.org/cnd-main/rev/080f19d97103