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 142536 - [Extract Superclass] Generates broken code in derived class
Summary: [Extract Superclass] Generates broken code in derived class
Status: RESOLVED DUPLICATE of bug 142199
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 08:39 UTC by giorgio42
Modified: 2008-08-01 11:01 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 giorgio42 2008-08-01 08:39:55 UTC
NB200807300201, latest JDK, XP, standard Java SE project.

After Extract Superclass refactoring my derived class looks like this:

public class TestDataFeed
        extends DataFeedTestBaseDataFeedTestBase {

while the extracted base class is correctly named DataFeedTestBase.

I previewed the refactoring, before executing it.

Georg
Comment 1 Jan Pokorsky 2008-08-01 10:15:05 UTC
I will look at it. Most likely some bug of source generator.
Comment 2 giorgio42 2008-08-01 10:35:04 UTC
I did an additional refactoring in the base class (extract method) and the extracted method has this as a return statement:

...
    returnreturn valuesvalues;
}

Moreover I was under the impression that the method was generated two times, with 3 or 4 lines in the first part and the
remaining lines in the second incarnation with the broken return statement.

I am under the impression that refactoring is currently not able to identify the code sections to move around correctly
(and therefore is totally broken) and no P1 and P2 issues exist?

I should mention that this is a JUnit test located in the test packages of the J2SE project.

Georg
Comment 3 Jiri Prox 2008-08-01 10:46:45 UTC
Did you used continual build of build from bits.netbeans.org? 
It looks like issue 142199 which should be fixed now in current trunk build, but the fix is not propagated to builds on
bits.netbeans.org yet.
Comment 4 Jan Pokorsky 2008-08-01 11:01:19 UTC
It will be that case. There has been no change in the extract refactoring recently. I cannot reproduce with

Product Version: NetBeans IDE Dev (Build 20080801)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)


*** This issue has been marked as a duplicate of 142199 ***