Bug 41464 - "extract interface" could change more references
Summary: "extract interface" could change more references
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-13 05:29 EDT by Ilja Preuss CLA
Modified: 2015-02-10 08:51 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilja Preuss CLA 2003-08-13 05:29:48 EDT
Given a class Foo

public class Foo {
  public void foo() {
  }
}

and a class Bar which uses Foo

public class Bar {

  private Foo foo;
  
  public Foo getFoo() {
    return foo;
  }

  public void setFoo(Foo foo) {
    this.foo = foo;
  }

  public void useFoo() {
    foo.foo();
  }
}

if you extract an interface IFoo for Foo, containing the foo() method and 
checking "change references...", only the return type of getFoo() in Bar gets 
changed, though the type of the whole field could be changed to the interface.

This severely limits the usefulness of the refactoring.
Comment 1 Adam Kiezun CLA 2003-08-13 07:10:57 EDT
this works fine in the latest
will add regression tests
Comment 2 Adam Kiezun CLA 2003-08-13 07:24:48 EDT
tests added