Author: Thomas Broyer <t.broyer@gmail.com>

Remove Checkstyle custom checks.

- OrderCheck: we decided to get rid of it.
- FieldCheck: replaced by a simple MemberName check
- GwtHeaderCheck: replaced by a RegexpHeader check with a nasty regexp.
The check is slightly relaxed with the optional (or repeated) lines
(required to support both 80-char and 100-char long lines), but the
regexps themselves are strengthened with explicit start and end of line
markers (a few files then needed fixing).

Change-Id: I9baddfaaab27180ed0a5a75be2708497fd13ccba
Review-Link: https://gwt-review.googlesource.com/#/c/1051/


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11343 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build-tools/build.xml b/build-tools/build.xml
index f81b120..beef5b9 100644
--- a/build-tools/build.xml
+++ b/build-tools/build.xml
@@ -10,15 +10,11 @@
     <gwt.ant dir="ant-gwt" />
   </target>
 
-  <target name="customchecks" description="Build the checkstyle extensions">
-    <gwt.ant dir="customchecks" />
-  </target>
-  
   <target name="doctool" description="Build the doctool">
     <gwt.ant dir="doctool" />
   </target>
 
-  <target name="-do" depends="ant-gwt, customchecks, doctool" description="Run all subprojects"/>
+  <target name="-do" depends="ant-gwt, doctool" description="Run all subprojects"/>
   
   <target name="build" description="Builds GWT">
     <antcall target="-do">
diff --git a/build-tools/customchecks/build.xml b/build-tools/customchecks/build.xml
deleted file mode 100644
index f929b2d..0000000
--- a/build-tools/customchecks/build.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<project name="customchecks" default="build" basedir=".">
-  <property name="gwt.root" location="../.." />
-  <property name="project.tail" value="build-tools/customchecks" />
-  <import file="${gwt.root}/common.ant.xml" />
-
-  <target name="compile" description="Compiles this project">
-    <mkdir dir="${javac.out}" />
-    <gwt.javac>
-      <classpath>
-        <pathelement location="${gwt.tools.antlib}/checkstyle-all-4.2.jar" />
-      </classpath>
-    </gwt.javac>
-  </target>
-
-  <target name="build" depends="compile" description="Packages this project into a jar">
-    <mkdir dir="${gwt.build.lib}" />
-    <gwt.jar>
-      <fileset dir="src" />
-      <fileset dir="${javac.out}" />
-    </gwt.jar>
-  </target>
-
-  <target name="checkstyle">
-    <!-- NOTE: This project doesn't have the checkstyle rule since it participates in bootstrapping. -->
-  </target>
-
-  <target name="clean" description="Cleans this project's intermediate and output files">
-    <delete dir="${project.build}" />
-    <delete file="${project.lib}" />
-  </target>
-
-</project>
diff --git a/build-tools/customchecks/src/com/google/gwt/checkstyle/CustomRegexpHeaderCheck.java b/build-tools/customchecks/src/com/google/gwt/checkstyle/CustomRegexpHeaderCheck.java
deleted file mode 100644
index f08a2bd..0000000
--- a/build-tools/customchecks/src/com/google/gwt/checkstyle/CustomRegexpHeaderCheck.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-// //////////////////////////////////////////////////////////////////////////////
-// checkstyle: Checks Java source code for adherence to a set of rules.
-// Copyright (C) 2001-2005 Oliver Burn
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-// //////////////////////////////////////////////////////////////////////////////
-package com.google.gwt.checkstyle;
-
-import com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck;
-import com.puppycrawl.tools.checkstyle.api.DetailAST;
-import com.puppycrawl.tools.checkstyle.api.Utils;
-
-import org.apache.commons.beanutils.ConversionException;
-
-import java.util.Arrays;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * Custom version of {@link RegexpHeaderCheck} that has hooks for a custom log handler (see
- * {@link CustomLogHandler}).
- * <p>
- * This is an exact copy of {@link RegexpHeaderCheck} with three exceptions:
- * <ol>
- * <li>{@link CustomLogHandler} has been added for custom log callbacks.</li>
- * <li>{@link #doChecks(CustomLogHandler)} has been added for custom checks. This method is an exact
- * copy of {@link RegexpHeaderCheck#beginTree(DetailAST)} except all log calls have been replaced
- * with a call to a custom log handler.</li>
- * <li>{@link #beginTree(DetailAST)} has been refactored to call
- * {@link #doChecks(CustomLogHandler)}.
- * </ol>
- */
-public class CustomRegexpHeaderCheck extends RegexpHeaderCheck {
-  /**
-   * Custom log handler callback.
-   */
-  abstract static class CustomLogHandler {
-    abstract void log(int aLine, String aKey);
-
-    abstract void log(int aLine, String aKey, Object aObject);
-  }
-
-  // empty array to avoid instantiations.
-  private static final int[] EMPTY_INT_ARRAY = new int[0];
-
-  // the header lines to repeat (0 or more) in the check, sorted.
-  private int[] mMultiLines = EMPTY_INT_ARRAY;
-
-  // the compiled regular expressions
-  private Pattern[] mHeaderRegexps;
-
-  /**
-   * {@inheritDoc}
-   */
-  public void beginTree(DetailAST aRootAST) {
-    doChecks(new CustomLogHandler() {
-      @Override
-      void log(int aLine, String aKey) {
-        CustomRegexpHeaderCheck.this.log(aLine, aKey);
-      }
-      @Override
-      void log(int aLine, String aKey, Object aObject) {
-        CustomRegexpHeaderCheck.this.log(aLine, aKey, aObject);
-      }
-    });
-  }
-
-  /**
-   * Check the current file using the same method as {@link RegexpHeaderCheck#beginTree(DetailAST)}
-   * but pass all logging calls through a custom log handler (@see {@link CustomLogHandler}).
-   * 
-   * @param logHandler the custom log handler, or <code>null</code> to suppress logging.
-   */
-  public void doChecks(CustomLogHandler logHandler) {
-    // With the exception of the logging hooks, the following is copied from
-    // RegexpHeaderCheck.beginTree().
-
-    final int headerSize = getHeaderLines().length;
-    final int fileSize = getLines().length;
-
-    if (headerSize - mMultiLines.length > fileSize) {
-      if (logHandler != null) {
-        logHandler.log(1, "gwtheader.missing", null);
-      }
-    } else {
-      int headerLineNo = 0;
-      int i;
-      for (i = 0; (headerLineNo < headerSize) && (i < fileSize); i++) {
-        boolean isMatch = isMatch(i, headerLineNo);
-        while (!isMatch && isMultiLine(headerLineNo)) {
-          headerLineNo++;
-          isMatch = (headerLineNo == headerSize) || isMatch(i, headerLineNo);
-        }
-        if (!isMatch) {
-          if (logHandler != null) {
-            logHandler.log(i + 1, "gwtheader.mismatch", getHeaderLines()[headerLineNo]);
-          }
-          break; // stop checking
-        }
-        if (!isMultiLine(headerLineNo)) {
-          headerLineNo++;
-        }
-      }
-      if (i == fileSize) {
-        // if file finished, but we have at least one non-multi-line
-        // header isn't completed
-        for (; headerLineNo < headerSize; headerLineNo++) {
-          if (!isMultiLine(headerLineNo)) {
-            if (logHandler != null) {
-              logHandler.log(1, "gwtheader.missing");
-            }
-            break;
-          }
-        }
-      }
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setHeader(String aHeader) {
-    super.setHeader(aHeader);
-    initHeaderRegexps();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setHeaderFile(String aFileName) throws ConversionException {
-    super.setHeaderFile(aFileName);
-    initHeaderRegexps();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setMultiLines(int[] aList) {
-    if ((aList == null) || (aList.length == 0)) {
-      mMultiLines = EMPTY_INT_ARRAY;
-      return;
-    }
-
-    mMultiLines = new int[aList.length];
-    System.arraycopy(aList, 0, mMultiLines, 0, aList.length);
-    Arrays.sort(mMultiLines);
-  }
-
-  /**
-   * Initializes {@link #mHeaderRegexps} from {@link AbstractHeaderCheck#getHeaderLines()}.
-   */
-  private void initHeaderRegexps() {
-    final String[] headerLines = getHeaderLines();
-    if (headerLines != null) {
-      mHeaderRegexps = new Pattern[headerLines.length];
-      for (int i = 0; i < headerLines.length; i++) {
-        try {
-          // todo: Not sure if chache in Utils is still necessary
-          mHeaderRegexps[i] = Utils.getPattern(headerLines[i]);
-        } catch (final PatternSyntaxException ex) {
-          throw new ConversionException("line " + i + " in header specification"
-              + " is not a regular expression");
-        }
-      }
-    }
-  }
-
-  /**
-   * Checks if a code line matches the required header line.
-   * 
-   * @param aLineNo the line number to check against the header
-   * @param aHeaderLineNo the header line number.
-   * @return true if and only if the line matches the required header line.
-   */
-  private boolean isMatch(int aLineNo, int aHeaderLineNo) {
-    final String line = getLines()[aLineNo];
-    return mHeaderRegexps[aHeaderLineNo].matcher(line).find();
-  }
-
-  /**
-   * @param aLineNo a line number
-   * @return if <code>aLineNo</code> is one of the repeat header lines.
-   */
-  private boolean isMultiLine(int aLineNo) {
-    return (Arrays.binarySearch(mMultiLines, aLineNo + 1) >= 0);
-  }
-}
\ No newline at end of file
diff --git a/build-tools/customchecks/src/com/google/gwt/checkstyle/FieldCheck.java b/build-tools/customchecks/src/com/google/gwt/checkstyle/FieldCheck.java
deleted file mode 100644
index 4044209..0000000
--- a/build-tools/customchecks/src/com/google/gwt/checkstyle/FieldCheck.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2006 Google Inc.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.checkstyle;
-
-import com.puppycrawl.tools.checkstyle.api.DetailAST;
-import com.puppycrawl.tools.checkstyle.api.TokenTypes;
-import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck;
-
-/**
- * Override MemberNameCheck to correctly use match rather than find.
- */
-public class FieldCheck extends MemberNameCheck {
-  public FieldCheck() {
-    // Specifically stopping fields such as fMainWnd from being allowed.
-    setFormat("([a-eg-z]|(f[a-z0-9]))[a-zA-Z0-9]*");
-  }
-
-  public void visitToken(DetailAST aAST) {
-    if (mustCheckName(aAST)) {
-      final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT);
-      if (!getRegexp().matcher(nameAST.getText()).matches()) {
-        log(
-            nameAST.getLineNo(),
-            nameAST.getText()
-                + ": Field names must start with [a-z], may not start with f[A-Z], and should not contain '_''s.");
-      }
-    }
-  }
-}
diff --git a/build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java b/build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java
deleted file mode 100644
index 0457136..0000000
--- a/build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.checkstyle;
-
-import com.google.gwt.checkstyle.CustomRegexpHeaderCheck.CustomLogHandler;
-
-import com.puppycrawl.tools.checkstyle.api.Check;
-import com.puppycrawl.tools.checkstyle.api.DetailAST;
-
-/**
- * Checks the header against one of two header options, to support GWT's 80 and 100 column headers.
- * <p>
- * To use, set <code>&lt;property name="header" value="[regular expression]" /&gt;</code> and
- * <code>&lt;property name="headerAlt" value="[alternate regular expression]" /&gt;</code>
- */
-public class GwtHeaderCheck extends Check {
-  private CustomRegexpHeaderCheck regexpChecker = new CustomRegexpHeaderCheck();
-  private CustomRegexpHeaderCheck regexpCheckerAlt = new CustomRegexpHeaderCheck();
-
-  public void beginTree(DetailAST aRootAST) {
-    final boolean[] passedChecks = new boolean[]{true};
-    regexpChecker.setFileContents(this.getFileContents());
-    regexpChecker.doChecks(new CustomLogHandler() {
-      @Override
-      void log(int aLine, String aKey) {
-        passedChecks[0] = false;
-      }
-
-      @Override
-      void log(int aLine, String aKey, Object aObject) {
-        passedChecks[0] = false;
-      }
-    });
-    if (passedChecks[0]) {
-      // regexpChecker passed, no need to run alternate checker
-      return;
-    }
-
-    regexpCheckerAlt.setFileContents(this.getFileContents());
-    regexpCheckerAlt.doChecks(new CustomLogHandler() {
-      @Override
-      void log(int aLine, String aKey) {
-        GwtHeaderCheck.this.log(aLine, aKey);
-      }
-
-      @Override
-      void log(int aLine, String aKey, Object aObject) {
-        GwtHeaderCheck.this.log(aLine, aKey, aObject);
-      }
-    });
-  }
-
-  @Override
-  public int[] getDefaultTokens() {
-    return new int[0];
-  }
-
-  /**
-   * Set the header to check against. Individual lines in the header must be separated by '\n'
-   * characters.
-   * 
-   * @param aHeader header content to check against.
-   */
-  public void setHeader(String aHeader) {
-    regexpChecker.setHeader(aHeader);
-  }
-
-  /**
-   * Set the alternate header to check against. Individual lines in the header must be separated by
-   * '\n' characters.
-   * 
-   * @param aHeader header content to check against.
-   */
-  public void setHeaderAlt(String aHeader) {
-    regexpCheckerAlt.setHeader(aHeader);
-  }
-}
\ No newline at end of file
diff --git a/build-tools/customchecks/src/com/google/gwt/checkstyle/OrderCheck.java b/build-tools/customchecks/src/com/google/gwt/checkstyle/OrderCheck.java
deleted file mode 100644
index 5e69331..0000000
--- a/build-tools/customchecks/src/com/google/gwt/checkstyle/OrderCheck.java
+++ /dev/null
@@ -1,215 +0,0 @@
-// CHECKSTYLE_OFF:Must use GNU license for code based on checkstyle
-// /////////////////////////////////////////////////////////////////////////////
-// checkstyle: Checks Java source code for adherence to a set of rules.
-// Copyright (C) 2001-2005 Oliver Burn
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-// //////////////////////////////////////////////////////////////////////////////
-// CHECKSTYLE_ON
-
-// This class is based upon the
-// com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck
-
-package com.google.gwt.checkstyle;
-
-import com.puppycrawl.tools.checkstyle.api.Check;
-import com.puppycrawl.tools.checkstyle.api.DetailAST;
-import com.puppycrawl.tools.checkstyle.api.Scope;
-import com.puppycrawl.tools.checkstyle.api.ScopeUtils;
-import com.puppycrawl.tools.checkstyle.api.TokenTypes;
-
-import java.util.Stack;
-
-/**
- * Checks that the parts of a class or interface declaration appear in the order
- * specified by the 'Making GWT better' style guide.
- */
-
-public class OrderCheck extends Check {
-  /**
-   * Encapsulate the state in each class scope in order to handle inner classes.
-   */
-  private static class ScopeState {
-    /**
-     * Current state.
-     */
-    private int state = State.TYPE;
-
-    /**
-     * Current access modifier for state.
-     */
-    private Scope visibility = Scope.PUBLIC;
-  }
-
-  /**
-   * Ordered category states for code elements.
-   */
-  private static class State {
-    private static final int TYPE = 0;
-    private static final int STATIC_FIELDS = 1;
-    private static final int STATIC_INITS = 2;
-    private static final int STATIC_METHODS = 3;
-    private static final int INSTANCE_FIELDS = 4;
-    private static final int INSTANCE_INITS = 5;
-    private static final int CONSTRUCTORS = 6;
-    private static final int INSTANCE_METHODS = 7;
-  }
-
-  /**
-   * List of Declaration States. This is necessary due to inner classes that
-   * have their own state.
-   */
-  private final Stack<ScopeState> classScopes = new Stack<ScopeState>();
-
-  /**
-   * Previous method name, used for alphabetical ordering.
-   */
-  private String previousMethodName;
-
-  public int[] getDefaultTokens() {
-    return new int[] {
-        TokenTypes.CTOR_DEF, TokenTypes.METHOD_DEF, TokenTypes.MODIFIERS,
-        TokenTypes.STATIC_INIT, TokenTypes.INSTANCE_INIT, TokenTypes.OBJBLOCK};
-  }
-
-  public void leaveToken(DetailAST aAST) {
-    switch (aAST.getType()) {
-      case TokenTypes.OBJBLOCK:
-        classScopes.pop();
-        previousMethodName = null;
-        break;
-      case TokenTypes.METHOD_DEF:
-        // If the previous method was in the same class, with the same
-        // modifiers, check that it is alphabetically before the current
-        // method.
-        String methodName = aAST.findFirstToken(TokenTypes.IDENT).getText();
-        if (previousMethodName != null
-            && (previousMethodName.compareToIgnoreCase(methodName)) > 0) {
-          log(aAST, methodName + " is not alphabetical.");
-        }
-        previousMethodName = methodName;
-        break;
-      default:
-    }
-  }
-
-  public void visitToken(DetailAST aAST) {
-    try {
-      int parentType = 0;
-      if (aAST.getParent() != null) {
-        parentType = aAST.getParent().getType();
-      }
-      switch (aAST.getType()) {
-        case TokenTypes.OBJBLOCK:
-          classScopes.push(new ScopeState());
-          previousMethodName = null;
-          break;
-
-        case TokenTypes.CTOR_DEF:
-          if (parentType != TokenTypes.OBJBLOCK) {
-            return;
-          }
-          checkState(aAST, State.CONSTRUCTORS, "Constructor");
-          break;
-
-        case TokenTypes.MODIFIERS:
-          if (parentType == TokenTypes.VARIABLE_DEF) {
-            checkVariable(aAST);
-          }
-          if (parentType == TokenTypes.METHOD_DEF) {
-            checkMethod(aAST);
-          }
-          break;
-        case TokenTypes.STATIC_INIT: {
-          checkState(aAST, State.STATIC_INITS, "Static initializer");
-          break;
-        }
-        case TokenTypes.INSTANCE_INIT: {
-          checkState(aAST, State.INSTANCE_INITS, "Instance initializer");
-        }
-          break;
-        default:
-      }
-    } catch (Throwable t) {
-      // CheckStyle swallows errors in general, we want OrderCheck errors to be
-      // visible.
-      t.printStackTrace();
-      throw new RuntimeException("Exception/Error in OrderCheck", t);
-    }
-  }
-
-  /**
-   * Check the modifiers of a method for order conflicts.
-   */
-  private void checkMethod(DetailAST aAST) {
-    if (aAST.getParent().getParent().getType() != TokenTypes.OBJBLOCK) {
-      return;
-    }
-    if (aAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
-      if (checkState(aAST, State.STATIC_METHODS, "Static method")) {
-        previousMethodName = null;
-      }
-    } else {
-      if (checkState(aAST, State.INSTANCE_METHODS, "Instance method")) {
-        previousMethodName = null;
-      }
-    }
-  }
-
-  /**
-   * Checks the category and visibility of declarations.
-   * 
-   * @return whether the state or visibility modifiers have changed
-   */
-  private boolean checkState(DetailAST aAST, int curState, String type) {
-    ScopeState scope = classScopes.peek();
-    if (scope.state > curState) {
-      log(aAST, type + " in wrong order.");
-      // Wrong type implies at least a temporary state switch.
-      return true;
-    } else if (scope.state == curState) {
-      final Scope curVisibility = ScopeUtils.getScopeFromMods(aAST);
-      if (scope.visibility.compareTo(curVisibility) > 0) {
-        log(aAST, curVisibility.getName() + " " + type
-            + " should not occur after " + scope.visibility.getName() + " "
-            + type);
-        return false;
-      } else if (scope.visibility != curVisibility) {
-        scope.visibility = curVisibility;
-        return true;
-      } else {
-        return false;
-      }
-    } else {
-      scope.state = curState;
-      scope.visibility = Scope.PUBLIC;
-      return true;
-    }
-  }
-
-  /**
-   * Check the modifiers of a variable for order conflicts.
-   */
-  private void checkVariable(DetailAST aAST) {
-    if (aAST.getParent().getParent().getType() != TokenTypes.OBJBLOCK) {
-      return;
-    }
-    if (aAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
-      checkState(aAST, State.STATIC_FIELDS, "Static field");
-    } else {
-      checkState(aAST, State.INSTANCE_FIELDS, "Instance field");
-    }
-  }
-}
\ No newline at end of file
diff --git a/build-tools/customchecks/src/com/google/gwt/checkstyle/messages.properties b/build-tools/customchecks/src/com/google/gwt/checkstyle/messages.properties
deleted file mode 100644
index 149391c..0000000
--- a/build-tools/customchecks/src/com/google/gwt/checkstyle/messages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-gwtheader.missing=Missing a header - not enough lines in file.
-gwtheader.mismatch=Line does not match expected header line of ''{0}''.
\ No newline at end of file
diff --git a/common.ant.xml b/common.ant.xml
index 2608186..dbb7514 100755
--- a/common.ant.xml
+++ b/common.ant.xml
@@ -337,7 +337,7 @@
     <attribute name="outputdirectory" default="${project.build}"/>
     <element name="sourcepath" implicit="yes" optional="true" />
     <sequential>
-      <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" />
+      <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar" />
       <mkdir dir="@{outputdirectory}"/>
       <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle.failed">
         <formatter type="xml" toFile="@{outputdirectory}/checkstyle_log.xml"/>
@@ -352,7 +352,7 @@
     <attribute name="outputdirectory" default="${project.build}"/>
     <element name="sourcepath" implicit="yes" optional="true" />
     <sequential>
-      <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" />
+      <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar" />
       <mkdir dir="@{outputdirectory}"/>
       <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle-tests.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle-tests.failed">
         <formatter type="xml" toFile="@{outputdirectory}/checkstyle_tests_log.xml"/>
diff --git a/dev/core/src/com/google/gwt/dev/DevelModeTabKey.java b/dev/core/src/com/google/gwt/dev/DevelModeTabKey.java
index f78b592..63f037e 100644
--- a/dev/core/src/com/google/gwt/dev/DevelModeTabKey.java
+++ b/dev/core/src/com/google/gwt/dev/DevelModeTabKey.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2009 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/Disconnectable.java b/dev/core/src/com/google/gwt/dev/Disconnectable.java
index ef42887..8c00318 100644
--- a/dev/core/src/com/google/gwt/dev/Disconnectable.java
+++ b/dev/core/src/com/google/gwt/dev/Disconnectable.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2009 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/ModulePanel.java b/dev/core/src/com/google/gwt/dev/ModulePanel.java
index a93957e..07ed37e 100644
--- a/dev/core/src/com/google/gwt/dev/ModulePanel.java
+++ b/dev/core/src/com/google/gwt/dev/ModulePanel.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2008 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/ModuleTabPanel.java b/dev/core/src/com/google/gwt/dev/ModuleTabPanel.java
index 434a0d5..95b5ddd 100644
--- a/dev/core/src/com/google/gwt/dev/ModuleTabPanel.java
+++ b/dev/core/src/com/google/gwt/dev/ModuleTabPanel.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2009 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/SessionModule.java b/dev/core/src/com/google/gwt/dev/SessionModule.java
index 7b25dbc..fb71456 100644
--- a/dev/core/src/com/google/gwt/dev/SessionModule.java
+++ b/dev/core/src/com/google/gwt/dev/SessionModule.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2009 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/WebServerPanel.java b/dev/core/src/com/google/gwt/dev/WebServerPanel.java
index 62a121d..3505a15 100644
--- a/dev/core/src/com/google/gwt/dev/WebServerPanel.java
+++ b/dev/core/src/com/google/gwt/dev/WebServerPanel.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2008 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java b/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
index 49a181d..edaffde 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
+++ b/dev/core/src/com/google/gwt/dev/shell/ShellMainWindow.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2008 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/util/BrowserInfo.java b/dev/core/src/com/google/gwt/dev/util/BrowserInfo.java
index 851eba6..d56513a 100644
--- a/dev/core/src/com/google/gwt/dev/util/BrowserInfo.java
+++ b/dev/core/src/com/google/gwt/dev/util/BrowserInfo.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2009 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/dev/core/src/com/google/gwt/dev/util/log/CompositeTreeLogger.java b/dev/core/src/com/google/gwt/dev/util/log/CompositeTreeLogger.java
index 7029c58..78f3149 100644
--- a/dev/core/src/com/google/gwt/dev/util/log/CompositeTreeLogger.java
+++ b/dev/core/src/com/google/gwt/dev/util/log/CompositeTreeLogger.java
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2008 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
diff --git a/eclipse/settings/code-style/gwt-checkstyle-tests.xml b/eclipse/settings/code-style/gwt-checkstyle-tests.xml
index d27c8e2..bbd1205 100644
--- a/eclipse/settings/code-style/gwt-checkstyle-tests.xml
+++ b/eclipse/settings/code-style/gwt-checkstyle-tests.xml
@@ -87,10 +87,10 @@
             <property name="logLoadErrors" value="true"/>
             <property name="tokens" value="METHOD_DEF"/>
         </module>
-        <module name="com.google.gwt.checkstyle.GwtHeaderCheck">
+        <module name="RegexpHeader">
            <property name="severity" value="error"/>
-           <property name="header" value="/\*\n \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\); you may not\n \* use this file except in compliance with the License\. You may obtain a copy of\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\n \* distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT\n \* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\. See the\n \* License for the specific language governing permissions and limitations under\n \* the License\.\n \*/"/>
-           <property name="headerAlt" value="/\*\n \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\); you may not use this file except\n \* in compliance with the License\. You may obtain a copy of 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 \* is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n \* or implied\. See the License for the specific language governing permissions and limitations under\n \* the License\.\n \*/"/>
+           <property name="header" value="^/\*[ ]*$\n^ \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.$\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"/>
        </module>
         <module name="ImportOrder">
             <property name="severity" value="error"/>
@@ -153,14 +153,6 @@
         <module name="AvoidStarImport">
             <property name="severity" value="error"/>
         </module>
-        <module name="com.google.gwt.checkstyle.OrderCheck">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
-            <property name="severity" value="ignore"/>
-        </module>
-        <module name="com.google.gwt.checkstyle.FieldCheck">
-            <metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
-            <property name="severity" value="ignore"/>
-        </module>
         <module name="GenericIllegalRegexp">
             <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="bad // comment"/>
             <property name="severity" value="error"/>
@@ -181,9 +173,10 @@
             <property name="format" value="^[a-z_][a-zA-Z0-9_]*$"/>
         </module>
         <module name="MemberName">
+            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Field names must start with [a-z], may not start with f[A-Z], and should not contain '_''s."/>
             <metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
             <property name="severity" value="ignore"/>
-            <property name="format" value="[a-z]|[a-z][a-z_0-9][A-Za-z0-9_]*|[a-z](?&lt;!f)[A-Z0-9]*"/>
+            <property name="format" value="^([a-eg-z]|(f[a-z0-9]))[a-zA-Z0-9]*$"/>
         </module>
         <module name="TodoComment">
             <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Author tags"/>
diff --git a/eclipse/settings/code-style/gwt-checkstyle.xml b/eclipse/settings/code-style/gwt-checkstyle.xml
index c3c30d3..0206954 100644
--- a/eclipse/settings/code-style/gwt-checkstyle.xml
+++ b/eclipse/settings/code-style/gwt-checkstyle.xml
@@ -80,10 +80,10 @@
             <property name="logLoadErrors" value="true"/>
             <property name="tokens" value="METHOD_DEF"/>
         </module>
-        <module name="com.google.gwt.checkstyle.GwtHeaderCheck">
+        <module name="RegexpHeader">
            <property name="severity" value="error"/>
-           <property name="header" value="/\*\n \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\); you may not\n \* use this file except in compliance with the License\. You may obtain a copy of\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\n \* distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT\n \* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\. See the\n \* License for the specific language governing permissions and limitations under\n \* the License\.\n \*/"/>
-           <property name="headerAlt" value="/\*\n \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\); you may not use this file except\n \* in compliance with the License\. You may obtain a copy of 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 \* is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n \* or implied\. See the License for the specific language governing permissions and limitations under\n \* the License\.\n \*/"/>
+           <property name="header" value="^/\*[ ]*$\n^ \* Copyright 20(0[6789]|[12][0-9]) Google Inc\.$\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"/>
        </module>
         <module name="ImportOrder">
             <property name="severity" value="error"/>
@@ -141,12 +141,6 @@
         <module name="AvoidStarImport">
             <property name="severity" value="error"/>
         </module>
-        <module name="com.google.gwt.checkstyle.OrderCheck">
-            <property name="severity" value="error"/>
-        </module>
-        <module name="com.google.gwt.checkstyle.FieldCheck">
-            <property name="severity" value="error"/>
-        </module>
         <module name="GenericIllegalRegexp">
             <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="bad // comment"/>
             <property name="severity" value="error"/>
@@ -163,8 +157,9 @@
             <property name="severity" value="error"/>
         </module>
         <module name="MemberName">
+            <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Field names must start with [a-z], may not start with f[A-Z], and should not contain '_''s."/>
             <property name="severity" value="error"/>
-            <property name="format" value="[a-z]|[a-z][a-z_0-9][A-Za-z0-9_]*|[a-z](?&lt;!f)[A-Z0-9]*"/>
+            <property name="format" value="^([a-eg-z]|(f[a-z0-9]))[a-zA-Z0-9]*$"/>
         </module>
         <module name="TodoComment">
             <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Author tags"/>
diff --git a/eclipse/settings/code-style/gwt-customchecks.jar b/eclipse/settings/code-style/gwt-customchecks.jar
deleted file mode 100644
index 1b51aa7..0000000
--- a/eclipse/settings/code-style/gwt-customchecks.jar
+++ /dev/null
Binary files differ
diff --git a/user/src/com/google/gwt/user/client/ui/LoadListener.java b/user/src/com/google/gwt/user/client/ui/LoadListener.java
index 8164979..1d3d3b0 100644
--- a/user/src/com/google/gwt/user/client/ui/LoadListener.java
+++ b/user/src/com/google/gwt/user/client/ui/LoadListener.java
@@ -5,7 +5,7 @@
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
  * 
- * http://www.apache.org/licenses/LICENSE-2.0/
+ * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT