8000 Revert "Checkstyle fixes for async-rest sample." · zenlambda/java-docs-samples@e51a33b · GitHub
[go: up one dir, main page]

Skip to content

Commit e51a33b

Browse files
committed
Revert "Checkstyle fixes for async-rest sample."
1 parent 5648e3a commit e51a33b

File tree

9 files changed

+348
-229
lines changed

9 files changed

+348
-229
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

google-checks.xml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5+
6+
<!--
7+
Checkstyle configuration that checks the Google coding conventions from:
8+
9+
- Google Java Style
10+
https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
11+
12+
Checkstyle is very configurable. Be sure to read the documentation at
13+
http://checkstyle.sf.net (or in your downloaded distribution).
14+
Most Checks are configurable, be sure to consult the documentation.
15+
To completely disable a check, just comment it out or delete it from the file.
16+
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
17+
18+
-->
19+
20+
<module name = "Checker">
21+
<property name="charset" value="UTF-8"/>
22+
23+
<property name="severity" value="error"/>
24+
25+
<property name="fileExtensions" value="java, properties, xml"/>
26+
<!-- Checks for whitespace -->
27+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
28+
<module name="FileTabCharacter">
29+
<property name="eachLine" value="true"/>
30+
</module>
31+
32+
<module name="TreeWalker">
33+
<module name="UnusedImports"/>
34+
<module name="OuterTypeFilename"/>
35+
<module name="IllegalTokenText">
36+
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
37+
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
38+
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
39+
</module>
40+
<module name="AvoidEscapedUnicodeCharacters">
41+
<property name="allowEscapesForControlCharacters" value="true"/>
42+
<property name="allowByTailComment" value="true"/>
43+
<property name="allowNonPrintableEscapes" value="true"/>
44+
</module>
45+
<module name="LineLength">
46+
<property name="max" value="100"/>
47+
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
48+
</module>
49+
<module name="AvoidStarImport"/>
50+
<module name="OneTopLevelClass"/>
51+
<module name="NoLineWrap"/>
52+
<module name="EmptyBlock">
53+
<property name="option" value="TEXT"/>
54+
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
55+
</module>
56+
<module name="NeedBraces"/>
57+
<module name="LeftCurly">
58+
<property name="maxLineLength" value="100"/>
59+
</module>
60+
<module name="RightCurly"/>
61+
<module name="RightCurly">
62+
<property name="option" value="alone"/>
63+
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
64+
</module>
65+
<module name="WhitespaceAround">
66+
<property name="allowEmptyConstructors" value="true"/>
67+
<property name="allowEmptyMethods" value="true"/>
68+
<property name="allowEmptyTypes" value="true"/>
69+
<property name="allowEmptyLoops" value="true"/>
70+
<message key="ws.notFollowed"
71+
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
72+
<message key="ws.notPreceded"
73+
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
74+
</module>
75+
<module name="OneStatementPerLine"/>
76+
<module name="MultipleVariableDeclarations"/>
77+
<module name="ArrayTypeStyle"/>
78+
<module name="MissingSwitchDefault"/>
79+
<module name="FallThrough"/>
80+
<module name="UpperEll"/>
81+
<module name="ModifierOrder"/>
82+
<module name="EmptyLineSeparator">
83+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
84+
<property name="tokens" value="CLASS_DEF, ENUM_DEF, INTERFACE_DEF, CTOR_DEF, METHOD_DEF, STATIC_INIT, INSTANCE_INIT, VARIABLE_DEF" />
85+
</module>
86+
<module name="SeparatorWrap">
87+
<property name="tokens" value="DOT"/>
88+
<property name="option" value="nl"/>
89+
</module>
90+
<module name="SeparatorWrap">
91+
<property name="tokens" value="COMMA"/>
92+
<property name="option" value="EOL"/>
93+
</module>
94+
<module name="PackageName">
95+
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
96+
<message key="name.invalidPattern"
97+
value="Package name ''{0}'' must match pattern ''{1}''."/>
98+
</module>
99+
<module name="TypeName">
100+
<message key="name.invalidPattern"
101+
value="Type name ''{0}'' must match pattern ''{1}''."/>
102+
</module>
103+
<module name="MemberName">
104+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
105+
<message key="name.invalidPattern"
106+
value="Member name ''{0}'' must match pattern ''{1}''."/>
107+
</module>
108+
<module name="ParameterName">
109+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
110+
<message key="name.invalidPattern"
111+
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
112+
</module>
113+
<module name="LocalVariableName">
114+
<property name="tokens" value="VARIABLE_DEF"/>
115+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
116+
<property name="allowOneCharVarInForLoop" value="true"/>
117+
<message key="name.invalidPattern"
118+
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
119+
</module>
120+
<module name="ClassTypeParameterName">
121+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
122+
<message key="name.invalidPattern"
123+
value="Class type name ''{0}'' must match pattern ''{1}''."/>
124+
</module>
125+
<module name="MethodTypeParameterName">
126+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
127+
<message key="name.invalidPattern"
128+
value="Method type name ''{0}'' must match pattern ''{1}''."/>
129+
</module>
130+
<module name="NoFinalizer"/>
131+
<module name="GenericWhitespace">
132+
<message key="ws.followed"
133+
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
134+
<message key="ws.preceded"
135+
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
136+
<message key="ws.illegalFollow"
137+
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
138+
<message key="ws.notPreceded"
139+
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
140+
</module>
141+
<module name="Indentation">
142+
<property name="basicOffset" value="2"/>
143+
<property name="braceAdjustment" value="0"/>
144+
<property name="caseIndent" value="2"/>
145+
<property name="throwsIndent" value="4"/>
146+
<property name="lineWrappingIndentation" value="4"/>
147+
<property name="arrayInitIndent" value="2"/>
148+
</module>
149+
<module name="AbbreviationAsWordInName">
150+
<property name="ignoreFinal" value="false"/>
151+
<property name="allowedAbbreviationLength" value="1"/>
152+
</module>
153+
<module name="OverloadMethodsDeclarationOrder"/>
154+
<module name="CustomImportOrder">
155+
<property name="specialImportsRegExp" value="com.google"/>
156+
<property name="sortImportsInGroupAlphabetically" value="true"/>
157+
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
158+
</module>
159+
<module name="MethodParamPad"/>
160+
<module name="OperatorWrap">
161+
<property name="option" value="NL"/>
162+
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
163+
</module>
164+
<module name="AnnotationLocation">
165+
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
166+
</module>
167+
<module name="AnnotationLocation">
168+
<property name="tokens" value="VARIABLE_DEF"/>
169+
<property name="allowSamelineMultipleAnnotations" value="true"/>
170+
</module>
171+
<module name="NonEmptyAtclauseDescription"/>
172+
<module name="JavadocTagContinuationIndentation"/>
173+
<module name="SummaryJavadocCheck">
174+
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
175+
</module>
176+
<module name="AtclauseOrder">
177+
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
178+
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
179+
</module>
180+
<module name="JavadocMethod">
181+
<property name="scope" value="public"/>
182+
<property name="allowMissingParamTags" value="true"/>
183+
<property name="allowMissingThrowsTags" value="true"/>
184+
<property name="allowMissingReturnTag" value="true"/>
185+
<property name="minLineCount" value="2"/>
186+
<property name="allowedAnnotations" value="Override, Test"/>
187+
<property name="allowThrowsTagsForSubclasses" value="true"/>
188+
</module>
189+
<module name="MethodName">
190+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
191+
<message key="name.invalidPattern"
192+
value="Method name ''{0}'' must match pattern ''{1}''."/>
193+
</module>
194+
<module name="SingleLineJavadoc">
195+
<property name="ignoreInlineTags" value="false"/>
196+
</module>
197+
<module name="EmptyCatchBlock">
198+
<property name="exceptionVariableName" value="expected"/>
199+
</module>
200+
</module>
201+
</module>

java-repo-tools

Lines changed: 0 additions & 1 deletion
This file was deleted.

managed_vms/async-rest/pom.xml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@
44
<artifactId>managed-vms-async-rest</artifactId>
55
<version>1.0.0-SNAPSHOT</version>
66
<packaging>war</packaging>
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-
7+
<name>Example Async Rest Webapp</name>
158
<properties>
169
<places.appkey>YOUR_PLACES_APP_KEY</places.appkey>
1710
<jetty.version>9.3.7.v20160115</jetty.version>
@@ -33,24 +26,25 @@
3326
<version>${jetty.version}</version>
3427
<configuration>
3528
<systemProperties>
36-
<systemProperty>
29+
<systemProperty>
3730
<name>com.google.appengine.demos.asyncrest.appKey</name>
3831
<value>${places.appkey}</value>
39-
</systemProperty>
32+
</systemProperty>
4033
</systemProperties>
4134
</configuration>
4235
</plugin>
4336
<plugin>
4437
<groupId>com.google.appengine</groupId>
4538
<artifactId>gcloud-maven-plugin</artifactId>
46-
<version>2.0.9.95.v20160203</version>
39+
<version>2.0.9.96.v20160203</version>
4740
<configuration>
48-
<verbosity>debug</verbosity>
49-
<log_level>debug</log_level>
50-
<non_docker_mode>false</non_docker_mode>
51-
<docker_build>remote</docker_build>
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>
5246
</configuration>
53-
</plugin>
47+
</plugin>
5448
<plugin>
5549
<groupId>org.apache.maven.plugins</groupId>
5650
<artifactId>maven-war-plugin</artifactId>

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

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
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-
171
package com.google.appengine.demos;
182

193
import java.io.IOException;
@@ -29,8 +13,9 @@
2913
public class DumpServlet extends HttpServlet {
3014

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

@@ -43,42 +28,19 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
4328
out.printf("getServletContextName=%s%n", getServletContext().getServletContextName());
4429
out.printf("virtualServerName=%s%n", getServletContext().getVirtualServerName());
4530
out.printf("contextPath=%s%n", getServletContext().getContextPath());
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());
31+
out.printf("version=%d.%d%n", getServletContext().getMajorVersion(), getServletContext().getMinorVersion());
32+
out.printf("effectiveVersion=%d.%d%n", getServletContext().getEffectiveMajorVersion(), getServletContext().getEffectiveMinorVersion());
5433
out.println("</pre>");
5534
out.println("<h2>Request Fields:</h2>");
5635
out.println("<pre>");
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());
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());
7239
out.printf("serverName:serverPort=%s:%d%n", request.getServerName(), request.getServerPort());
7340
out.printf("requestURI=%s%n", request.getRequestURI());
7441
out.printf("requestURL=%s%n", request.getRequestURL().toString());
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());
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());
8244
out.println("</pre>");
8345
out.println("<h2>Request Headers:</h2>");
8446
out.println("<pre>");

0 commit comments

Comments
 (0)
0