{"action":"created","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/124","labels_url":"https://api.github.com/repos/immutables/immutables/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/124/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/124/events","html_url":"https://github.com/immutables/immutables/issues/124","id":90252263,"number":124,"title":"null checks should throw IllegalArgumentException instead of NullPointerException","user":{"login":"haroldcarr","id":675370,"avatar_url":"https://avatars.githubusercontent.com/u/675370?v=3","gravatar_id":"","url":"https://api.github.com/users/haroldcarr","html_url":"https://github.com/haroldcarr","followers_url":"https://api.github.com/users/haroldcarr/followers","following_url":"https://api.github.com/users/haroldcarr/following{/other_user}","gists_url":"https://api.github.com/users/haroldcarr/gists{/gist_id}","starred_url":"https://api.github.com/users/haroldcarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haroldcarr/subscriptions","organizations_url":"https://api.github.com/users/haroldcarr/orgs","repos_url":"https://api.github.com/users/haroldcarr/repos","events_url":"https://api.github.com/users/haroldcarr/events{/privacy}","received_events_url":"https://api.github.com/users/haroldcarr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-23T00:39:27Z","updated_at":"2015-07-20T20:25:35Z","closed_at":null,"body":"Immutables generates code like:\r\n\r\n    public final Builder withId(String id) {\r\n        this.id = Preconditions.checkNotNull(id);\r\n        ...\r\n\r\ncheckNotNull throws NullPointerException if 'id' is null.\r\n\r\nIt would be useful to have a customization that enables IllegalArgumentException to be thrown instead."},"comment":{"url":"https://api.github.com/repos/immutables/immutables/issues/comments/123021977","html_url":"https://github.com/immutables/immutables/issues/124#issuecomment-123021977","issue_url":"https://api.github.com/repos/immutables/immutables/issues/124","id":123021977,"user":{"login":"elucash","id":1692611,"avatar_url":"https://avatars.githubusercontent.com/u/1692611?v=3","gravatar_id":"","url":"https://api.github.com/users/elucash","html_url":"https://github.com/elucash","followers_url":"https://api.github.com/users/elucash/followers","following_url":"https://api.github.com/users/elucash/following{/other_user}","gists_url":"https://api.github.com/users/elucash/gists{/gist_id}","starred_url":"https://api.github.com/users/elucash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elucash/subscriptions","organizations_url":"https://api.github.com/users/elucash/orgs","repos_url":"https://api.github.com/users/elucash/repos","events_url":"https://api.github.com/users/elucash/events{/privacy}","received_events_url":"https://api.github.com/users/elucash/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T20:25:35Z","updated_at":"2015-07-20T20:25:35Z","body":"Current default behavior will stick to NPE. Not because it's more correct, but mostly because of conformance to JDK convention (briefly expresses in _Effective Java 2nd ed, Item 60_).\r\nWhat we can consider to improve on the current state:\r\n\r\n* Add messages for parameter checks. Having messages with parameters named will add better diagnostic, will look less like arbitrary null pointer dereference.\r\n* Add style to generate IAE check instead of NPE check. This style will be disabled by default."}}