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 100305 - [Move Inner To Outer Level] Move Inner should return a warning related to name is used as a parameter name
Summary: [Move Inner To Outer Level] Move Inner should return a warning related to nam...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: vsitnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-08 00:42 UTC by kely_garcia
Modified: 2013-01-08 02:26 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
vsitnikov_12_09.patch (12.44 KB, text/plain)
2012-12-09 18:22 UTC, vsitnikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kely_garcia 2007-04-08 00:42:29 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Move Inner to Outer Level declaring field "a" for the outer class should 
return a warning: Name 'a' is used as a parameter name in one of the 
constructors of type 'Inner' when 'a' is used as a parameter name. 
Steps to reproduce: Move Inner class 'Inner' on the following:
class A{
	class Inner{
		Inner(int a){
		}
	}
}

yields the following refactored 'Inner' class:
class Inner{
    private final A a;

    Inner(A a, int a){
        this.a = a;
    }
}
Comment 1 Jan Becicka 2007-04-23 09:41:38 UTC
Move Inner To Outer Level not implemented in 6.0 so far.
Comment 2 Jan Becicka 2007-10-03 09:08:59 UTC
Lowering priority.
Comment 3 David Strupl 2009-03-31 15:56:14 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that
it should be implemented please reopen and set the target milestone to "next".
Comment 4 Quality Engineering 2009-11-02 11:15:00 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX
Comment 5 Jachym_Vojtek 2012-10-08 10:40:44 UTC
I found the same behaviour in a current version 7.2. Lets try the example reported 2007-04-08 00:42:29 UTC.

Applied refactoring "Move Inner to Outer Level" leads to a code that does not compile.
Comment 6 Jiri Prox 2012-10-08 12:40:02 UTC
reproducible
Comment 7 vsitnikov 2012-10-21 16:18:57 UTC
Can I netfix this bug?
Comment 8 Ralph Ruijs 2012-10-22 08:41:53 UTC
(In reply to comment #7)
> Can I netfix this bug?

Yes, would be great.
Comment 9 vsitnikov 2012-12-09 18:22:31 UTC
Created attachment 129111 [details]
vsitnikov_12_09.patch
Comment 10 vsitnikov 2012-12-28 16:17:37 UTC
Can someone take the time to review the patch?
Comment 11 Ralph Ruijs 2013-01-07 07:58:11 UTC
(In reply to comment #10)
> Can someone take the time to review the patch?

I looked at the patch and the fix is ok. Next time, please try to keep the patch small and only include changes which are necessary for your fix.

I will push your fix with some small changes and added test cases.


Thanks !
Comment 12 Ralph Ruijs 2013-01-07 08:00:51 UTC
http://hg.netbeans.org/jet-main/rev/ec24aa9a05c4
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2013-01-07 08:58
Comment 13 Quality Engineering 2013-01-08 02:26:58 UTC
Integrated into 'main-golden', will be available in build *201301080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ec24aa9a05c4
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #100305 - [Move Inner To Outer Level] Move Inner should return a warning related to name is used as a parameter name