Skip to content

Commit 63cb4fa

Browse files
committed
Merge branch 'checkstyle' into appidentity
2 parents 52f74d2 + a034ddb commit 63cb4fa

17 files changed

Lines changed: 42 additions & 34 deletions

File tree

appengine/analytics/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<plugin>
4545
<groupId>com.google.appengine</groupId>
4646
<artifactId>gcloud-maven-plugin</artifactId>
47-
<version>2.0.9.89.v20151202</version>
47+
<version>2.0.9.90.v20151210</version>
4848
<configuration>
4949
<promote>true</promote>
5050
</configuration>

appengine/appidentity/src/main/java/com/example/appengine/appidentity/IdentityServlet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* Copyright 2015 Google Inc. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.example.appengine.appidentity;
1718

1819
import com.google.apphosting.api.ApiProxy;

appengine/appidentity/src/main/java/com/example/appengine/appidentity/UrlShortener.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* Copyright 2016 Google Inc. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.example.appengine.appidentity;
1718

1819
import com.google.appengine.api.appidentity.AppIdentityService;
@@ -41,8 +42,8 @@ class UrlShortener {
4142
public String createShortUrl(String longUrl) throws Exception {
4243
ArrayList<String> scopes = new ArrayList<String>();
4344
scopes.add("https://www.googleapis.com/auth/urlshortener");
44-
AppIdentityService appIdentity = AppIdentityServiceFactory.getAppIdentityService();
45-
AppIdentityService.GetAccessTokenResult accessToken = appIdentity.getAccessToken(scopes);
45+
final AppIdentityService appIdentity = AppIdentityServiceFactory.getAppIdentityService();
46+
final AppIdentityService.GetAccessTokenResult accessToken = appIdentity.getAccessToken(scopes);
4647
// The token asserts the identity reported by appIdentity.getServiceAccountName()
4748
JSONObject request = new JSONObject();
4849
request.put("longUrl", longUrl);
@@ -61,7 +62,7 @@ public String createShortUrl(String longUrl) throws Exception {
6162
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
6263
// Note: Should check the content-encoding.
6364
// Any JSON parser can be used; this one is used for illustrative purposes.
64-
JSONTokener response_tokens = new JSONTokener(connection.getInputStream());
65+
JSONTokener responseTokens = new JSONTokener(connection.getInputStream());
6566
JSONObject response = new JSONObject(response_tokens);
6667
return (String) response.get("id");
6768
} else {

appengine/appidentity/src/main/java/com/example/appengine/appidentity/UrlShortenerServlet.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* Copyright 2016 Google Inc. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.example.appengine.appidentity;
1718

1819
import com.google.appengine.api.users.UserService;
@@ -36,15 +37,16 @@ public UrlShortenerServlet() {
3637

3738
@Override
3839
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
39-
PrintWriter w = resp.getWriter();
40-
w.println("<!DOCTYPE html>");
41-
w.println("<meta charset=\"utf-8\">");
42-
w.println("<title>Asserting Identity to Google APIs - App Engine App Identity Example</title>");
43-
w.println("<form method=\"post\">");
44-
w.println("<label for=\"longUrl\">URL:</label>");
45-
w.println("<input id=\"longUrl\" name=\"longUrl\" type=\"text\">");
46-
w.println("<input type=\"submit\" value=\"Shorten\">");
47-
w.println("</form>");
40+
PrintWriter writer = resp.getWriter();
41+
writer.println("<!DOCTYPE html>");
42+
writer.println("<meta charset=\"utf-8\">");
43+
writer.println(
44+
"<title>Asserting Identity to Google APIs - App Engine App Identity Example</title>");
45+
writer.println("<form method=\"post\">");
46+
writer.println("<label for=\"longUrl\">URL:</label>");
47+
writer.println("<input id=\"longUrl\" name=\"longUrl\" type=\"text\">");
48+
writer.println("<input type=\"submit\" value=\"Shorten\">");
49+
writer.println("</form>");
4850
}
4951

5052
@Override
@@ -57,19 +59,19 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
5759
}
5860

5961
String shortUrl;
60-
PrintWriter w = resp.getWriter();
62+
PrintWriter writer = resp.getWriter();
6163
try {
6264
shortUrl = shortener.createShortUrl(longUrl);
6365
} catch (Exception e) {
6466
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
65-
w.println("error shortening URL: " + longUrl);
67+
writer.println("error shortening URL: " + longUrl);
6668
e.printStackTrace(w);
6769
return;
6870
}
6971

70-
w.print("long URL: ");
71-
w.println(longUrl);
72-
w.print("short URL: ");
73-
w.println(shortUrl);
72+
writer.print("long URL: ");
73+
writer.println(longUrl);
74+
writer.print("short URL: ");
75+
writer.println(shortUrl);
7476
}
7577
}

appengine/cloudsql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<plugin>
4747
<groupId>com.google.appengine</groupId>
4848
<artifactId>gcloud-maven-plugin</artifactId>
49-
<version>2.0.9.89.v20151202</version>
49+
<version>2.0.9.90.v20151210</version>
5050
<configuration>
5151
<promote>true</promote>
5252
</configuration>

appengine/cloudstorage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<plugin>
4545
<groupId>com.google.appengine</groupId>
4646
<artifactId>gcloud-maven-plugin</artifactId>
47-
<version>2.0.9.89.v20151202</version>
47+
<version>2.0.9.90.v20151210</version>
4848
<configuration>
4949
<promote>true</promote>
5050
</configuration>

appengine/datastore/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<plugin>
4545
<groupId>com.google.appengine</groupId>
4646
<artifactId>gcloud-maven-plugin</artifactId>
47-
<version>2.0.9.89.v20151202</version>
47+
<version>2.0.9.90.v20151210</version>
4848
<configuration>
4949
<promote>true</promote>
5050
</configuration>

appengine/disk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<plugin>
4040
<groupId>com.google.appengine</groupId>
4141
<artifactId>gcloud-maven-plugin</artifactId>
42-
<version>2.0.9.89.v20151202</version>
42+
<version>2.0.9.90.v20151210</version>
4343
</plugin>
4444
</plugins>
4545
</build>

appengine/extending-runtime/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<plugin>
4444
<groupId>com.google.appengine</groupId>
4545
<artifactId>gcloud-maven-plugin</artifactId>
46-
<version>2.0.9.89.v20151202</version>
46+
<version>2.0.9.90.v20151210</version>
4747
<configuration>
4848
<!-- TODO: change to relative paths when gcloud plugin supports them -->
4949
<custom_entrypoint>java

appengine/helloworld-mvm/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<plugin>
4040
<groupId>com.google.appengine</groupId>
4141
<artifactId>gcloud-maven-plugin</artifactId>
42-
<version>2.0.9.89.v20151202</version>
42+
<version>2.0.9.90.v20151210</version>
4343
</plugin>
4444
</plugins>
4545
</build>

0 commit comments

Comments
 (0)