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

AutoFactory does not handle varargs parameters #326

Closed
zstewar1 opened this issue Apr 27, 2016 · 1 comment · Fixed by #371
Closed

AutoFactory does not handle varargs parameters #326

zstewar1 opened this issue Apr 27, 2016 · 1 comment · Fixed by #371

Comments

@zstewar1
Copy link

I'm trying to convert an existing type to be partially injected using autofactory, but our existing constructors and client code makes use of varargs to pass in differing numbers of arguments.

For example:

@AutoFactory
class MyClass {
    public MyClass(@Provided InjectedParameter ip, RepeatedParameter... rp) {
        // ...
    }
}

However the signature of the corresponding create method is: MyClassFactory.create(RepeatedParameter[] rp) which rather defeats the point.

It's possible to work around this by changing the signature to accept a List<RepeatedParameter> and using Arrays.asList(), but it would be better if AutoFactory just supported varargs parameters directly.

@gk5885
Copy link
Contributor

gk5885 commented Apr 28, 2016

Yeah, that sounds totally reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants