{"action":"created","comment":{"url":"https://api.github.com/repos/owlike/genson/pulls/comments/38954956","id":38954956,"diff_hunk":"@@ -60,6 +60,7 @@\n   private VisibilityFilter methodFilter = VisibilityFilter.PACKAGE_PUBLIC;\n   private VisibilityFilter constructorFilter = VisibilityFilter.PACKAGE_PUBLIC;\n \n+  private ClassLoader classLoader = null;","path":"genson/src/main/java/com/owlike/genson/GensonBuilder.java","position":4,"original_position":4,"commit_id":"cfbbb5aad62a44d8a74676595b93ae1a3df6f280","original_commit_id":"cfbbb5aad62a44d8a74676595b93ae1a3df6f280","user":{"login":"EugenCepoi","id":3456977,"avatar_url":"https://avatars.githubusercontent.com/u/3456977?v=3","gravatar_id":"","url":"https://api.github.com/users/EugenCepoi","html_url":"https://github.com/EugenCepoi","followers_url":"https://api.github.com/users/EugenCepoi/followers","following_url":"https://api.github.com/users/EugenCepoi/following{/other_user}","gists_url":"https://api.github.com/users/EugenCepoi/gists{/gist_id}","starred_url":"https://api.github.com/users/EugenCepoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EugenCepoi/subscriptions","organizations_url":"https://api.github.com/users/EugenCepoi/orgs","repos_url":"https://api.github.com/users/EugenCepoi/repos","events_url":"https://api.github.com/users/EugenCepoi/events{/privacy}","received_events_url":"https://api.github.com/users/EugenCepoi/received_events","type":"User","site_admin":false},"body":"Why not initialize it to `GensonBuilder.getClassLoader` and then just do new `ScalaBeanPropertyFactory(builder.getClassLoader())`? An additional not null check could be added to withClassLoader method.","created_at":"2015-09-08T17:33:49Z","updated_at":"2015-09-08T17:33:49Z","html_url":"https://github.com/owlike/genson/pull/72#discussion_r38954956","pull_request_url":"https://api.github.com/repos/owlike/genson/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/owlike/genson/pulls/comments/38954956"},"html":{"href":"https://github.com/owlike/genson/pull/72#discussion_r38954956"},"pull_request":{"href":"https://api.github.com/repos/owlike/genson/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/owlike/genson/pulls/72","id":42179216,"html_url":"https://github.com/owlike/genson/pull/72","diff_url":"https://github.com/owlike/genson/pull/72.diff","patch_url":"https://github.com/owlike/genson/pull/72.patch","issue_url":"https://api.github.com/repos/owlike/genson/issues/72","number":72,"state":"open","locked":false,"title":"Allow to specify Classloader","user":{"login":"Rovak","id":376155,"avatar_url":"https://avatars.githubusercontent.com/u/376155?v=3","gravatar_id":"","url":"https://api.github.com/users/Rovak","html_url":"https://github.com/Rovak","followers_url":"https://api.github.com/users/Rovak/followers","following_url":"https://api.github.com/users/Rovak/following{/other_user}","gists_url":"https://api.github.com/users/Rovak/gists{/gist_id}","starred_url":"https://api.github.com/users/Rovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rovak/subscriptions","organizations_url":"https://api.github.com/users/Rovak/orgs","repos_url":"https://api.github.com/users/Rovak/repos","events_url":"https://api.github.com/users/Rovak/events{/privacy}","received_events_url":"https://api.github.com/users/Rovak/received_events","type":"User","site_admin":false},"body":"### Motivation\r\n\r\nWhen using Play Framework there appear to be classloader errors when deserializing case classes which reference other classes in their parameter types.\r\n\r\n### Example\r\n\r\nIt works in play dev mode for the simple cases, i narrowed the error down to the following, this works:\r\n\r\n```scala\r\ncase class Person(name: String)\r\n\r\nval person = genson.fromJson[Person](\"{\\\"name\\\":\\\"John Doe\\\"}\")\r\n```\r\n\r\nWhen the case class references another class then it will thrown an error that the class Person was not found:\r\n\r\n```scala\r\ncase class Person(name: String)\r\ncase class PhoneBook(names: List[Person])\r\n\r\nval phonebook = genson.fromJson[PhoneBook](\"{\\\"persons\\\":[{\\\"name\\\":\\\"John Doe\\\"}]}\")\r\n```\r\n\r\n## TODO\r\n\r\n- [x] Add `withClassLoader` to GensonBuilder\r\n- [x] Check where other classloaders are used and if they should use the classloader specified in the GensonBuilder\r\n\r\n","created_at":"2015-08-11T21:17:04Z","updated_at":"2015-09-08T17:33:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e421a259d3194ca5a21574aceb4e96b23dd0fdc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/owlike/genson/pulls/72/commits","review_comments_url":"https://api.github.com/repos/owlike/genson/pulls/72/comments","review_comment_url":"https://api.github.com/repos/owlike/genson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owlike/genson/issues/72/comments","statuses_url":"https://api.github.com/repos/owlike/genson/statuses/cfbbb5aad62a44d8a74676595b93ae1a3df6f280","head":{"label":"Rovak:custom-classloader","ref":"custom-classloader","sha":"cfbbb5aad62a44d8a74676595b93ae1a3df6f280","user":{"login":"Rovak","id":376155,"avatar_url":"https://avatars.githubusercontent.com/u/376155?v=3","gravatar_id":"","url":"https://api.github.com/users/Rovak","html_url":"https://github.com/Rovak","followers_url":"https://api.github.com/users/Rovak/followers","following_url":"https://api.github.com/users/Rovak/following{/other_user}","gists_url":"https://api.github.com/users/Rovak/gists{/gist_id}","starred_url":"https://api.github.com/users/Rovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rovak/subscriptions","organizations_url":"https://api.github.com/users/Rovak/orgs","repos_url":"https://api.github.com/users/Rovak/repos","events_url":"https://api.github.com/users/Rovak/events{/privacy}","received_events_url":"https://api.github.com/users/Rovak/received_events","type":"User","site_admin":false},"repo":{"id":40565244,"name":"genson","full_name":"Rovak/genson","owner":{"login":"Rovak","id":376155,"avatar_url":"https://avatars.githubusercontent.com/u/376155?v=3","gravatar_id":"","url":"https://api.github.com/users/Rovak","html_url":"https://github.com/Rovak","followers_url":"https://api.github.com/users/Rovak/followers","following_url":"https://api.github.com/users/Rovak/following{/other_user}","gists_url":"https://api.github.com/users/Rovak/gists{/gist_id}","starred_url":"https://api.github.com/users/Rovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rovak/subscriptions","organizations_url":"https://api.github.com/users/Rovak/orgs","repos_url":"https://api.github.com/users/Rovak/repos","events_url":"https://api.github.com/users/Rovak/events{/privacy}","received_events_url":"https://api.github.com/users/Rovak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Rovak/genson","description":"Genson a fast & modular Java <> Json library","fork":true,"url":"https://api.github.com/repos/Rovak/genson","forks_url":"https://api.github.com/repos/Rovak/genson/forks","keys_url":"https://api.github.com/repos/Rovak/genson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rovak/genson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rovak/genson/teams","hooks_url":"https://api.github.com/repos/Rovak/genson/hooks","issue_events_url":"https://api.github.com/repos/Rovak/genson/issues/events{/number}","events_url":"https://api.github.com/repos/Rovak/genson/events","assignees_url":"https://api.github.com/repos/Rovak/genson/assignees{/user}","branches_url":"https://api.github.com/repos/Rovak/genson/branches{/branch}","tags_url":"https://api.github.com/repos/Rovak/genson/tags","blobs_url":"https://api.github.com/repos/Rovak/genson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rovak/genson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rovak/genson/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rovak/genson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rovak/genson/statuses/{sha}","languages_url":"https://api.github.com/repos/Rovak/genson/languages","stargazers_url":"https://api.github.com/repos/Rovak/genson/stargazers","contributors_url":"https://api.github.com/repos/Rovak/genson/contributors","subscribers_url":"https://api.github.com/repos/Rovak/genson/subscribers","subscription_url":"https://api.github.com/repos/Rovak/genson/subscription","commits_url":"https://api.github.com/repos/Rovak/genson/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rovak/genson/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rovak/genson/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rovak/genson/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rovak/genson/contents/{+path}","compare_url":"https://api.github.com/repos/Rovak/genson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rovak/genson/merges","archive_url":"https://api.github.com/repos/Rovak/genson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rovak/genson/downloads","issues_url":"https://api.github.com/repos/Rovak/genson/issues{/number}","pulls_url":"https://api.github.com/repos/Rovak/genson/pulls{/number}","milestones_url":"https://api.github.com/repos/Rovak/genson/milestones{/number}","notifications_url":"https://api.github.com/repos/Rovak/genson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rovak/genson/labels{/name}","releases_url":"https://api.github.com/repos/Rovak/genson/releases{/id}","created_at":"2015-08-11T21:06:07Z","updated_at":"2015-08-11T21:06:08Z","pushed_at":"2015-09-08T17:24:29Z","git_url":"git://github.com/Rovak/genson.git","ssh_url":"git@github.com:Rovak/genson.git","clone_url":"https://github.com/Rovak/genson.git","svn_url":"https://github.com/Rovak/genson","homepage":"http://owlike.github.io/genson/","size":9491,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"owlike:master","ref":"master","sha":"5b6a2e8592c7d7846e0e6e2b781fa579ab57be8f","user":{"login":"owlike","id":3459944,"avatar_url":"https://avatars.githubusercontent.com/u/3459944?v=3","gravatar_id":"","url":"https://api.github.com/users/owlike","html_url":"https://github.com/owlike","followers_url":"https://api.github.com/users/owlike/followers","following_url":"https://api.github.com/users/owlike/following{/other_user}","gists_url":"https://api.github.com/users/owlike/gists{/gist_id}","starred_url":"https://api.github.com/users/owlike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owlike/subscriptions","organizations_url":"https://api.github.com/users/owlike/orgs","repos_url":"https://api.github.com/users/owlike/repos","events_url":"https://api.github.com/users/owlike/events{/privacy}","received_events_url":"https://api.github.com/users/owlike/received_events","type":"Organization","site_admin":false},"repo":{"id":7983535,"name":"genson","full_name":"owlike/genson","owner":{"login":"owlike","id":3459944,"avatar_url":"https://avatars.githubusercontent.com/u/3459944?v=3","gravatar_id":"","url":"https://api.github.com/users/owlike","html_url":"https://github.com/owlike","followers_url":"https://api.github.com/users/owlike/followers","following_url":"https://api.github.com/users/owlike/following{/other_user}","gists_url":"https://api.github.com/users/owlike/gists{/gist_id}","starred_url":"https://api.github.com/users/owlike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owlike/subscriptions","organizations_url":"https://api.github.com/users/owlike/orgs","repos_url":"https://api.github.com/users/owlike/repos","events_url":"https://api.github.com/users/owlike/events{/privacy}","received_events_url":"https://api.github.com/users/owlike/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owlike/genson","description":"Genson a fast & modular Java <> Json library","fork":false,"url":"https://api.github.com/repos/owlike/genson","forks_url":"https://api.github.com/repos/owlike/genson/forks","keys_url":"https://api.github.com/repos/owlike/genson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owlike/genson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owlike/genson/teams","hooks_url":"https://api.github.com/repos/owlike/genson/hooks","issue_events_url":"https://api.github.com/repos/owlike/genson/issues/events{/number}","events_url":"https://api.github.com/repos/owlike/genson/events","assignees_url":"https://api.github.com/repos/owlike/genson/assignees{/user}","branches_url":"https://api.github.com/repos/owlike/genson/branches{/branch}","tags_url":"https://api.github.com/repos/owlike/genson/tags","blobs_url":"https://api.github.com/repos/owlike/genson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owlike/genson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owlike/genson/git/refs{/sha}","trees_url":"https://api.github.com/repos/owlike/genson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owlike/genson/statuses/{sha}","languages_url":"https://api.github.com/repos/owlike/genson/languages","stargazers_url":"https://api.github.com/repos/owlike/genson/stargazers","contributors_url":"https://api.github.com/repos/owlike/genson/contributors","subscribers_url":"https://api.github.com/repos/owlike/genson/subscribers","subscription_url":"https://api.github.com/repos/owlike/genson/subscription","commits_url":"https://api.github.com/repos/owlike/genson/commits{/sha}","git_commits_url":"https://api.github.com/repos/owlike/genson/git/commits{/sha}","comments_url":"https://api.github.com/repos/owlike/genson/comments{/number}","issue_comment_url":"https://api.github.com/repos/owlike/genson/issues/comments{/number}","contents_url":"https://api.github.com/repos/owlike/genson/contents/{+path}","compare_url":"https://api.github.com/repos/owlike/genson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owlike/genson/merges","archive_url":"https://api.github.com/repos/owlike/genson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owlike/genson/downloads","issues_url":"https://api.github.com/repos/owlike/genson/issues{/number}","pulls_url":"https://api.github.com/repos/owlike/genson/pulls{/number}","milestones_url":"https://api.github.com/repos/owlike/genson/milestones{/number}","notifications_url":"https://api.github.com/repos/owlike/genson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owlike/genson/labels{/name}","releases_url":"https://api.github.com/repos/owlike/genson/releases{/id}","created_at":"2013-02-02T23:24:56Z","updated_at":"2015-09-03T12:35:17Z","pushed_at":"2015-09-08T17:24:30Z","git_url":"git://github.com/owlike/genson.git","ssh_url":"git@github.com:owlike/genson.git","clone_url":"https://github.com/owlike/genson.git","svn_url":"https://github.com/owlike/genson","homepage":"http://owlike.github.io/genson/","size":10282,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":24,"forks":13,"open_issues":24,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owlike/genson/pulls/72"},"html":{"href":"https://github.com/owlike/genson/pull/72"},"issue":{"href":"https://api.github.com/repos/owlike/genson/issues/72"},"comments":{"href":"https://api.github.com/repos/owlike/genson/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/owlike/genson/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/owlike/genson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owlike/genson/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/owlike/genson/statuses/cfbbb5aad62a44d8a74676595b93ae1a3df6f280"}}}}