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 197192 - Incorrect code generated when implementing methods with varargs
Summary: Incorrect code generated when implementing methods with varargs
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 13:36 UTC by tnleeuw
Modified: 2011-04-07 10:39 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 tnleeuw 2011-03-29 13:36:34 UTC
Product Version = NetBeans Platform Dev (Build 201103260400)
Operating System = Windows Vista version 6.0 running on x86
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) Client VM 19.1-b02

I have a class defined as follows:

public class A {

    private Object[] args;

    public A (Object... args) {
        this.args = args;
    }
}

Now I create a subclass B:

public class B extends A {
}

and I use the code-generator to create a constructor for me.

This constructor will be generated as follows:

public class B extends A {
    public B(Object[] args) {
        super(args);
    }
}

Syntactically this is correct, however, I would have expected the generated code to have a varargs argument, like the superclass, and not an array argument.
Comment 1 Dusan Balek 2011-04-04 15:53:48 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/f2c201cdede1
Comment 2 Quality Engineering 2011-04-05 08:40:01 UTC
Integrated into 'main-golden', will be available in build *201104050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f2c201cdede1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #197192: Incorrect code generated when implementing methods with varargs - fixed.
Comment 3 tnleeuw 2011-04-07 10:39:04 UTC
Problem fixed for me in build 201104050400.
Thanks.