{"action":"created","comment":{"url":"https://api.github.com/repos/plasma-umass/doppio/pulls/comments/52132947","id":52132947,"diff_hunk":"@@ -307,35 +307,126 @@ class java_util_zip_CRC32 {\n \n class java_util_zip_Deflater {\n \n-  public static 'initIDs()V'(thread: JVMThread): void {\n-    thread.throwNewException('Ljava/lang/UnsatisfiedLinkError;', 'Native method not implemented.');\n-  }\n+  public static 'initIDs()V'(thread: JVMThread): void {}\n \n-  public static 'init(IIZ)J'(thread: JVMThread, arg0: number, arg1: number, arg2: number): Long {\n-    thread.throwNewException('Ljava/lang/UnsatisfiedLinkError;', 'Native method not implemented.');\n-    return null;\n+  /**\n+   * Initialize a new deflater. Using the zlib recommended default values.\n+   */\n+  public static 'init(IIZ)J'(thread: JVMThread, level: number, strategy: number, nowrap: number): Long {\n+    let DEF_MEM_LEVEL = 8; // Zlib recommended default\n+    let Z_DEFLATED = 8;    // This value is in the js version of pako under pako.Z_DEFLATED. \n+    // Possibly it is set to private in the Typescript version. The default value is 8, so this should work fine\n+\n+    let strm = new ZStreamCons();\n+    let ret = deflate.deflateInit2(strm, level, Z_DEFLATED, nowrap ? -MAX_WBITS : MAX_WBITS, DEF_MEM_LEVEL, strategy);\n+    \n+    if (ret != ZlibReturnCode.Z_OK) {\n+      let msg = ((strm.msg) ? strm.msg :\n+                (ret == ZlibReturnCode.Z_STREAM_ERROR) ?\n+                \"inflateInit2 returned Z_STREAM_ERROR\" :\n+                \"unknown error initializing zlib library\");\n+      thread.throwNewException(\"Ljava/lang/InternalError;\", msg);","path":"src/natives/java_util.ts","position":28,"original_position":28,"commit_id":"fd615c8c4d3a9992bc8378b7e0afe87c4ca0ff67","original_commit_id":"fd615c8c4d3a9992bc8378b7e0afe87c4ca0ff67","user":{"login":"jvilk","id":1141042,"avatar_url":"https://avatars.githubusercontent.com/u/1141042?v=3","gravatar_id":"","url":"https://api.github.com/users/jvilk","html_url":"https://github.com/jvilk","followers_url":"https://api.github.com/users/jvilk/followers","following_url":"https://api.github.com/users/jvilk/following{/other_user}","gists_url":"https://api.github.com/users/jvilk/gists{/gist_id}","starred_url":"https://api.github.com/users/jvilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvilk/subscriptions","organizations_url":"https://api.github.com/users/jvilk/orgs","repos_url":"https://api.github.com/users/jvilk/repos","events_url":"https://api.github.com/users/jvilk/events{/privacy}","received_events_url":"https://api.github.com/users/jvilk/received_events","type":"User","site_admin":false},"body":"`throwNewException` does not cause a JavaScript exception, so your `init()` method may return twice if this happens -- once here, and a second time below.\r\n\r\nI recommend putting the `return` statement into an `else` branch, so it only executes when you do not throw an exception.","created_at":"2016-02-08T04:31:36Z","updated_at":"2016-02-08T04:31:36Z","html_url":"https://github.com/plasma-umass/doppio/pull/431#discussion_r52132947","pull_request_url":"https://api.github.com/repos/plasma-umass/doppio/pulls/431","_links":{"self":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/comments/52132947"},"html":{"href":"https://github.com/plasma-umass/doppio/pull/431#discussion_r52132947"},"pull_request":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/431"}}},"pull_request":{"url":"https://api.github.com/repos/plasma-umass/doppio/pulls/431","id":58531109,"html_url":"https://github.com/plasma-umass/doppio/pull/431","diff_url":"https://github.com/plasma-umass/doppio/pull/431.diff","patch_url":"https://github.com/plasma-umass/doppio/pull/431.patch","issue_url":"https://api.github.com/repos/plasma-umass/doppio/issues/431","number":431,"state":"open","locked":false,"title":"Added test and all native methods in java.util.zip.Deflate","user":{"login":"kennycoc","id":4149002,"avatar_url":"https://avatars.githubusercontent.com/u/4149002?v=3","gravatar_id":"","url":"https://api.github.com/users/kennycoc","html_url":"https://github.com/kennycoc","followers_url":"https://api.github.com/users/kennycoc/followers","following_url":"https://api.github.com/users/kennycoc/following{/other_user}","gists_url":"https://api.github.com/users/kennycoc/gists{/gist_id}","starred_url":"https://api.github.com/users/kennycoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennycoc/subscriptions","organizations_url":"https://api.github.com/users/kennycoc/orgs","repos_url":"https://api.github.com/users/kennycoc/repos","events_url":"https://api.github.com/users/kennycoc/events{/privacy}","received_events_url":"https://api.github.com/users/kennycoc/received_events","type":"User","site_admin":false},"body":"I apologize if anything is not done the way you would prefer. I did my best to match the style used throughout the rest of the project.","created_at":"2016-02-06T21:41:14Z","updated_at":"2016-02-08T04:31:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84c69bf558f8dbbb3c6067d47b0beac0f72de85c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/plasma-umass/doppio/pulls/431/commits","review_comments_url":"https://api.github.com/repos/plasma-umass/doppio/pulls/431/comments","review_comment_url":"https://api.github.com/repos/plasma-umass/doppio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plasma-umass/doppio/issues/431/comments","statuses_url":"https://api.github.com/repos/plasma-umass/doppio/statuses/fd615c8c4d3a9992bc8378b7e0afe87c4ca0ff67","head":{"label":"kennycoc:master","ref":"master","sha":"fd615c8c4d3a9992bc8378b7e0afe87c4ca0ff67","user":{"login":"kennycoc","id":4149002,"avatar_url":"https://avatars.githubusercontent.com/u/4149002?v=3","gravatar_id":"","url":"https://api.github.com/users/kennycoc","html_url":"https://github.com/kennycoc","followers_url":"https://api.github.com/users/kennycoc/followers","following_url":"https://api.github.com/users/kennycoc/following{/other_user}","gists_url":"https://api.github.com/users/kennycoc/gists{/gist_id}","starred_url":"https://api.github.com/users/kennycoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennycoc/subscriptions","organizations_url":"https://api.github.com/users/kennycoc/orgs","repos_url":"https://api.github.com/users/kennycoc/repos","events_url":"https://api.github.com/users/kennycoc/events{/privacy}","received_events_url":"https://api.github.com/users/kennycoc/received_events","type":"User","site_admin":false},"repo":{"id":51222793,"name":"doppio","full_name":"kennycoc/doppio","owner":{"login":"kennycoc","id":4149002,"avatar_url":"https://avatars.githubusercontent.com/u/4149002?v=3","gravatar_id":"","url":"https://api.github.com/users/kennycoc","html_url":"https://github.com/kennycoc","followers_url":"https://api.github.com/users/kennycoc/followers","following_url":"https://api.github.com/users/kennycoc/following{/other_user}","gists_url":"https://api.github.com/users/kennycoc/gists{/gist_id}","starred_url":"https://api.github.com/users/kennycoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennycoc/subscriptions","organizations_url":"https://api.github.com/users/kennycoc/orgs","repos_url":"https://api.github.com/users/kennycoc/repos","events_url":"https://api.github.com/users/kennycoc/events{/privacy}","received_events_url":"https://api.github.com/users/kennycoc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kennycoc/doppio","description":"An \"OS for your browser\" that breaks the browser language barrier (includes a plugin-free JVM).","fork":true,"url":"https://api.github.com/repos/kennycoc/doppio","forks_url":"https://api.github.com/repos/kennycoc/doppio/forks","keys_url":"https://api.github.com/repos/kennycoc/doppio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kennycoc/doppio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kennycoc/doppio/teams","hooks_url":"https://api.github.com/repos/kennycoc/doppio/hooks","issue_events_url":"https://api.github.com/repos/kennycoc/doppio/issues/events{/number}","events_url":"https://api.github.com/repos/kennycoc/doppio/events","assignees_url":"https://api.github.com/repos/kennycoc/doppio/assignees{/user}","branches_url":"https://api.github.com/repos/kennycoc/doppio/branches{/branch}","tags_url":"https://api.github.com/repos/kennycoc/doppio/tags","blobs_url":"https://api.github.com/repos/kennycoc/doppio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kennycoc/doppio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kennycoc/doppio/git/refs{/sha}","trees_url":"https://api.github.com/repos/kennycoc/doppio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kennycoc/doppio/statuses/{sha}","languages_url":"https://api.github.com/repos/kennycoc/doppio/languages","stargazers_url":"https://api.github.com/repos/kennycoc/doppio/stargazers","contributors_url":"https://api.github.com/repos/kennycoc/doppio/contributors","subscribers_url":"https://api.github.com/repos/kennycoc/doppio/subscribers","subscription_url":"https://api.github.com/repos/kennycoc/doppio/subscription","commits_url":"https://api.github.com/repos/kennycoc/doppio/commits{/sha}","git_commits_url":"https://api.github.com/repos/kennycoc/doppio/git/commits{/sha}","comments_url":"https://api.github.com/repos/kennycoc/doppio/comments{/number}","issue_comment_url":"https://api.github.com/repos/kennycoc/doppio/issues/comments{/number}","contents_url":"https://api.github.com/repos/kennycoc/doppio/contents/{+path}","compare_url":"https://api.github.com/repos/kennycoc/doppio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kennycoc/doppio/merges","archive_url":"https://api.github.com/repos/kennycoc/doppio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kennycoc/doppio/downloads","issues_url":"https://api.github.com/repos/kennycoc/doppio/issues{/number}","pulls_url":"https://api.github.com/repos/kennycoc/doppio/pulls{/number}","milestones_url":"https://api.github.com/repos/kennycoc/doppio/milestones{/number}","notifications_url":"https://api.github.com/repos/kennycoc/doppio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kennycoc/doppio/labels{/name}","releases_url":"https://api.github.com/repos/kennycoc/doppio/releases{/id}","deployments_url":"https://api.github.com/repos/kennycoc/doppio/deployments","created_at":"2016-02-06T21:26:21Z","updated_at":"2016-02-06T21:26:22Z","pushed_at":"2016-02-08T01:46:29Z","git_url":"git://github.com/kennycoc/doppio.git","ssh_url":"git@github.com:kennycoc/doppio.git","clone_url":"https://github.com/kennycoc/doppio.git","svn_url":"https://github.com/kennycoc/doppio","homepage":"http://plasma-umass.github.io/doppio-demo","size":76688,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"plasma-umass:master","ref":"master","sha":"88aefaebbbb8a3abdf42d6abbfe98bc3a0662586","user":{"login":"plasma-umass","id":1880823,"avatar_url":"https://avatars.githubusercontent.com/u/1880823?v=3","gravatar_id":"","url":"https://api.github.com/users/plasma-umass","html_url":"https://github.com/plasma-umass","followers_url":"https://api.github.com/users/plasma-umass/followers","following_url":"https://api.github.com/users/plasma-umass/following{/other_user}","gists_url":"https://api.github.com/users/plasma-umass/gists{/gist_id}","starred_url":"https://api.github.com/users/plasma-umass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plasma-umass/subscriptions","organizations_url":"https://api.github.com/users/plasma-umass/orgs","repos_url":"https://api.github.com/users/plasma-umass/repos","events_url":"https://api.github.com/users/plasma-umass/events{/privacy}","received_events_url":"https://api.github.com/users/plasma-umass/received_events","type":"Organization","site_admin":false},"repo":{"id":3434927,"name":"doppio","full_name":"plasma-umass/doppio","owner":{"login":"plasma-umass","id":1880823,"avatar_url":"https://avatars.githubusercontent.com/u/1880823?v=3","gravatar_id":"","url":"https://api.github.com/users/plasma-umass","html_url":"https://github.com/plasma-umass","followers_url":"https://api.github.com/users/plasma-umass/followers","following_url":"https://api.github.com/users/plasma-umass/following{/other_user}","gists_url":"https://api.github.com/users/plasma-umass/gists{/gist_id}","starred_url":"https://api.github.com/users/plasma-umass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plasma-umass/subscriptions","organizations_url":"https://api.github.com/users/plasma-umass/orgs","repos_url":"https://api.github.com/users/plasma-umass/repos","events_url":"https://api.github.com/users/plasma-umass/events{/privacy}","received_events_url":"https://api.github.com/users/plasma-umass/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plasma-umass/doppio","description":"An \"OS for your browser\" that breaks the browser language barrier (includes a plugin-free JVM).","fork":false,"url":"https://api.github.com/repos/plasma-umass/doppio","forks_url":"https://api.github.com/repos/plasma-umass/doppio/forks","keys_url":"https://api.github.com/repos/plasma-umass/doppio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plasma-umass/doppio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plasma-umass/doppio/teams","hooks_url":"https://api.github.com/repos/plasma-umass/doppio/hooks","issue_events_url":"https://api.github.com/repos/plasma-umass/doppio/issues/events{/number}","events_url":"https://api.github.com/repos/plasma-umass/doppio/events","assignees_url":"https://api.github.com/repos/plasma-umass/doppio/assignees{/user}","branches_url":"https://api.github.com/repos/plasma-umass/doppio/branches{/branch}","tags_url":"https://api.github.com/repos/plasma-umass/doppio/tags","blobs_url":"https://api.github.com/repos/plasma-umass/doppio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plasma-umass/doppio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plasma-umass/doppio/git/refs{/sha}","trees_url":"https://api.github.com/repos/plasma-umass/doppio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plasma-umass/doppio/statuses/{sha}","languages_url":"https://api.github.com/repos/plasma-umass/doppio/languages","stargazers_url":"https://api.github.com/repos/plasma-umass/doppio/stargazers","contributors_url":"https://api.github.com/repos/plasma-umass/doppio/contributors","subscribers_url":"https://api.github.com/repos/plasma-umass/doppio/subscribers","subscription_url":"https://api.github.com/repos/plasma-umass/doppio/subscription","commits_url":"https://api.github.com/repos/plasma-umass/doppio/commits{/sha}","git_commits_url":"https://api.github.com/repos/plasma-umass/doppio/git/commits{/sha}","comments_url":"https://api.github.com/repos/plasma-umass/doppio/comments{/number}","issue_comment_url":"https://api.github.com/repos/plasma-umass/doppio/issues/comments{/number}","contents_url":"https://api.github.com/repos/plasma-umass/doppio/contents/{+path}","compare_url":"https://api.github.com/repos/plasma-umass/doppio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plasma-umass/doppio/merges","archive_url":"https://api.github.com/repos/plasma-umass/doppio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plasma-umass/doppio/downloads","issues_url":"https://api.github.com/repos/plasma-umass/doppio/issues{/number}","pulls_url":"https://api.github.com/repos/plasma-umass/doppio/pulls{/number}","milestones_url":"https://api.github.com/repos/plasma-umass/doppio/milestones{/number}","notifications_url":"https://api.github.com/repos/plasma-umass/doppio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plasma-umass/doppio/labels{/name}","releases_url":"https://api.github.com/repos/plasma-umass/doppio/releases{/id}","deployments_url":"https://api.github.com/repos/plasma-umass/doppio/deployments","created_at":"2012-02-13T22:44:30Z","updated_at":"2016-02-06T03:08:13Z","pushed_at":"2016-02-08T01:46:31Z","git_url":"git://github.com/plasma-umass/doppio.git","ssh_url":"git@github.com:plasma-umass/doppio.git","clone_url":"https://github.com/plasma-umass/doppio.git","svn_url":"https://github.com/plasma-umass/doppio","homepage":"http://plasma-umass.github.io/doppio-demo","size":76730,"stargazers_count":783,"watchers_count":783,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":96,"mirror_url":null,"open_issues_count":27,"forks":96,"open_issues":27,"watchers":783,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/431"},"html":{"href":"https://github.com/plasma-umass/doppio/pull/431"},"issue":{"href":"https://api.github.com/repos/plasma-umass/doppio/issues/431"},"comments":{"href":"https://api.github.com/repos/plasma-umass/doppio/issues/431/comments"},"review_comments":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/431/comments"},"review_comment":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plasma-umass/doppio/pulls/431/commits"},"statuses":{"href":"https://api.github.com/repos/plasma-umass/doppio/statuses/fd615c8c4d3a9992bc8378b7e0afe87c4ca0ff67"}}}}