Skip to content

Commit 5cb787a

Browse files
committed
Reduce the scope of some checkstyle suppressions
1 parent cc3dbfc commit 5cb787a

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,15 @@ protected String getModulePrefix(TreeLogger logger, LinkerContext context, Strin
434434
out.print("function __gwtStartLoadingFragment(frag) {");
435435
out.newlineOpt();
436436
String fragDir = getFragmentSubdir(logger, context) + '/';
437-
out.print("var fragFile = '" + fragDir + "' + $strongName + '/' + frag + '" + FRAGMENT_EXTENSION + "';");
437+
out.print("var fragFile = '" + fragDir + "' + $strongName + '/' + frag + '"
438+
+ FRAGMENT_EXTENSION + "';");
438439
out.newlineOpt();
439440
out.print("return __gwtModuleFunction.__startLoadingFragment(fragFile);");
440441
out.newlineOpt();
441442
out.print("}");
442443
out.newlineOpt();
443-
out.print("function __gwtInstallCode(code) {return __gwtModuleFunction.__installRunAsyncCode(code);}");
444+
out.print("function __gwtInstallCode(code) {"
445+
+ "return __gwtModuleFunction.__installRunAsyncCode(code);}");
444446
out.newlineOpt();
445447

446448
// The functions for property access are set up in the bootstrap script however
@@ -600,7 +602,6 @@ protected void maybeAddHostedModeFile(TreeLogger logger, LinkerContext context,
600602

601603
// Output compilation-mappings.txt
602604
@Override
603-
@SuppressWarnings("checkstyle:SpaceAfterColon")
604605
protected void maybeOutputPropertyMap(TreeLogger logger, LinkerContext context,
605606
ArtifactSet toReturn) {
606607
if (permutationsUtil.getPermutationsMap() == null
@@ -616,7 +617,9 @@ protected void maybeOutputPropertyMap(TreeLogger logger, LinkerContext context,
616617
EmittedArtifact serializedMap;
617618
try {
618619
String mappings = mappingArtifact.getSerialized();
619-
mappings = mappings.concat("Devmode:" + getHostedFilename());
620+
@SuppressWarnings("checkstyle:SpaceAfterColon")
621+
String str = "Devmode:" + getHostedFilename();
622+
mappings = mappings.concat(str);
620623
serializedMap = emitString(logger, mappings, "compilation-mappings.txt");
621624
// TODO(unnurg): make this Deploy
622625
serializedMap.setVisibility(Visibility.Public);

dev/core/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
/**
5050
* A utility to make all the HTML files for one permutation.
5151
*/
52-
@SuppressWarnings("checkstyle:SpaceAfterColon")
5352
public class MakeTopLevelHtmlForPerm {
5453
/**
5554
* A dependency linker for the initial code download. It links to the
@@ -788,8 +787,7 @@ public void makeCodeTypeClassesHtmls(SizeBreakdown breakdown)
788787
outFile.println("<td>" + className + "</a></td>");
789788
outFile.println("<td class=\"soyc-bargraph-col\">");
790789
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
791-
outFile.println("<div style=\"width:" + (perc * 100.0)
792-
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
790+
outFile.println(getProgressBarHtml(perc));
793791
outFile.println("</div>");
794792
outFile.println("</td>");
795793
outFile.println("<td class=\"soyc-numerical-col\">");
@@ -1137,8 +1135,7 @@ public void makePackageClassesHtmls(SizeBreakdown breakdown,
11371135
}
11381136
outFile.println("<td class=\"soyc-bargraph-col\">");
11391137
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
1140-
outFile.println("<div style=\"width:" + (perc * 100.0)
1141-
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
1138+
outFile.println(getProgressBarHtml(perc));
11421139
outFile.println("</div>");
11431140
outFile.println("</td>");
11441141
outFile.println("<td class=\"soyc-numerical-col\">");
@@ -1312,8 +1309,7 @@ public void makeTopLevelShell() throws IOException {
13121309
+ "</a></td>");
13131310
outFile.println("<td class=\"soyc-bargraph-col\">");
13141311
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
1315-
outFile.println("<div style=\"width:" + (perc * 100.0)
1316-
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
1312+
outFile.println(getProgressBarHtml(perc));
13171313
outFile.println("</div>");
13181314
outFile.println("</td>");
13191315
outFile.println("<td class=\"soyc-numerical-col\">");
@@ -1331,6 +1327,12 @@ public void makeTopLevelShell() throws IOException {
13311327
outFile.close();
13321328
}
13331329

1330+
@SuppressWarnings("checkstyle:SpaceAfterColon")
1331+
private String getProgressBarHtml(float perc) {
1332+
return "<div style=\"width:" + (perc * 100.0)
1333+
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>";
1334+
}
1335+
13341336
private void addPopup(PrintWriter outFile, String popupName,
13351337
String popupTitle, String popupBody) {
13361338
outFile.println("<div class=\"soyc-popup\" id=\"" + popupName + "\">");
@@ -1512,8 +1514,7 @@ private String makeCodeTypeHtml(SizeBreakdown breakdown,
15121514
+ "\" target=\"_top\">" + codeType + "</a></td>");
15131515
outFile.println("<td class=\"soyc-bargraph-col\">");
15141516
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
1515-
outFile.println("<div style=\"width:" + (perc * 100.0)
1516-
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
1517+
outFile.println(getProgressBarHtml(perc));
15171518
outFile.println("</div>");
15181519
outFile.println("</td>");
15191520
outFile.println("<td class=\"soyc-numerical-col\">");
@@ -1809,8 +1810,7 @@ private String makePackageHtml(SizeBreakdown breakdown) throws IOException {
18091810
+ "\" target=\"_top\">" + packageName + "</a></td>");
18101811
outFile.println("<td class=\"soyc-bargraph-col\">");
18111812
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
1812-
outFile.println("<div style=\"width:" + (perc * 100.0)
1813-
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
1813+
outFile.println(getProgressBarHtml(perc));
18141814
outFile.println("</div>");
18151815
outFile.println("</td>");
18161816
outFile.println("<td class=\"soyc-numerical-col\">");

eclipse/settings/code-style/gwt-checkstyle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Description:
117117
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="check that a space is left after a colon with an assembled error message"/>
118118
<property name="severity" value="info"/>
119119
<property name="id" value="SpaceAfterColon"/>
120+
<property name="ignoreComments" value="true"/>
120121
<property name="format" value="[^:^&quot;]:&quot; .*+"/>
121122
<property name="message" value="check that a space is left after a colon on an assembled error message"/>
122123
<property name="illegalPattern" value="true"/>

user/src/com/google/gwt/resources/rebind/context/InlineResourceContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class InlineResourceContext extends StaticResourceContext {
3232
}
3333

3434
@Override
35-
@SuppressWarnings("checkstyle:SpaceAfterColon")
3635
public String deploy(String suggestedFileName, String mimeType, byte[] data,
3736
boolean forceExternal) throws UnableToCompleteException {
3837
TreeLogger logger = getLogger();
@@ -42,7 +41,7 @@ public String deploy(String suggestedFileName, String mimeType, byte[] data,
4241
logger.log(TreeLogger.DEBUG, "Inlining", null);
4342

4443
String base64Contents = toBase64(data);
45-
44+
@SuppressWarnings("checkstyle:SpaceAfterColon")
4645
String encoded = "\"data:" + mimeType.replaceAll("\"", "\\\\\"")
4746
+ ";base64," + base64Contents + "\"";
4847

user/src/com/google/gwt/resources/rebind/context/MhtmlClientBundleGenerator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ protected AbstractResourceContext createResourceContext(TreeLogger logger,
4949
}
5050

5151
@Override
52-
@SuppressWarnings("checkstyle:SpaceAfterColon")
5352
protected void doAddFieldsAndRequirements(TreeLogger logger,
5453
GeneratorContext generatorContext, FieldsImpl fields,
5554
ClientBundleRequirements requirements) throws UnableToCompleteException {

user/src/com/google/gwt/resources/rebind/context/MhtmlResourceContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public class MhtmlResourceContext extends StaticResourceContext {
6464
}
6565

6666
@Override
67-
@SuppressWarnings("checkstyle:SpaceAfterColon")
6867
public String deploy(String suggestedFileName, String mimeType, byte[] data,
6968
boolean forceExternal) throws UnableToCompleteException {
7069

@@ -105,7 +104,9 @@ public String deploy(String suggestedFileName, String mimeType, byte[] data,
105104

106105
pw.println("--" + BOUNDARY);
107106
pw.println("Content-Id:<" + location + ">");
108-
pw.println("Content-Type:" + mimeType);
107+
@SuppressWarnings("checkstyle:SpaceAfterColon")
108+
String contentTypeHeader = "Content-Type:" + mimeType;
109+
pw.println(contentTypeHeader);
109110
pw.println("Content-Transfer-Encoding:base64");
110111
pw.println();
111112
pw.println(base64);

0 commit comments

Comments
 (0)