{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/common/pulls/comments/59246657","id":59246657,"diff_hunk":"@@ -4,14 +4,25 @@ import org.allenai.common.guice.ConfigModule\n \n import com.google.inject.Provides\n import com.google.inject.name.Named\n-import com.typesafe.config.{ Config, ConfigFactory }\n+import com.typesafe.config.Config\n import redis.clients.jedis.{ JedisPool, JedisPoolConfig }\n+import spray.json.JsonFormat\n+\n+/** A guice module for binding a `JsonQueryCache` instance with a parameterized value type. */\n+class JsonQueryCacheModule[V](config: Config)(\n+  implicit\n+  jsonFormat: JsonFormat[V],\n+  manifest: Manifest[V]\n+) extends ConfigModule(config) {\n \n-class JsonQueryCacheModule(config: Config = ConfigFactory.empty) extends ConfigModule(config) {\n   override def configName: String = \"cache.conf\"\n \n   override def bindingPrefix: Option[String] = Some(\"redis\")\n \n+  override def configureWithConfig(fullConfig: Config): Unit = {","path":"cache/src/main/scala/org/allenai/common/cache/JsonQueryCacheModule.scala","position":21,"original_position":21,"commit_id":"4ac5f6426cf8da84695756603c602ba07144d442","original_commit_id":"4ac5f6426cf8da84695756603c602ba07144d442","user":{"login":"jkinkead","id":1548392,"avatar_url":"https://avatars.githubusercontent.com/u/1548392?v=3","gravatar_id":"","url":"https://api.github.com/users/jkinkead","html_url":"https://github.com/jkinkead","followers_url":"https://api.github.com/users/jkinkead/followers","following_url":"https://api.github.com/users/jkinkead/following{/other_user}","gists_url":"https://api.github.com/users/jkinkead/gists{/gist_id}","starred_url":"https://api.github.com/users/jkinkead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkinkead/subscriptions","organizations_url":"https://api.github.com/users/jkinkead/orgs","repos_url":"https://api.github.com/users/jkinkead/repos","events_url":"https://api.github.com/users/jkinkead/events{/privacy}","received_events_url":"https://api.github.com/users/jkinkead/received_events","type":"User","site_admin":false},"body":"Another simpler option is to create a new factory class for the query cache, and inject that. The factory class would have a `getInstance[V]` method that takes the `JsonFormat[V]`, and you won't need to deal with manifests at all.","created_at":"2016-04-11T17:35:27Z","updated_at":"2016-04-11T17:35:27Z","html_url":"https://github.com/allenai/common/pull/184#discussion_r59246657","pull_request_url":"https://api.github.com/repos/allenai/common/pulls/184","_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/comments/59246657"},"html":{"href":"https://github.com/allenai/common/pull/184#discussion_r59246657"},"pull_request":{"href":"https://api.github.com/repos/allenai/common/pulls/184"}}},"pull_request":{"url":"https://api.github.com/repos/allenai/common/pulls/184","id":66006828,"html_url":"https://github.com/allenai/common/pull/184","diff_url":"https://github.com/allenai/common/pull/184.diff","patch_url":"https://github.com/allenai/common/pull/184.patch","issue_url":"https://api.github.com/repos/allenai/common/issues/184","number":184,"state":"open","locked":false,"title":"Fix JsonQueryCacheModule, and add tests.","user":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"body":"In addition to the tests here, I've verified it works in the wumpus project.","created_at":"2016-04-11T14:51:32Z","updated_at":"2016-04-11T17:35:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9b4cf427cae0e747caaf4b4a86b84bf50026472","assignee":{"login":"jkinkead","id":1548392,"avatar_url":"https://avatars.githubusercontent.com/u/1548392?v=3","gravatar_id":"","url":"https://api.github.com/users/jkinkead","html_url":"https://github.com/jkinkead","followers_url":"https://api.github.com/users/jkinkead/followers","following_url":"https://api.github.com/users/jkinkead/following{/other_user}","gists_url":"https://api.github.com/users/jkinkead/gists{/gist_id}","starred_url":"https://api.github.com/users/jkinkead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkinkead/subscriptions","organizations_url":"https://api.github.com/users/jkinkead/orgs","repos_url":"https://api.github.com/users/jkinkead/repos","events_url":"https://api.github.com/users/jkinkead/events{/privacy}","received_events_url":"https://api.github.com/users/jkinkead/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/allenai/common/pulls/184/commits","review_comments_url":"https://api.github.com/repos/allenai/common/pulls/184/comments","review_comment_url":"https://api.github.com/repos/allenai/common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/common/issues/184/comments","statuses_url":"https://api.github.com/repos/allenai/common/statuses/4ac5f6426cf8da84695756603c602ba07144d442","head":{"label":"danxmoran:fix-cache-module","ref":"fix-cache-module","sha":"4ac5f6426cf8da84695756603c602ba07144d442","user":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"repo":{"id":50468500,"name":"common","full_name":"danxmoran/common","owner":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danxmoran/common","description":"A collection of useful utility classes and functions.","fork":true,"url":"https://api.github.com/repos/danxmoran/common","forks_url":"https://api.github.com/repos/danxmoran/common/forks","keys_url":"https://api.github.com/repos/danxmoran/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danxmoran/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danxmoran/common/teams","hooks_url":"https://api.github.com/repos/danxmoran/common/hooks","issue_events_url":"https://api.github.com/repos/danxmoran/common/issues/events{/number}","events_url":"https://api.github.com/repos/danxmoran/common/events","assignees_url":"https://api.github.com/repos/danxmoran/common/assignees{/user}","branches_url":"https://api.github.com/repos/danxmoran/common/branches{/branch}","tags_url":"https://api.github.com/repos/danxmoran/common/tags","blobs_url":"https://api.github.com/repos/danxmoran/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danxmoran/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danxmoran/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/danxmoran/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danxmoran/common/statuses/{sha}","languages_url":"https://api.github.com/repos/danxmoran/common/languages","stargazers_url":"https://api.github.com/repos/danxmoran/common/stargazers","contributors_url":"https://api.github.com/repos/danxmoran/common/contributors","subscribers_url":"https://api.github.com/repos/danxmoran/common/subscribers","subscription_url":"https://api.github.com/repos/danxmoran/common/subscription","commits_url":"https://api.github.com/repos/danxmoran/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/danxmoran/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/danxmoran/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/danxmoran/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/danxmoran/common/contents/{+path}","compare_url":"https://api.github.com/repos/danxmoran/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danxmoran/common/merges","archive_url":"https://api.github.com/repos/danxmoran/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danxmoran/common/downloads","issues_url":"https://api.github.com/repos/danxmoran/common/issues{/number}","pulls_url":"https://api.github.com/repos/danxmoran/common/pulls{/number}","milestones_url":"https://api.github.com/repos/danxmoran/common/milestones{/number}","notifications_url":"https://api.github.com/repos/danxmoran/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danxmoran/common/labels{/name}","releases_url":"https://api.github.com/repos/danxmoran/common/releases{/id}","deployments_url":"https://api.github.com/repos/danxmoran/common/deployments","created_at":"2016-01-27T00:07:41Z","updated_at":"2016-01-27T00:07:42Z","pushed_at":"2016-04-11T14:50:42Z","git_url":"git://github.com/danxmoran/common.git","ssh_url":"git@github.com:danxmoran/common.git","clone_url":"https://github.com/danxmoran/common.git","svn_url":"https://github.com/danxmoran/common","homepage":null,"size":23738,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"allenai:master","ref":"master","sha":"b71b5192ae8f01b8057a7802f953f5d6d444f4b5","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":15063788,"name":"common","full_name":"allenai/common","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/common","description":"A collection of useful utility classes and functions.","fork":false,"url":"https://api.github.com/repos/allenai/common","forks_url":"https://api.github.com/repos/allenai/common/forks","keys_url":"https://api.github.com/repos/allenai/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/common/teams","hooks_url":"https://api.github.com/repos/allenai/common/hooks","issue_events_url":"https://api.github.com/repos/allenai/common/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/common/events","assignees_url":"https://api.github.com/repos/allenai/common/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/common/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/common/tags","blobs_url":"https://api.github.com/repos/allenai/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/common/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/common/languages","stargazers_url":"https://api.github.com/repos/allenai/common/stargazers","contributors_url":"https://api.github.com/repos/allenai/common/contributors","subscribers_url":"https://api.github.com/repos/allenai/common/subscribers","subscription_url":"https://api.github.com/repos/allenai/common/subscription","commits_url":"https://api.github.com/repos/allenai/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/common/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/common/merges","archive_url":"https://api.github.com/repos/allenai/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/common/downloads","issues_url":"https://api.github.com/repos/allenai/common/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/common/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/common/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/common/labels{/name}","releases_url":"https://api.github.com/repos/allenai/common/releases{/id}","deployments_url":"https://api.github.com/repos/allenai/common/deployments","created_at":"2013-12-10T01:16:45Z","updated_at":"2016-03-31T12:42:03Z","pushed_at":"2016-04-11T14:51:32Z","git_url":"git://github.com/allenai/common.git","ssh_url":"git@github.com:allenai/common.git","clone_url":"https://github.com/allenai/common.git","svn_url":"https://github.com/allenai/common","homepage":null,"size":23770,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":11,"forks":13,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/184"},"html":{"href":"https://github.com/allenai/common/pull/184"},"issue":{"href":"https://api.github.com/repos/allenai/common/issues/184"},"comments":{"href":"https://api.github.com/repos/allenai/common/issues/184/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/common/pulls/184/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/common/pulls/184/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/common/statuses/4ac5f6426cf8da84695756603c602ba07144d442"}}}}