{"action":"created","issue":{"url":"https://api.github.com/repos/google/auto/issues/245","labels_url":"https://api.github.com/repos/google/auto/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/google/auto/issues/245/comments","events_url":"https://api.github.com/repos/google/auto/issues/245/events","html_url":"https://github.com/google/auto/issues/245","id":81019110,"number":245,"title":"AutoFactory doesn't support more than one qualifier annotation on parameters","user":{"login":"arend-von-reinersdorff","id":4946561,"avatar_url":"https://avatars.githubusercontent.com/u/4946561?v=3","gravatar_id":"","url":"https://api.github.com/users/arend-von-reinersdorff","html_url":"https://github.com/arend-von-reinersdorff","followers_url":"https://api.github.com/users/arend-von-reinersdorff/followers","following_url":"https://api.github.com/users/arend-von-reinersdorff/following{/other_user}","gists_url":"https://api.github.com/users/arend-von-reinersdorff/gists{/gist_id}","starred_url":"https://api.github.com/users/arend-von-reinersdorff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arend-von-reinersdorff/subscriptions","organizations_url":"https://api.github.com/users/arend-von-reinersdorff/orgs","repos_url":"https://api.github.com/users/arend-von-reinersdorff/repos","events_url":"https://api.github.com/users/arend-von-reinersdorff/events{/privacy}","received_events_url":"https://api.github.com/users/arend-von-reinersdorff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-26T15:43:11Z","updated_at":"2015-05-27T00:14:42Z","closed_at":null,"body":"I think this is a low priority issue. I haven't seen actual use of more than one qualifier annotation.\r\n\r\nFor example:\r\n\r\n    @Qualifier\r\n    @Retention(RUNTIME)\r\n    @Target(PARAMETER)\r\n    @interface Configured {\r\n    }\r\n\r\n    @AutoFactory\r\n    final class SomeClass {\r\n        private final String providedDepA;\r\n    \r\n        SomeClass(@Provided @Configured @Named String providedDepA) {\r\n            this.providedDepA = providedDepA;\r\n        }\r\n    }\r\n\r\nGenerated Autofactory is missing the @Named qualifier:\r\n\r\n    @Generated(\"com.google.auto.factory.processor.AutoFactoryProcessor\")\r\n    final class SomeClassFactory {\r\n      private final Provider<String> providedDepAProvider;\r\n      @Inject\r\n      SomeClassFactory(@Configured Provider<String> providedDepAProvider) {\r\n        this.providedDepAProvider = providedDepAProvider;\r\n      }\r\n      SomeClass create() {\r\n        return new SomeClass(providedDepAProvider.get());\r\n      }\r\n    }"},"comment":{"url":"https://api.github.com/repos/google/auto/issues/comments/105702074","html_url":"https://github.com/google/auto/issues/245#issuecomment-105702074","issue_url":"https://api.github.com/repos/google/auto/issues/245","id":105702074,"user":{"login":"cgruber","id":331234,"avatar_url":"https://avatars.githubusercontent.com/u/331234?v=3","gravatar_id":"","url":"https://api.github.com/users/cgruber","html_url":"https://github.com/cgruber","followers_url":"https://api.github.com/users/cgruber/followers","following_url":"https://api.github.com/users/cgruber/following{/other_user}","gists_url":"https://api.github.com/users/cgruber/gists{/gist_id}","starred_url":"https://api.github.com/users/cgruber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgruber/subscriptions","organizations_url":"https://api.github.com/users/cgruber/orgs","repos_url":"https://api.github.com/users/cgruber/repos","events_url":"https://api.github.com/users/cgruber/events{/privacy}","received_events_url":"https://api.github.com/users/cgruber/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T00:14:41Z","updated_at":"2015-05-27T00:14:41Z","body":"As to should vs. must in the javadoc, you are parsing language in a way the\nspec authors did not intend.  \"should not\" in the case of multiple\nqualifiers is synonymous with must not. A soft recommendation as you are\ninterpreting is not really relevant to a specification like this, and the\nfact that the CDI spec leads would like JSR-330 to update to include\nlanguage that supports it tells me that even they acknowledge that it is\nnot supported in 330.\n\nOn Tue, 26 May 2015 at 17:12 Christian Gruber <cgruber@google.com> wrote:\n\n> Most importantly, the JSR-330 doesn't support multiple qualifier\n> annotations. Don't know about spring, but CDI does. However, CDI actually\n> breaks compatibility with JSR-330 in this context, and this is a point of\n> conflict between the two specifications.  If you're using multiple\n> qualifiers you are not, per the spec, compatible with JSR-330.  That was a\n> choice of the CDI spec leads and we can't really do much about it, though\n> there is some discussion about this matter in a thread about a future\n> revision to JSR-330.  I doubt multiple qualifiers will become a thing,\n> however.  The semantics are fraught and confusing, and most JSR-330\n> implementing teams seem pretty down on the idea.\n>\n> On Tue, 26 May 2015 at 11:51 Arend v. Reinersdorff <\n> notifications@github.com> wrote:\n>\n>> @tbroyer <https://github.com/tbroyer> thanks for pointing that out :-) I\n>> didn't know that.\n>>\n>> Also, I agree that reporting an error would be better than silently\n>> dropping annotations.\n>>\n>> However,\n>>\n>>    - The Javadoc for @Inject <https://github.com/Inject> says *should\n>>    not*, not *must not*. So multiple qualifiers are discouraged but not\n>>    forbidden\n>>\n>>  no more than one qualifier *should* annotate a single field or parameter\n>> http://docs.oracle.com/javaee/7/api/javax/inject/Inject.html\n>>\n>>\n>>    -\n>>\n>>    Also some dependency injection frameworks support multiple qualifiers\n>>     - CDI supports multiple qualifiers\n>>\n>>    An injection point may even specify multiple qualifiers.\n>>    http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#qualifiers\n>>\n>>     - I believe, Spring also supports multiple qualifiers. But I didn't\n>>       find documentation for it.\n>>\n>> On the other hand, other frameworks don't support multiple qualifiers\n>>\n>>    - As you said, Dagger doesn't support multiple qualifiers.\n>>\n>>  Dependencies may not have multiple qualifier annotations.\n>> http://square.github.io/dagger/\n>>\n>>\n>>    - Guice doesn't support multiple qualifiers either\n>>\n>>  Only one such annotation may apply to a single injection point\n>>\n>> http://google.github.io/guice/api-docs/latest/javadoc/com/google/inject/BindingAnnotation.html\n>>\n>> As there's so little support for multiple qualifiers, I guess support in\n>> AutoFactory is very low priority.\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> <https://github.com/google/auto/issues/245#issuecomment-105632862>.\n>>\n>\n"}}