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 77062 - [Use Supertype] Fields is not respected
Summary: [Use Supertype] Fields is not respected
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ bharathch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-30 10:50 UTC by Jiri Prox
Modified: 2007-04-03 18:02 UTC (History)
1 user (show)

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 Jiri Prox 2006-05-30 10:50:02 UTC
NetBeans IDE Dev (Build 200605281800)
1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03
Linux version 2.6.5-1.358 running on i386
en_US (nb); UTF-8

Usages of fields is not respected. 

Steps to reproduce:
1) have a two classes:
public class SuperClass {        
}

public class SubClass extends SuperClass{            
    int field;    
    public void method() {
        SubClass s = new SubClass();
        s.field = 3;
    }
}

2) call Use Supertype Where Possible for SubClass
-> s is retyped to SuperClass so s.field become invalid
Comment 1 _ bharathch 2006-06-26 13:51:10 UTC
Fixed. Usages of fields now considered while replacing type usages with that of
a  particular super type. A new unit test has also been added.

Files modified:
UseSuperTypeRefactoringPlugin.java
test/.../data.../NewClassFinal.pass
test/.../data.../NewClass.java
test/.../data.../NewClass1.java
test/unit/src/.../UseSuperTypeTest.java
Comment 2 Jiri Prox 2006-07-14 15:26:16 UTC
verified