fb-contrib icon indicating copy to clipboard operation
fb-contrib copied to clipboard

FCD_FIND_CIRCULAR_DEPENDENCY should treat access to inner classes / interfaces as access to the parent

Open jsotuyod opened this issue 8 years ago • 1 comments

Doing something such as:

public class A {
  public interface Foo {
    void doSomething();
  }

  private B bar;

  public void m() {
    bar.setFoo(new Foo() {
      @Override
      void doSomething() {
      }
    });
  }
}
public class B {
  public void setFoo(A.Foo foo) {
  }
}

Here, A knows of B, B knows of A.Foo. This is not currenty being reported, but I beleive Foo should be promoted to a non-inner interface, so that B can trully know nothing of A.

jsotuyod avatar Sep 05 '16 20:09 jsotuyod

seems reasonable

mebigfatguy avatar Sep 05 '16 23:09 mebigfatguy