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 176217 - Introduce Parameter Refactoring
Summary: Introduce Parameter Refactoring
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on: 199106
Blocks:
  Show dependency tree
 
Reported: 2009-11-09 05:53 UTC by chandru_in
Modified: 2011-09-01 14:23 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chandru_in 2009-11-09 05:53:28 UTC
If a method contains a constant value hard-coded in it, it is very helpful to have a refactoring option to turn this into a parameter and make all invocations use the constant value by default.

Before Refactoring:

public class Sample {
    public void invoker1() {
        show();
    }
    public void invoker2() {
        show();
    }

    private void show() {
        System.out.println("Hello");
    }
}

After Refactoring:

public class Sample {
    public void invoker1() {
        show("Hello");
    }
    public void invoker2() {
        show("Hello");
    }

    private void show(String value) {
        System.out.println(value);
    }
}
Comment 1 Quality Engineering 2011-05-27 11:56:23 UTC
Integrated into 'main-golden', will be available in build *201105270401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ad501b78a7ad
User: Jan Becicka <jbecicka@netbeans.org>
Log: Introduce parameter initial prototype
- make final does not work correctly
- replace all occurrences does not work. Depends on hints/jackpot
Issue #176217 - Introduce Parameter Refactoring
Comment 2 Ralph Ruijs 2011-08-29 14:03:32 UTC
Changeset: fea0c60f1cf3
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2011-08-29 16:00
Message:   Issue #176217 - Introduce Parameter Refactoring
Comment 3 Quality Engineering 2011-09-01 14:23:01 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/fea0c60f1cf3
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #176217 - Introduce Parameter Refactoring