{"action":"created","comment":{"url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/comments/24292766","id":24292766,"diff_hunk":"@@ -368,13 +356,85 @@ private static InputStream getResponseErrorStream(HttpWebRequest request)\n   /**\n    * Reads the response.\n    *\n+   * @return serviceResponse\n+   * @throws Exception\n+   */\n+  protected T readResponse(HttpWebRequest response) throws Exception {\n+    T serviceResponse;\n+\n+    if (!response.getResponseContentType().startsWith(\"text/xml\")) {\n+      String line = new BufferedReader(new InputStreamReader(ServiceRequestBase.getResponseStream(response)))\n+          .readLine();\n+      throw new ServiceRequestException(Strings.ServiceResponseDoesNotContainXml);\n+    }\n+\n+    /**\n+     * If tracing is enabled, we read the entire response into a\n+     * MemoryStream so that we can pass it along to the ITraceListener. Then\n+     * we parse the response from the MemoryStream.\n+     */\n+\n+    try {\n+      this.getService().processHttpResponseHeaders(\n+          TraceFlags.EwsResponseHttpHeaders, response);\n+\n+      if (this.getService().isTraceEnabledFor(TraceFlags.EwsResponse)) {\n+        ByteArrayOutputStream memoryStream = new ByteArrayOutputStream();\n+        InputStream serviceResponseStream = ServiceRequestBase\n+            .getResponseStream(response);\n+        while (true) {\n+          int data = serviceResponseStream.read();","path":"src/main/java/microsoft/exchange/webservices/data/ServiceRequestBase.java","position":96,"original_position":96,"commit_id":"5f35f5cd3ce9c62e2f801bbd802ff22e8abc8e03","original_commit_id":"5f35f5cd3ce9c62e2f801bbd802ff22e8abc8e03","user":{"login":"ahaarrestad","id":2673608,"avatar_url":"https://avatars.githubusercontent.com/u/2673608?v=3","gravatar_id":"","url":"https://api.github.com/users/ahaarrestad","html_url":"https://github.com/ahaarrestad","followers_url":"https://api.github.com/users/ahaarrestad/followers","following_url":"https://api.github.com/users/ahaarrestad/following{/other_user}","gists_url":"https://api.github.com/users/ahaarrestad/gists{/gist_id}","starred_url":"https://api.github.com/users/ahaarrestad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahaarrestad/subscriptions","organizations_url":"https://api.github.com/users/ahaarrestad/orgs","repos_url":"https://api.github.com/users/ahaarrestad/repos","events_url":"https://api.github.com/users/ahaarrestad/events{/privacy}","received_events_url":"https://api.github.com/users/ahaarrestad/received_events","type":"User","site_admin":false},"body":"This can be squashed in to the while-loop to avoid the \"white(true)\" stuff.....","created_at":"2015-02-07T20:49:40Z","updated_at":"2015-02-07T20:49:40Z","html_url":"https://github.com/OfficeDev/ews-java-api/pull/196#discussion_r24292766","pull_request_url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196","_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/comments/24292766"},"html":{"href":"https://github.com/OfficeDev/ews-java-api/pull/196#discussion_r24292766"},"pull_request":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196"}}},"pull_request":{"url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196","id":28585486,"html_url":"https://github.com/OfficeDev/ews-java-api/pull/196","diff_url":"https://github.com/OfficeDev/ews-java-api/pull/196.diff","patch_url":"https://github.com/OfficeDev/ews-java-api/pull/196.patch","issue_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/196","number":196,"state":"open","locked":false,"title":"fix: Issue 28 and add improvement for response parameters","user":{"login":"serious6","id":3902037,"avatar_url":"https://avatars.githubusercontent.com/u/3902037?v=3","gravatar_id":"","url":"https://api.github.com/users/serious6","html_url":"https://github.com/serious6","followers_url":"https://api.github.com/users/serious6/followers","following_url":"https://api.github.com/users/serious6/following{/other_user}","gists_url":"https://api.github.com/users/serious6/gists{/gist_id}","starred_url":"https://api.github.com/users/serious6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serious6/subscriptions","organizations_url":"https://api.github.com/users/serious6/orgs","repos_url":"https://api.github.com/users/serious6/repos","events_url":"https://api.github.com/users/serious6/events{/privacy}","received_events_url":"https://api.github.com/users/serious6/received_events","type":"User","site_admin":false},"body":"This PR will fix issue 28 which outlined that the response-object from an internalExecute will be closed twice which will result in an error. I also tried to add some improvement to the handling of return-parameters as well since they where just defined as Object and dont include reflection. \r\n\r\nThis should not be merged since the functionality of the methods changed is confirmed.\r\nTherefore help with testing would be welcome as well as your comments and suggestions.","created_at":"2015-02-03T20:23:26Z","updated_at":"2015-02-07T20:49:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"504a6a0233838f42703a4354d70716a5c19744d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196/commits","review_comments_url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196/comments","review_comment_url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/196/comments","statuses_url":"https://api.github.com/repos/OfficeDev/ews-java-api/statuses/5f35f5cd3ce9c62e2f801bbd802ff22e8abc8e03","head":{"label":"serious6:issue-28","ref":"issue-28","sha":"5f35f5cd3ce9c62e2f801bbd802ff22e8abc8e03","user":{"login":"serious6","id":3902037,"avatar_url":"https://avatars.githubusercontent.com/u/3902037?v=3","gravatar_id":"","url":"https://api.github.com/users/serious6","html_url":"https://github.com/serious6","followers_url":"https://api.github.com/users/serious6/followers","following_url":"https://api.github.com/users/serious6/following{/other_user}","gists_url":"https://api.github.com/users/serious6/gists{/gist_id}","starred_url":"https://api.github.com/users/serious6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serious6/subscriptions","organizations_url":"https://api.github.com/users/serious6/orgs","repos_url":"https://api.github.com/users/serious6/repos","events_url":"https://api.github.com/users/serious6/events{/privacy}","received_events_url":"https://api.github.com/users/serious6/received_events","type":"User","site_admin":false},"repo":{"id":26131809,"name":"ews-java-api","full_name":"serious6/ews-java-api","owner":{"login":"serious6","id":3902037,"avatar_url":"https://avatars.githubusercontent.com/u/3902037?v=3","gravatar_id":"","url":"https://api.github.com/users/serious6","html_url":"https://github.com/serious6","followers_url":"https://api.github.com/users/serious6/followers","following_url":"https://api.github.com/users/serious6/following{/other_user}","gists_url":"https://api.github.com/users/serious6/gists{/gist_id}","starred_url":"https://api.github.com/users/serious6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serious6/subscriptions","organizations_url":"https://api.github.com/users/serious6/orgs","repos_url":"https://api.github.com/users/serious6/repos","events_url":"https://api.github.com/users/serious6/events{/privacy}","received_events_url":"https://api.github.com/users/serious6/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/serious6/ews-java-api","description":"A java client library to access Exchange web services.  The API works against Office 365 Exchange Online as well as on premises Exchange.","fork":true,"url":"https://api.github.com/repos/serious6/ews-java-api","forks_url":"https://api.github.com/repos/serious6/ews-java-api/forks","keys_url":"https://api.github.com/repos/serious6/ews-java-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serious6/ews-java-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serious6/ews-java-api/teams","hooks_url":"https://api.github.com/repos/serious6/ews-java-api/hooks","issue_events_url":"https://api.github.com/repos/serious6/ews-java-api/issues/events{/number}","events_url":"https://api.github.com/repos/serious6/ews-java-api/events","assignees_url":"https://api.github.com/repos/serious6/ews-java-api/assignees{/user}","branches_url":"https://api.github.com/repos/serious6/ews-java-api/branches{/branch}","tags_url":"https://api.github.com/repos/serious6/ews-java-api/tags","blobs_url":"https://api.github.com/repos/serious6/ews-java-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serious6/ews-java-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serious6/ews-java-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/serious6/ews-java-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serious6/ews-java-api/statuses/{sha}","languages_url":"https://api.github.com/repos/serious6/ews-java-api/languages","stargazers_url":"https://api.github.com/repos/serious6/ews-java-api/stargazers","contributors_url":"https://api.github.com/repos/serious6/ews-java-api/contributors","subscribers_url":"https://api.github.com/repos/serious6/ews-java-api/subscribers","subscription_url":"https://api.github.com/repos/serious6/ews-java-api/subscription","commits_url":"https://api.github.com/repos/serious6/ews-java-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/serious6/ews-java-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/serious6/ews-java-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/serious6/ews-java-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/serious6/ews-java-api/contents/{+path}","compare_url":"https://api.github.com/repos/serious6/ews-java-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serious6/ews-java-api/merges","archive_url":"https://api.github.com/repos/serious6/ews-java-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serious6/ews-java-api/downloads","issues_url":"https://api.github.com/repos/serious6/ews-java-api/issues{/number}","pulls_url":"https://api.github.com/repos/serious6/ews-java-api/pulls{/number}","milestones_url":"https://api.github.com/repos/serious6/ews-java-api/milestones{/number}","notifications_url":"https://api.github.com/repos/serious6/ews-java-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serious6/ews-java-api/labels{/name}","releases_url":"https://api.github.com/repos/serious6/ews-java-api/releases{/id}","created_at":"2014-11-03T18:13:27Z","updated_at":"2015-02-07T15:15:51Z","pushed_at":"2015-02-07T15:15:49Z","git_url":"git://github.com/serious6/ews-java-api.git","ssh_url":"git@github.com:serious6/ews-java-api.git","clone_url":"https://github.com/serious6/ews-java-api.git","svn_url":"https://github.com/serious6/ews-java-api","homepage":"","size":2419,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"OfficeDev:master","ref":"master","sha":"03db6b8ac0376ff5ddc624460150c7e9103cb065","user":{"login":"OfficeDev","id":6789362,"avatar_url":"https://avatars.githubusercontent.com/u/6789362?v=3","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"repo":{"id":23322482,"name":"ews-java-api","full_name":"OfficeDev/ews-java-api","owner":{"login":"OfficeDev","id":6789362,"avatar_url":"https://avatars.githubusercontent.com/u/6789362?v=3","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OfficeDev/ews-java-api","description":"A java client library to access Exchange web services.  The API works against Office 365 Exchange Online as well as on premises Exchange.","fork":false,"url":"https://api.github.com/repos/OfficeDev/ews-java-api","forks_url":"https://api.github.com/repos/OfficeDev/ews-java-api/forks","keys_url":"https://api.github.com/repos/OfficeDev/ews-java-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OfficeDev/ews-java-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OfficeDev/ews-java-api/teams","hooks_url":"https://api.github.com/repos/OfficeDev/ews-java-api/hooks","issue_events_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/events{/number}","events_url":"https://api.github.com/repos/OfficeDev/ews-java-api/events","assignees_url":"https://api.github.com/repos/OfficeDev/ews-java-api/assignees{/user}","branches_url":"https://api.github.com/repos/OfficeDev/ews-java-api/branches{/branch}","tags_url":"https://api.github.com/repos/OfficeDev/ews-java-api/tags","blobs_url":"https://api.github.com/repos/OfficeDev/ews-java-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OfficeDev/ews-java-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OfficeDev/ews-java-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/OfficeDev/ews-java-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OfficeDev/ews-java-api/statuses/{sha}","languages_url":"https://api.github.com/repos/OfficeDev/ews-java-api/languages","stargazers_url":"https://api.github.com/repos/OfficeDev/ews-java-api/stargazers","contributors_url":"https://api.github.com/repos/OfficeDev/ews-java-api/contributors","subscribers_url":"https://api.github.com/repos/OfficeDev/ews-java-api/subscribers","subscription_url":"https://api.github.com/repos/OfficeDev/ews-java-api/subscription","commits_url":"https://api.github.com/repos/OfficeDev/ews-java-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/OfficeDev/ews-java-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/OfficeDev/ews-java-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/OfficeDev/ews-java-api/contents/{+path}","compare_url":"https://api.github.com/repos/OfficeDev/ews-java-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OfficeDev/ews-java-api/merges","archive_url":"https://api.github.com/repos/OfficeDev/ews-java-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OfficeDev/ews-java-api/downloads","issues_url":"https://api.github.com/repos/OfficeDev/ews-java-api/issues{/number}","pulls_url":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls{/number}","milestones_url":"https://api.github.com/repos/OfficeDev/ews-java-api/milestones{/number}","notifications_url":"https://api.github.com/repos/OfficeDev/ews-java-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OfficeDev/ews-java-api/labels{/name}","releases_url":"https://api.github.com/repos/OfficeDev/ews-java-api/releases{/id}","created_at":"2014-08-25T17:33:09Z","updated_at":"2015-02-07T18:36:44Z","pushed_at":"2015-02-07T18:36:44Z","git_url":"git://github.com/OfficeDev/ews-java-api.git","ssh_url":"git@github.com:OfficeDev/ews-java-api.git","clone_url":"https://github.com/OfficeDev/ews-java-api.git","svn_url":"https://github.com/OfficeDev/ews-java-api","homepage":"","size":4644,"stargazers_count":103,"watchers_count":103,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":67,"forks":78,"open_issues":67,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196"},"html":{"href":"https://github.com/OfficeDev/ews-java-api/pull/196"},"issue":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/196"},"comments":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/OfficeDev/ews-java-api/statuses/5f35f5cd3ce9c62e2f801bbd802ff22e8abc8e03"}}}}