{"action":"created","issue":{"url":"https://api.github.com/repos/decebals/pippo/issues/241","labels_url":"https://api.github.com/repos/decebals/pippo/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/decebals/pippo/issues/241/comments","events_url":"https://api.github.com/repos/decebals/pippo/issues/241/events","html_url":"https://github.com/decebals/pippo/pull/241","id":129526182,"number":241,"title":"Transparently support Java 8 -parameters names for controllers","user":{"login":"gitblit","id":868217,"avatar_url":"https://avatars.githubusercontent.com/u/868217?v=3","gravatar_id":"","url":"https://api.github.com/users/gitblit","html_url":"https://github.com/gitblit","followers_url":"https://api.github.com/users/gitblit/followers","following_url":"https://api.github.com/users/gitblit/following{/other_user}","gists_url":"https://api.github.com/users/gitblit/gists{/gist_id}","starred_url":"https://api.github.com/users/gitblit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitblit/subscriptions","organizations_url":"https://api.github.com/users/gitblit/orgs","repos_url":"https://api.github.com/users/gitblit/repos","events_url":"https://api.github.com/users/gitblit/events{/privacy}","received_events_url":"https://api.github.com/users/gitblit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-28T17:55:56Z","updated_at":"2016-01-28T18:20:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/decebals/pippo/pulls/241","html_url":"https://github.com/decebals/pippo/pull/241","diff_url":"https://github.com/decebals/pippo/pull/241.diff","patch_url":"https://github.com/decebals/pippo/pull/241.patch"},"body":"We've discussed this a couple times.  Now that we are on Java 8 this is a no-brainer.\r\n\r\nThis change allows you to define a controller method like this:\r\n\r\n```java\r\npublic class ContactsController extends Controller {\r\n    public void uriFor(int id) {\r\n    }\r\n}\r\n```\r\n\r\ninstead of like this:\r\n\r\n```java\r\npublic class ContactsController extends Controller {\r\n    public void uriFor(@Param(\"id\") int id) {\r\n    }\r\n}\r\n```\r\n\r\nOf course, to have the name automatically embedded in your code **requires** modifying your project compiler flags to specify `-parameters` to javac.  Your IDE needs this specified also, separately AFAICT.\r\n\r\n```xml\r\n<plugin>\r\n    <groupId>org.apache.maven.plugins</groupId>\r\n    <artifactId>maven-compiler-plugin</artifactId>\r\n    <version>3.1</version>\r\n    <configuration>\r\n        <source>1.8</source>\r\n        <target>1.8</target>\r\n        <compilerArguments>\r\n            <parameters/>\r\n        </compilerArguments>\r\n    </configuration>\r\n</plugin>\r\n```\r\n\r\nIf you do not compile with this flag then `isNamePresent` will return false and the method will return `null`, just like before.  Which means this change works transparently."},"comment":{"url":"https://api.github.com/repos/decebals/pippo/issues/comments/176319269","html_url":"https://github.com/decebals/pippo/pull/241#issuecomment-176319269","issue_url":"https://api.github.com/repos/decebals/pippo/issues/241","id":176319269,"user":{"login":"decebals","id":1248311,"avatar_url":"https://avatars.githubusercontent.com/u/1248311?v=3","gravatar_id":"","url":"https://api.github.com/users/decebals","html_url":"https://github.com/decebals","followers_url":"https://api.github.com/users/decebals/followers","following_url":"https://api.github.com/users/decebals/following{/other_user}","gists_url":"https://api.github.com/users/decebals/gists{/gist_id}","starred_url":"https://api.github.com/users/decebals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decebals/subscriptions","organizations_url":"https://api.github.com/users/decebals/orgs","repos_url":"https://api.github.com/users/decebals/repos","events_url":"https://api.github.com/users/decebals/events{/privacy}","received_events_url":"https://api.github.com/users/decebals/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T18:20:24Z","updated_at":"2016-01-28T18:20:24Z","body":"For me it's an improvement to eliminate the value field from `@Param`.\r\n\r\nFor example this code:\r\n```java\r\npublic class ContactsController extends Controller {\r\n    public void uriFor(@Param(\"id\") int id) {\r\n    }\r\n}\r\n```\r\n\r\nis a little simple/clean in this form:\r\n```java\r\npublic class ContactsController extends Controller {\r\n    public void uriFor(@Param int id) {\r\n    }\r\n}\r\n```\r\n\r\nDo you say that I can eliminate the `@Param` annotation entirely? \r\nSo\r\n```java\r\npublic class ContactsController extends Controller {\r\n    public void uriFor(int id) {\r\n    }\r\n}\r\n```\r\nis enough?\r\n"}}