{"action":"created","comment":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments/61560732","id":61560732,"diff_hunk":"@@ -0,0 +1,85 @@\n+/*\n+ * Copyright 2016 Google Inc. All rights reserved.\n+ *\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n+ * file except in compliance with the License. You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed under\n+ * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n+ * ANY KIND, either express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+\n+package com.google.maps;\n+\n+import com.google.appengine.api.urlfetch.FetchOptions;\n+import com.google.appengine.api.urlfetch.HTTPMethod;\n+import com.google.appengine.api.urlfetch.HTTPRequest;\n+import com.google.appengine.api.urlfetch.URLFetchService;\n+import com.google.appengine.api.urlfetch.URLFetchServiceFactory;\n+import com.google.gson.FieldNamingPolicy;\n+import com.google.maps.internal.ApiResponse;\n+import com.google.maps.internal.GaePendingResult;\n+\n+import java.net.MalformedURLException;\n+import java.net.Proxy;\n+import java.net.URL;\n+import java.util.concurrent.TimeUnit;\n+import java.util.logging.Level;\n+import java.util.logging.Logger;\n+\n+/**\n+ * A strategy for handling requests using Google App Engine.\n+ *\n+ * @see com.google.maps.GeoApiContext.RequestHandler\n+ */\n+public class GaeRequestHandler implements GeoApiContext.RequestHandler {\n+  private static final Logger LOG = Logger.getLogger(GaeRequestHandler.class.getName());\n+  private final URLFetchService client = URLFetchServiceFactory.getURLFetchService();\n+\n+  @Override\n+  public <T, R extends ApiResponse<T>> PendingResult<T> handle(String hostName, String url, String userAgent, Class<R> clazz, FieldNamingPolicy fieldNamingPolicy, long errorTimeout) {\n+    FetchOptions fetchOptions = FetchOptions.Builder.withDeadline(10);\n+    HTTPRequest req = null;\n+    try {\n+      req = new HTTPRequest(new URL(hostName + url), HTTPMethod.POST, fetchOptions);\n+    } catch (MalformedURLException e) {\n+      LOG.log(Level.SEVERE, \"Requesting '\"+hostName + url+\"'\", e);\n+    }\n+\n+    return new GaePendingResult<T, R>(req, client, clazz, fieldNamingPolicy, errorTimeout);","path":"src/main/java/com/google/maps/GaeRequestHandler.java","position":53,"original_position":53,"commit_id":"7755784e0072403dd2c6e28db3877843ac20b177","original_commit_id":"7755784e0072403dd2c6e28db3877843ac20b177","user":{"login":"samthor","id":119184,"avatar_url":"https://avatars.githubusercontent.com/u/119184?v=3","gravatar_id":"","url":"https://api.github.com/users/samthor","html_url":"https://github.com/samthor","followers_url":"https://api.github.com/users/samthor/followers","following_url":"https://api.github.com/users/samthor/following{/other_user}","gists_url":"https://api.github.com/users/samthor/gists{/gist_id}","starred_url":"https://api.github.com/users/samthor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samthor/subscriptions","organizations_url":"https://api.github.com/users/samthor/orgs","repos_url":"https://api.github.com/users/samthor/repos","events_url":"https://api.github.com/users/samthor/events{/privacy}","received_events_url":"https://api.github.com/users/samthor/received_events","type":"User","site_admin":false},"body":"I'm slightly concerned that passing `null` here for `req` could just end to further bad things down the line.","created_at":"2016-04-29T10:50:21Z","updated_at":"2016-04-29T10:50:21Z","html_url":"https://github.com/googlemaps/google-maps-services-java/pull/154#discussion_r61560732","pull_request_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments/61560732"},"html":{"href":"https://github.com/googlemaps/google-maps-services-java/pull/154#discussion_r61560732"},"pull_request":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154","id":68346270,"html_url":"https://github.com/googlemaps/google-maps-services-java/pull/154","diff_url":"https://github.com/googlemaps/google-maps-services-java/pull/154.diff","patch_url":"https://github.com/googlemaps/google-maps-services-java/pull/154.patch","issue_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/154","number":154,"state":"open","locked":false,"title":"App engine support","user":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"body":"PTAL @broady @samthor @markmcd \r\n\r\n/cc @lmoroney \r\n\r\nThis PR is based on code authored by @ZiglioNZ ","created_at":"2016-04-29T09:39:44Z","updated_at":"2016-04-29T10:50:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5255ab112d3fb5879824c584ff9eb40a2809b6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154/commits","review_comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154/comments","review_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/154/comments","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/7755784e0072403dd2c6e28db3877843ac20b177","head":{"label":"domesticmouse:app-engine-support","ref":"app-engine-support","sha":"7755784e0072403dd2c6e28db3877843ac20b177","user":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"repo":{"id":54615361,"name":"google-maps-services-java","full_name":"domesticmouse/google-maps-services-java","owner":{"login":"domesticmouse","id":30503,"avatar_url":"https://avatars.githubusercontent.com/u/30503?v=3","gravatar_id":"","url":"https://api.github.com/users/domesticmouse","html_url":"https://github.com/domesticmouse","followers_url":"https://api.github.com/users/domesticmouse/followers","following_url":"https://api.github.com/users/domesticmouse/following{/other_user}","gists_url":"https://api.github.com/users/domesticmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/domesticmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domesticmouse/subscriptions","organizations_url":"https://api.github.com/users/domesticmouse/orgs","repos_url":"https://api.github.com/users/domesticmouse/repos","events_url":"https://api.github.com/users/domesticmouse/events{/privacy}","received_events_url":"https://api.github.com/users/domesticmouse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/domesticmouse/google-maps-services-java","description":"Java client library for Google Maps API Web Services","fork":true,"url":"https://api.github.com/repos/domesticmouse/google-maps-services-java","forks_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/forks","keys_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/teams","hooks_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/hooks","issue_events_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/issues/events{/number}","events_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/events","assignees_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/assignees{/user}","branches_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/branches{/branch}","tags_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/tags","blobs_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/statuses/{sha}","languages_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/languages","stargazers_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/stargazers","contributors_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/contributors","subscribers_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/subscribers","subscription_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/subscription","commits_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/contents/{+path}","compare_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/merges","archive_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/downloads","issues_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/issues{/number}","pulls_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/pulls{/number}","milestones_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/milestones{/number}","notifications_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/labels{/name}","releases_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/releases{/id}","deployments_url":"https://api.github.com/repos/domesticmouse/google-maps-services-java/deployments","created_at":"2016-03-24T04:49:14Z","updated_at":"2016-03-24T04:49:15Z","pushed_at":"2016-04-29T09:43:42Z","git_url":"git://github.com/domesticmouse/google-maps-services-java.git","ssh_url":"git@github.com:domesticmouse/google-maps-services-java.git","clone_url":"https://github.com/domesticmouse/google-maps-services-java.git","svn_url":"https://github.com/domesticmouse/google-maps-services-java","homepage":"","size":1126,"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":"googlemaps:master","ref":"master","sha":"0964d0dd9c6c09484f387c70db74574d56a6b633","user":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"repo":{"id":22978651,"name":"google-maps-services-java","full_name":"googlemaps/google-maps-services-java","owner":{"login":"googlemaps","id":3717923,"avatar_url":"https://avatars.githubusercontent.com/u/3717923?v=3","gravatar_id":"","url":"https://api.github.com/users/googlemaps","html_url":"https://github.com/googlemaps","followers_url":"https://api.github.com/users/googlemaps/followers","following_url":"https://api.github.com/users/googlemaps/following{/other_user}","gists_url":"https://api.github.com/users/googlemaps/gists{/gist_id}","starred_url":"https://api.github.com/users/googlemaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlemaps/subscriptions","organizations_url":"https://api.github.com/users/googlemaps/orgs","repos_url":"https://api.github.com/users/googlemaps/repos","events_url":"https://api.github.com/users/googlemaps/events{/privacy}","received_events_url":"https://api.github.com/users/googlemaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlemaps/google-maps-services-java","description":"Java client library for Google Maps API Web Services","fork":false,"url":"https://api.github.com/repos/googlemaps/google-maps-services-java","forks_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/forks","keys_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/teams","hooks_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/hooks","issue_events_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/events{/number}","events_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/events","assignees_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/assignees{/user}","branches_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/branches{/branch}","tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/tags","blobs_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/languages","stargazers_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/stargazers","contributors_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/contributors","subscribers_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/subscribers","subscription_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/subscription","commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/contents/{+path}","compare_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/merges","archive_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/downloads","issues_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues{/number}","pulls_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/labels{/name}","releases_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/releases{/id}","deployments_url":"https://api.github.com/repos/googlemaps/google-maps-services-java/deployments","created_at":"2014-08-15T04:35:21Z","updated_at":"2016-04-28T08:30:54Z","pushed_at":"2016-04-29T09:43:42Z","git_url":"git://github.com/googlemaps/google-maps-services-java.git","ssh_url":"git@github.com:googlemaps/google-maps-services-java.git","clone_url":"https://github.com/googlemaps/google-maps-services-java.git","svn_url":"https://github.com/googlemaps/google-maps-services-java","homepage":"","size":1503,"stargazers_count":339,"watchers_count":339,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":264,"mirror_url":null,"open_issues_count":16,"forks":264,"open_issues":16,"watchers":339,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154"},"html":{"href":"https://github.com/googlemaps/google-maps-services-java/pull/154"},"issue":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/154"},"comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/googlemaps/google-maps-services-java/statuses/7755784e0072403dd2c6e28db3877843ac20b177"}}}}