Skip to content

Commit 2778e6a

Browse files
committed
Merge pull request #119 from GoogleCloudPlatform/checkstyle
Checkstyle fixes for async-rest sample.
2 parents 11adc54 + 0f33dac commit 2778e6a

File tree

9 files changed

+229
-348
lines changed

9 files changed

+229
-348
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "java-repo-tools"]
2+
path = java-repo-tools
3+
url = https://github.com/GoogleCloudPlatform/java-repo-tools.git

google-checks.xml

-201
This file was deleted.

java-repo-tools

Submodule java-repo-tools added at 5c9a316

managed_vms/async-rest/pom.xml

+16-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
<artifactId>managed-vms-async-rest</artifactId>
55
<version>1.0.0-SNAPSHOT</version>
66
<packaging>war</packaging>
7-
<name>Example Async Rest Webapp</name>
7+
8+
<parent>
9+
<artifactId>doc-samples</artifactId>
10+
<groupId>com.google.cloud</groupId>
11+
<version>1.0.0</version>
12+
<relativePath>../..</relativePath>
13+
</parent>
14+
815
<properties>
916
<places.appkey>YOUR_PLACES_APP_KEY</places.appkey>
1017
<jetty.version>9.3.7.v20160115</jetty.version>
@@ -26,25 +33,24 @@
2633
<version>${jetty.version}</version>
2734
<configuration>
2835
<systemProperties>
29-
<systemProperty>
36+
<systemProperty>
3037
<name>com.google.appengine.demos.asyncrest.appKey</name>
3138
<value>${places.appkey}</value>
32-
</systemProperty>
39+
</systemProperty>
3340
</systemProperties>
3441
</configuration>
3542
</plugin>
3643
<plugin>
3744
<groupId>com.google.appengine</groupId>
3845
<artifactId>gcloud-maven-plugin</artifactId>
39-
<version>2.0.9.96.v20160203</version>
46+
<version>2.0.9.95.v20160203</version>
4047
<configuration>
41-
<gcloud_directory>/usr/local/google-cloud-sdk</gcloud_directory>
42-
<verbosity>debug</verbosity>
43-
<log_level>debug</log_level>
44-
<non_docker_mode>false</non_docker_mode>
45-
<docker_build>remote</docker_build>
48+
<verbosity>debug</verbosity>
49+
<log_level>debug</log_level>
50+
<non_docker_mode>false</non_docker_mode>
51+
<docker_build>remote</docker_build>
4652
</configuration>
47-
</plugin>
53+
</plugin>
4854
<plugin>
4955
<groupId>org.apache.maven.plugins</groupId>
5056
<artifactId>maven-war-plugin</artifactId>

managed_vms/async-rest/src/main/java/com/google/appengine/demos/DumpServlet.java

+48-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.appengine.demos;
218

319
import java.io.IOException;
@@ -13,9 +29,8 @@
1329
public class DumpServlet extends HttpServlet {
1430

1531
@Override
16-
protected void doGet(HttpServletRequest request,
17-
HttpServletResponse response) throws ServletException,
18-
IOException {
32+
protected void doGet(HttpServletRequest request, HttpServletResponse response)
33+
throws ServletException, IOException {
1934
response.setContentType("text/html");
2035
response.setStatus(HttpServletResponse.SC_OK);
2136

@@ -28,19 +43,42 @@ protected void doGet(HttpServletRequest request,
2843
out.printf("getServletContextName=%s%n", getServletContext().getServletContextName());
2944
out.printf("virtualServerName=%s%n", getServletContext().getVirtualServerName());
3045
out.printf("contextPath=%s%n", getServletContext().getContextPath());
31-
out.printf("version=%d.%d%n", getServletContext().getMajorVersion(), getServletContext().getMinorVersion());
32-
out.printf("effectiveVersion=%d.%d%n", getServletContext().getEffectiveMajorVersion(), getServletContext().getEffectiveMinorVersion());
46+
out.printf(
47+
"version=%d.%d%n",
48+
getServletContext().getMajorVersion(),
49+
getServletContext().getMinorVersion());
50+
out.printf(
51+
"effectiveVersion=%d.%d%n",
52+
getServletContext().getEffectiveMajorVersion(),
53+
getServletContext().getEffectiveMinorVersion());
3354
out.println("</pre>");
3455
out.println("<h2>Request Fields:</h2>");
3556
out.println("<pre>");
36-
out.printf("remoteHost/Addr:port=%s/%s:%d%n", request.getRemoteHost(), request.getRemoteAddr(), request.getRemotePort());
37-
out.printf("localName/Addr:port=%s/%s:%d%n", request.getLocalName(), request.getLocalAddr(), request.getLocalPort());
38-
out.printf("scheme=%s method=%s protocol=%s%n", request.getScheme(), request.getMethod(), request.getProtocol());
57+
out.printf(
58+
"remoteHost/Addr:port=%s/%s:%d%n",
59+
request.getRemoteHost(),
60+
request.getRemoteAddr(),
61+
request.getRemotePort());
62+
out.printf(
63+
"localName/Addr:port=%s/%s:%d%n",
64+
request.getLocalName(),
65+
request.getLocalAddr(),
66+
request.getLocalPort());
67+
out.printf(
68+
"scheme=%s method=%s protocol=%s%n",
69+
request.getScheme(),
70+
request.getMethod(),
71+
request.getProtocol());
3972
out.printf("serverName:serverPort=%s:%d%n", request.getServerName(), request.getServerPort());
4073
out.printf("requestURI=%s%n", request.getRequestURI());
4174
out.printf("requestURL=%s%n", request.getRequestURL().toString());
42-
out.printf("contextPath|servletPath|pathInfo=%s|%s|%s%n", request.getContextPath(), request.getServletPath(), request.getPathInfo());
43-
out.printf("session/new=%s/%b%n", request.getSession(true).getId(), request.getSession().isNew());
75+
out.printf(
76+
"contextPath|servletPath|pathInfo=%s|%s|%s%n",
77+
request.getContextPath(),
78+
request.getServletPath(),
79+
request.getPathInfo());
80+
out.printf(
81+
"session/new=%s/%b%n", request.getSession(true).getId(), request.getSession().isNew());
4482
out.println("</pre>");
4583
out.println("<h2>Request Headers:</h2>");
4684
out.println("<pre>");

0 commit comments

Comments
 (0)