{"action":"created","issue":{"url":"https://api.github.com/repos/javax-inject/javax-inject/issues/9","repository_url":"https://api.github.com/repos/javax-inject/javax-inject","labels_url":"https://api.github.com/repos/javax-inject/javax-inject/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/javax-inject/javax-inject/issues/9/comments","events_url":"https://api.github.com/repos/javax-inject/javax-inject/issues/9/events","html_url":"https://github.com/javax-inject/javax-inject/issues/9","id":159691944,"number":9,"title":"Make value member of @Named optional","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},"labels":[{"url":"https://api.github.com/repos/javax-inject/javax-inject/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/javax-inject/javax-inject/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/javax-inject/javax-inject/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":3,"created_at":"2016-06-10T18:17:29Z","updated_at":"2016-06-10T18:17:48Z","closed_at":null,"body":"_From [gavin.k...@gmail.com](https://code.google.com/u/105743409453530897815/) on June 23, 2009 18:32:10_\n\nIf we really are going to keep @Named, at least we should make the value\r\nmember optional, since I don't want to see people having to write stuff like:\r\n\r\n   @Inject @Named(\"foo\") Foo foo;\r\n\r\nOr in 299:\r\n\r\n   @Named(\"foo\")\r\n   public class Foo { ... }\r\n\r\nJust like with the EE 5 style injection annotations, the name of the\r\nqualifier should be defaultable from the name of the field (or type), so\r\nthat we would get:\r\n\r\n   @Inject @Named Foo foo;\r\n\r\n   @Named\r\n   public class Foo { ... }\n\n_Original issue: http://code.google.com/p/atinject/issues/detail?id=9_"},"comment":{"url":"https://api.github.com/repos/javax-inject/javax-inject/issues/comments/225257133","html_url":"https://github.com/javax-inject/javax-inject/issues/9#issuecomment-225257133","issue_url":"https://api.github.com/repos/javax-inject/javax-inject/issues/9","id":225257133,"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":"2016-06-10T18:17:48Z","updated_at":"2016-06-10T18:17:48Z","body":"_From [crazybob...@gmail.com](https://code.google.com/u/114815478402472606661/) on June 24, 2009 14:34:03_\n\nStrictly speaking, you can provide default values for annotation attributes, but you\r\ncan't make them optional (i.e. you can't differentiate between not setting the value\r\nand explicitly setting the value to the default value). If we were to define a\r\ndefault value, I don't think we should try to specify how injectors should interpret\r\nthat value (we're short on time, and I can imagine interpreting it in different ways\r\nin different contexts). We would also want to pick a default value that doesn't\r\nconflict with a value a user would likely use (maybe \"\").\r\n\r\nThat said, I prefer not to do this. I don't want to encourage use of string\r\nidentifiers. I don't like the inconsistency of being able to look up field but not\r\nparameter names. I also think users would be better of using purpose-built\r\nannotations for this sort of thing. If a user is reading code with @Named in it and\r\nthey click through to read the docs on @Named, the docs won't help them much compared\r\nto docs on a more specific annotation type that could explain how the default name is\r\ncalculated and used in an expression language, for example. Of course, we could\r\nalways specify a default value later without breaking compatibility."}}
{"actor":{"display_login":"cgruber"}}