Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support overriding factory methods that come from generic superclasses/interfaces. #54

Open
svas57 opened this issue Nov 22, 2013 · 1 comment
Labels
Component: factory P3 type=defect Bug, not working as expected

Comments

@svas57
Copy link

svas57 commented Nov 22, 2013

When a factory method is inherited from a generic class/interface, generated auto factory will use type parameter name (e.g. T) rather than the substituted type. For example, given this code:

class MyClass {

  @AutoFactory(implementing = MyFactory.class)
  MyClass(@Provided String s, Integer i) {}

  interface MyFactory
      extends GenericFactory<MyClass, Integer> {}

  interface GenericFactory<T,S> {
    T make(S arg);
  }
}

Generated factory will contain this method

    public MyClass make(S arg) {
      return create(arg);
    }
@gk5885
Copy link
Contributor

gk5885 commented Nov 22, 2013

Yeah, that's definitely a bug. Good catch.

@raghsriniv raghsriniv added the P3 label Jun 24, 2019
@kluever kluever added the type=defect Bug, not working as expected label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: factory P3 type=defect Bug, not working as expected
Projects
None yet
Development

No branches or pull requests

5 participants