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.
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
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
verified