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 196658 - Refactor Introduce method does not work properly
Summary: Refactor Introduce method does not work properly
Status: RESOLVED DUPLICATE of bug 114371
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL: http://wiki.netbeans.org/TS_60_Refact...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 08:52 UTC by ttokoly
Modified: 2011-04-11 12:00 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 ttokoly 2011-03-14 08:52:53 UTC
Product Version: NetBeans IDE Dev (Build 201103130400)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Linux version 2.6.32-29-generic running on i386; UTF-8; en_US (nb)

1. Unzip a project Refactoring to some work directory - there is link:
http://wiki.netbeans.org/wiki/images/0/0e/Refactoring_TS_60_Refactoring2.zip
2. Start IDE with a clean userdir
3. Invoke File | Open Project... action
4. Select unzipped project Refactoring
5. Scanning structure of project should be performed (It takes a while)

6. Open file packageA.ClassA
7. Select the code form mark //4 to //5
8. Call Refactor -> Introduce Method
9. Enter any name and confirm dialog 

According to the Refactoring TS ( http://wiki.netbeans.org/TS_60_Refactoring2 -> Method with return statement 2 ) expected result is that the new method with two parameters is created. One of the parameters is final the second is ordinary (not final). The method contains return statement. At the original place there is assignment of method's result to a single variable.

But there shows up method with only one parameter. Return statement is correct. Instead of second parameter there is created new variable witch is declared but no initialized, so error "variable c might not have been initialized" shows on return statement. Assignment of method's result at original place is correct.
Comment 1 Jan Becicka 2011-03-14 09:25:51 UTC
implemented as hint
Comment 2 Jan Lahoda 2011-04-11 12:00:56 UTC

*** This bug has been marked as a duplicate of bug 114371 ***