Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ protected String fillSelectionScriptTemplate(StringBuffer ss, TreeLogger logger,
}
}
if (failIfScriptTags) {
// CHECKSTYLE_OFF
String msg =
"The " + getDescription()
+ " linker does not support <script> tags in the gwt.xml files, but the"
Expand All @@ -129,7 +128,6 @@ protected String fillSelectionScriptTemplate(StringBuffer ss, TreeLogger logger,
+ " this error, you will need to remove the script tags from the"
+ " gwt.xml file, or add this property to the gwt.xml file:"
+ " <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>";
// CHECKSTYLE_ON
logger.log(TreeLogger.ERROR, msg);
throw new UnableToCompleteException();
} else {
Expand Down Expand Up @@ -436,13 +434,15 @@ protected String getModulePrefix(TreeLogger logger, LinkerContext context, Strin
out.print("function __gwtStartLoadingFragment(frag) {");
out.newlineOpt();
String fragDir = getFragmentSubdir(logger, context) + '/';
out.print("var fragFile = '" + fragDir + "' + $strongName + '/' + frag + '" + FRAGMENT_EXTENSION + "';");
out.print("var fragFile = '" + fragDir + "' + $strongName + '/' + frag + '"
+ FRAGMENT_EXTENSION + "';");
out.newlineOpt();
out.print("return __gwtModuleFunction.__startLoadingFragment(fragFile);");
out.newlineOpt();
out.print("}");
out.newlineOpt();
out.print("function __gwtInstallCode(code) {return __gwtModuleFunction.__installRunAsyncCode(code);}");
out.print("function __gwtInstallCode(code) {"
+ "return __gwtModuleFunction.__installRunAsyncCode(code);}");
out.newlineOpt();

// The functions for property access are set up in the bootstrap script however
Expand Down Expand Up @@ -617,9 +617,9 @@ protected void maybeOutputPropertyMap(TreeLogger logger, LinkerContext context,
EmittedArtifact serializedMap;
try {
String mappings = mappingArtifact.getSerialized();
// CHECKSTYLE_OFF
mappings = mappings.concat("Devmode:" + getHostedFilename());
// CHECKSTYLE_ON
@SuppressWarnings("checkstyle:SpaceAfterColon")
String str = "Devmode:" + getHostedFilename();
mappings = mappings.concat(str);
serializedMap = emitString(logger, mappings, "compilation-mappings.txt");
// TODO(unnurg): make this Deploy
serializedMap.setVisibility(Visibility.Public);
Expand Down Expand Up @@ -682,7 +682,6 @@ protected String wrapPrimaryFragment(TreeLogger logger, LinkerContext context, S
out.append("if (" + context.getModuleFunctionName() + ".succeeded) {\n");
}


if (shouldInstallCode(context)) {
// Rewrite the code so it can be installed with
// __MODULE_FUNC__.onScriptDownloaded
Expand Down
6 changes: 2 additions & 4 deletions dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@

import javax.lang.model.SourceVersion;

// CHECKSTYLE_NAMING_OFF

/**
* Configures a module definition object using XML.
*/
@SuppressWarnings({"checkstyle:MemberName", "checkstyle:MethodName"})
public class ModuleDefSchema extends Schema {

private final class BodySchema extends Schema {
Expand Down Expand Up @@ -299,7 +298,7 @@ protected Schema __collapse_property_begin(PropertyName name,
return null;
}

@SuppressWarnings("unused") // called reflectively
@SuppressWarnings({"unused", "checkstyle:ParameterName"}) // called reflectively
protected Schema __define_configuration_property_begin(PropertyName name,
String is_multi_valued) throws UnableToCompleteException {
boolean isMultiValued = toPrimitiveBoolean(is_multi_valued);
Expand Down Expand Up @@ -1513,4 +1512,3 @@ private JsFunction parseJsBlock(int startLineNumber, String script)
return fn;
}
}
// CHECKSTYLE_NAMING_ON
3 changes: 1 addition & 2 deletions dev/core/src/com/google/gwt/dev/jjs/impl/MethodInliner.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,8 @@ private InlineResult tryInlineBody(JMethodCall x, Context ctx,
return InlineResult.DO_NOT_BLACKLIST;
}
}
// CHECKSTYLE_OFF: Fall through!
// fall through!
case CORRECT_ORDER:
// CHECKSTYLE_ON
default:
if (!x.hasSideEffects()) {
markCallsAsSideEffectFree(bodyAsExpressionList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
/**
* Produces text output from a JavaScript AST.
*/
@SuppressWarnings("checkstyle:MethodName")
public class JsToStringGenerationVisitor extends JsVisitor {

private static final char[] CHARS_BREAK = "break".toCharArray();
Expand Down Expand Up @@ -888,8 +889,6 @@ public boolean visit(JsWhile x, JsContext ctx) {
return false;
}

//CHECKSTYLE_NAMING_OFF

protected void _newline() {
p.newline();
}
Expand Down Expand Up @@ -1308,8 +1307,6 @@ private void _while() {
p.print(CHARS_WHILE);
}

// CHECKSTYLE_NAMING_ON

private void indent() {
p.indentIn();
}
Expand Down
37 changes: 15 additions & 22 deletions dev/core/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ private void printInternedDataAsJs(PrintWriter outFile) {
+ "See why it's live</a></li>\");");
outFile.println(" for (var sp = 1; sp <= "
+ globalInformation.getNumFragments() + "; sp++) {");
outFile.println(" var d2 = 'methodDependencies-sp' + sp + '-" + getPermutationId() + ".html';");
outFile.println(" var d2 = 'methodDependencies-sp' + sp + '-"
+ getPermutationId() + ".html';");
outFile.println(" document.write(\"<li><a href='\" + d2 + \"#\" + className +\"'>"
+ " See why it's not exclusive to s.p. #\" + sp + \" (\" + spl[sp - 1] + \")"
+ "</a></li>\");");
Expand Down Expand Up @@ -786,10 +787,7 @@ public void makeCodeTypeClassesHtmls(SizeBreakdown breakdown)
outFile.println("<td>" + className + "</a></td>");
outFile.println("<td class=\"soyc-bargraph-col\">");
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
// CHECKSTYLE_OFF
outFile.println("<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
// CHECKSTYLE_ON
outFile.println(getProgressBarHtml(perc));
outFile.println("</div>");
outFile.println("</td>");
outFile.println("<td class=\"soyc-numerical-col\">");
Expand Down Expand Up @@ -1137,10 +1135,7 @@ public void makePackageClassesHtmls(SizeBreakdown breakdown,
}
outFile.println("<td class=\"soyc-bargraph-col\">");
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
// CHECKSTYLE_OFF
outFile.println("<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
// CHECKSTYLE_ON
outFile.println(getProgressBarHtml(perc));
outFile.println("</div>");
outFile.println("</td>");
outFile.println("<td class=\"soyc-numerical-col\">");
Expand Down Expand Up @@ -1314,10 +1309,7 @@ public void makeTopLevelShell() throws IOException {
+ "</a></td>");
outFile.println("<td class=\"soyc-bargraph-col\">");
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
// CHECKSTYLE_OFF
outFile.println("<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
// CHECKSTYLE_ON
outFile.println(getProgressBarHtml(perc));
outFile.println("</div>");
outFile.println("</td>");
outFile.println("<td class=\"soyc-numerical-col\">");
Expand All @@ -1335,6 +1327,12 @@ public void makeTopLevelShell() throws IOException {
outFile.close();
}

@SuppressWarnings("checkstyle:SpaceAfterColon")
private String getProgressBarHtml(float perc) {
return "<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>";
}

private void addPopup(PrintWriter outFile, String popupName,
String popupTitle, String popupBody) {
outFile.println("<div class=\"soyc-popup\" id=\"" + popupName + "\">");
Expand Down Expand Up @@ -1391,7 +1389,8 @@ private String getPermutationId() {
private String[] getUnreferencedTypes(
PrecompilationMetricsArtifact precompilationMetrics) {
List<String> astTypes = Lists.newArrayList(precompilationMetrics.getAstTypes());
Set<String> unreferencedTypes = Sets.newHashSet(precompilationMetrics.getFinalTypeOracleTypes());
Set<String> unreferencedTypes = Sets.newHashSet(
precompilationMetrics.getFinalTypeOracleTypes());
unreferencedTypes.removeAll(astTypes);
String[] results = unreferencedTypes.toArray(new String[unreferencedTypes.size()]);
Arrays.sort(results);
Expand Down Expand Up @@ -1515,10 +1514,7 @@ private String makeCodeTypeHtml(SizeBreakdown breakdown,
+ "\" target=\"_top\">" + codeType + "</a></td>");
outFile.println("<td class=\"soyc-bargraph-col\">");
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
// CHECKSTYLE_OFF
outFile.println("<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
// CHECKSTYLE_ON
outFile.println(getProgressBarHtml(perc));
outFile.println("</div>");
outFile.println("</td>");
outFile.println("<td class=\"soyc-numerical-col\">");
Expand Down Expand Up @@ -1814,10 +1810,7 @@ private String makePackageHtml(SizeBreakdown breakdown) throws IOException {
+ "\" target=\"_top\">" + packageName + "</a></td>");
outFile.println("<td class=\"soyc-bargraph-col\">");
outFile.println("<div class=\"soyc-bar-graph goog-inline-block\">");
// CHECKSTYLE_OFF
outFile.println("<div style=\"width:" + (perc * 100.0)
+ "%;\" class=\"soyc-bar-graph-fill goog-inline-block\"></div>");
// CHECKSTYLE_ON
outFile.println(getProgressBarHtml(perc));
outFile.println("</div>");
outFile.println("</td>");
outFile.println("<td class=\"soyc-numerical-col\">");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

import javaemul.internal.annotations.HasNoSideEffects;

// CHECKSTYLE_NAMING_OFF: Uses legacy conventions of underscore prefixes.

/**
* This is a magic class the compiler uses to perform any cast operations that require code.<br />
*
* The cast operations are only as accurate as the contents of the castableTypeMaps and should not
* be used directly by user code. The compiler takes care to record most cast operations in user
* code so that it can build limited but accurate castableTypeMaps.
*/
@SuppressWarnings("checkstyle:MethodName")
final class Cast {

/**
Expand Down Expand Up @@ -393,5 +392,3 @@ static native Class<?> getClass(Object array) /*-{
|| @JavaScriptObject::class;
}-*/;
}

// CHECKSTYLE_NAMING_ON
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* This is a magic class the compiler uses to throw and check exceptions.
*/
@SuppressWarnings("checkstyle:MethodName")
final class Exceptions {

@DoNotInline // This frame can be useful in understanding the native stack
Expand Down Expand Up @@ -59,7 +60,6 @@ static AssertionError makeAssertionError() {
* We use nonstandard naming here so it's easy for the compiler to map to
* method names based on primitive type name.
*/
// CHECKSTYLE_OFF
static AssertionError makeAssertionError_boolean(boolean message) {
return new AssertionError(message);
}
Expand Down Expand Up @@ -131,5 +131,4 @@ static Throwable safeClose(AutoCloseable resource, Throwable mainException) {
}
return mainException;
}
// CHECKSTYLE_ON
}
33 changes: 5 additions & 28 deletions eclipse/settings/code-style/gwt-checkstyle-tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A more lenient set of style checks for test cases, needed because test often nee
<module name="Checker">
<property name="severity" value="warning"/>
<module name="RegexpHeader">
<property name="fileExtensions" value="java"/>
<property name="fileExtensions" value="java"/>
<property name="severity" value="error"/>
<property name="header" value="^/\*[ ]*$\n^ \* Copyright 20(0[6789]|[12][0-9]) (Google Inc\.|GWT Project Authors)$\n^ \*[ ]*$\n^ \* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\); you may not( use this file except)?$\n^ \* (use this file except )?in compliance with the License\. You may obtain a copy of( the License at)?$\n^ \* 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 the License)?$\n^ \* (distributed under the License )?is distributed on an &quot;AS IS&quot; BASIS, WITHOUT( WARRANTIES OR CONDITIONS OF ANY KIND, either express)?$\n^ \* (WARRANTIES OR CONDITIONS OF ANY KIND, either express )?or implied\. See the( License for the specific language governing permissions and limitations under)?$\n^ \* License for the specific language governing permissions and limitations under$\n^ \* the License\.$\n^ \*/$"/>
<property name="multiLines" value="6,13"/>
Expand All @@ -22,7 +22,8 @@ A more lenient set of style checks for test cases, needed because test often nee
<property name="severity" value="error"/>
</module>
<module name="TreeWalker">
<property name="fileExtensions" value="java"/>
<property name="fileExtensions" value="java"/>
<module name="SuppressWarningsHolder" />
<module name="InterfaceIsType">
<metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
<property name="severity" value="ignore"/>
Expand Down Expand Up @@ -53,7 +54,7 @@ A more lenient set of style checks for test cases, needed because test often nee
<module name="LocalVariableName">
<metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
<property name="severity" value="ignore"/>
<property name="tokens" value="PARAMETER_DEF,VARIABLE_DEF"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<module name="LeftCurly"/>
<module name="RightCurly"/>
Expand Down Expand Up @@ -119,13 +120,6 @@ A more lenient set of style checks for test cases, needed because test often nee
<property name="severity" value="ignore"/>
<property name="classes" value="Boolean"/>
</module>
<module name="Regexp">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="check that a space is left after a colon with an assembled error message"/>
<property name="severity" value="info"/>
<property name="format" value="[^:^&quot;]:&quot; .*+"/>
<property name="message" value="check that a space is left after a colon on an assembled error message"/>
<property name="illegalPattern" value="true"/>
</module>
<module name="Regexp">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="more than one blank line"/>
<property name="severity" value="info"/>
Expand Down Expand Up @@ -211,24 +205,6 @@ A more lenient set of style checks for test cases, needed because test often nee
</module>
<module name="RedundantModifier"/>
<module name="EqualsHashCode"/>
<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="MethodName"/>
</module>
<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="MemberName"/>
</module>
<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="ParameterName"/>
</module>
</module>
<module name="SuppressWithPlainTextCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_OFF"/>
Expand All @@ -237,4 +213,5 @@ A more lenient set of style checks for test cases, needed because test often nee
<module name="JavadocPackage">
<property name="severity" value="ignore"/>
</module>
<module name="SuppressWarningsFilter" />
</module>
25 changes: 5 additions & 20 deletions eclipse/settings/code-style/gwt-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Description:
</module>
<module name="TreeWalker">
<property name="fileExtensions" value="java"/>
<module name="InterfaceIsType">
<module name="SuppressWarningsHolder" />
<module name="InterfaceIsType">
<property name="severity" value="ignore"/>
</module>
<module name="RedundantImport">
Expand Down Expand Up @@ -115,6 +116,8 @@ Description:
<module name="Regexp">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="check that a space is left after a colon with an assembled error message"/>
<property name="severity" value="info"/>
<property name="id" value="SpaceAfterColon"/>
<property name="ignoreComments" value="true"/>
<property name="format" value="[^:^&quot;]:&quot; .*+"/>
<property name="message" value="check that a space is left after a colon on an assembled error message"/>
<property name="illegalPattern" value="true"/>
Expand Down Expand Up @@ -195,25 +198,6 @@ Description:
</module>
<module name="RedundantModifier"/>
<module name="EqualsHashCode"/>

<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="MethodName"/>
</module>
<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="MemberName"/>
</module>
<module name="SuppressionCommentFilter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Avoid name checking"/>
<property name="offCommentFormat" value="CHECKSTYLE_NAMING_OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE_NAMING_ON"/>
<property name="checkFormat" value="ParameterName"/>
</module>
</module>
<module name="SuppressWithPlainTextCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_OFF"/>
Expand All @@ -222,4 +206,5 @@ Description:
<module name="JavadocPackage">
<property name="severity" value="ignore"/>
</module>
<module name="SuppressWarningsFilter" />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ public String parse(CharSequence text) throws ParseException {
switch (text.length()) {
case 9:
text = text.subSequence(0, 5) + "-" + text.subSequence(5, 9);
// Fall-though intentional
// CHECKSTYLE_OFF
/* fall-through intentional */
case 5:
// Fall-through intentional
case 10:
// CHECKSTYLE_ON
if (PATTERN.test(text.toString())) {
return text.toString();
} else {
Expand Down
Loading
Loading