{"action":"created","issue":{"url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/6","repository_url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets","labels_url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/6/comments","events_url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/6/events","html_url":"https://github.com/TwilioDevEd/task-router-servlets/issues/6","id":163435556,"number":6,"title":"Remove Parameterless Constructors","user":{"login":"acamino","id":957202,"avatar_url":"https://avatars.githubusercontent.com/u/957202?v=3","gravatar_id":"","url":"https://api.github.com/users/acamino","html_url":"https://github.com/acamino","followers_url":"https://api.github.com/users/acamino/followers","following_url":"https://api.github.com/users/acamino/following{/other_user}","gists_url":"https://api.github.com/users/acamino/gists{/gist_id}","starred_url":"https://api.github.com/users/acamino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acamino/subscriptions","organizations_url":"https://api.github.com/users/acamino/orgs","repos_url":"https://api.github.com/users/acamino/repos","events_url":"https://api.github.com/users/acamino/events{/privacy}","received_events_url":"https://api.github.com/users/acamino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-01T16:57:54Z","updated_at":"2016-07-09T01:44:25Z","closed_at":null,"body":"@EliuX Out of curiosity, why do you have private constructors?\r\n\r\nIf they are required, the the compiler will create public parameterless constructors for you.\r\n\r\nPlease take a look at:\r\n\r\n- https://github.com/TwilioDevEd/task-router-servlets/blob/b5f9cc37e05ce95a1798c7ef49669f5154865f50/src/main/java/com/twilio/taskrouter/domain/model/MissedCall.java#L30-L31\r\n- https://github.com/TwilioDevEd/task-router-servlets/blob/master/src/main/java/com/twilio/taskrouter/domain/model/PhoneNumber.java#L21-L22\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/comments/231507623","html_url":"https://github.com/TwilioDevEd/task-router-servlets/issues/6#issuecomment-231507623","issue_url":"https://api.github.com/repos/TwilioDevEd/task-router-servlets/issues/6","id":231507623,"user":{"login":"acamino","id":957202,"avatar_url":"https://avatars.githubusercontent.com/u/957202?v=3","gravatar_id":"","url":"https://api.github.com/users/acamino","html_url":"https://github.com/acamino","followers_url":"https://api.github.com/users/acamino/followers","following_url":"https://api.github.com/users/acamino/following{/other_user}","gists_url":"https://api.github.com/users/acamino/gists{/gist_id}","starred_url":"https://api.github.com/users/acamino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acamino/subscriptions","organizations_url":"https://api.github.com/users/acamino/orgs","repos_url":"https://api.github.com/users/acamino/repos","events_url":"https://api.github.com/users/acamino/events{/privacy}","received_events_url":"https://api.github.com/users/acamino/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T01:44:24Z","updated_at":"2016-07-09T01:44:24Z","body":"Thanks @EliuX, this is a really good explanation about why we **must** have a parameterless (_no-arg_) constructor. The link you provided is really useful.\r\n\r\nMy original question was:\r\n> Out of curiosity, why do you have **private** constructors?\r\n\r\nThe private constructors are not used at all. Keep in mind the private constructor is not accessible outside the scope of the class.\r\n\r\n`MissedCall` and `PhoneNumber` are working because if you don't define a explicitly a constructor for a class, a default _public_ parameterless constructor is automatically created by the compiler. This constructor satisfies the requirement \"The no-arg constructor **must be public or protected**\".\r\n\r\nWould you mind removing the unused code please? Unless you have a strong reason to keep it that way."}}
{"actor":{"display_login":"acamino"}}