Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 131873 - Add "change constructor" hint
Add "change constructor" hint
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Hints
6.x
All All
: P3 with 1 vote (vote)
: 7.4
Assigned To: Ralph Ruijs
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-02 21:56 UTC by fommil
Modified: 2013-05-22 11:06 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Missing changed constructor (40.42 KB, image/png)
2013-01-14 19:26 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fommil 2008-04-02 21:56:57 UTC
NetBeans 6.1 Beta.

Consider the following (contrived) code

public class MyClass {
    public MyClass(){
    }
    public MyClass foo(Object obj){
        return new MyClass(obj);
    }
}

Currently, the hinter will offer to create a MyClass(Object) constructor... however, it is most often more useful to be able to add the parameter to the 
current constructor... i.e. offer to change MyClass() into MyClass(Object obj).
Comment 1 Jan Becicka 2008-05-15 13:25:34 UTC
Max volunteered :)
Comment 2 markiewb 2013-01-14 19:26:58 UTC
Created attachment 130204 [details]
Missing changed constructor

For example:
<code>
public class Foo {
        int a, b;
        public Foo(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public void method() {
            new Foo(1, 2, 3);
        }
    }
</code>

ACTUAL: hint "create constructor Foo(int, int, int)"

EXPECTED: 
* add new hint "change constructor to Foo(int, int, int)"
* (and keep) hint "create constructor Foo(int, int, int)"

See attached screenshot
Comment 3 Ralph Ruijs 2013-02-20 15:58:53 UTC
Changeset: 0d6da87d8e68
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2013-02-20 16:56
Comment 4 Quality Engineering 2013-02-22 05:30:53 UTC
Integrated into 'main-golden', will be available in build *201302212300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0d6da87d8e68
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #131873 - Add "change constructor" hint


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo