提交 713b55c8 authored 作者: Thomas Mueller's avatar Thomas Mueller

stricter checkstyle settings

上级 612d32f0
......@@ -17,8 +17,8 @@ import java.io.RandomAccessFile;
*/
public class CheckJavadoc {
private int errorCount;
private static final int MAX_COMMENT_LINE_SIZE = 80;
private int errorCount;
public static void main(String[] args) throws Exception {
new CheckJavadoc().run();
......
......@@ -18,25 +18,28 @@ import org.h2.util.ByteUtils;
* removes trailing spaces.
*/
public class CheckTextFiles {
public static void main(String[] args) throws Exception {
new CheckTextFiles().run();
}
// must contain "+" otherwise this here counts as well
private static final String COPYRIGHT = "Copyright 2004-2008 " + "H2 Group.";
private static final String LICENSE = "Multiple-Licensed " + "under the H2 License";
String[] suffixCheck = new String[] { "html", "jsp", "js", "css", "bat", "nsi",
private static final String[] SUFFIX_CHECK = new String[] { "html", "jsp", "js", "css", "bat", "nsi",
"java", "txt", "properties", "sql", "xml", "csv", "Driver" };
String[] suffixIgnore = new String[] { "gif", "png", "odg", "ico", "sxd",
private static final String[] SUFFIX_IGNORE = new String[] { "gif", "png", "odg", "ico", "sxd",
"layout", "res", "win", "jar", "task", "svg", "MF", "sh" };
boolean failOnError;
boolean allowTab, allowCR = true, allowTrailingSpaces = true;
int spacesPerTab = 4;
boolean autoFix = true;
boolean useCRLF = true;
// must contain "+" otherwise this here counts as well
static final String COPYRIGHT = "Copyright 2004-2008 " + "H2 Group.";
static final String LICENSE = "Multiple-Licensed " + "under the H2 License";
String[] suffixIgnoreLicense = new String[] { "bat", "nsi", "txt", "properties", "xml", "java.sql.Driver", "task", "sh" };
boolean hasError;
public static void main(String[] args) throws Exception {
new CheckTextFiles().run();
}
void run() throws Exception {
String baseDir = "src";
check(new File(baseDir));
......@@ -62,8 +65,8 @@ public class CheckTextFiles {
suffix = name.substring(lastDot + 1);
}
boolean check = false, ignore = false;
for (int i = 0; i < suffixCheck.length; i++) {
if (suffix.equals(suffixCheck[i])) {
for (int i = 0; i < SUFFIX_CHECK.length; i++) {
if (suffix.equals(SUFFIX_CHECK[i])) {
check = true;
}
}
......@@ -77,8 +80,8 @@ public class CheckTextFiles {
check = false;
ignore = true;
}
for (int i = 0; i < suffixIgnore.length; i++) {
if (suffix.equals(suffixIgnore[i])) {
for (int i = 0; i < SUFFIX_IGNORE.length; i++) {
if (suffix.equals(SUFFIX_IGNORE[i])) {
ignore = true;
}
}
......
......@@ -30,16 +30,16 @@ import org.h2.util.StringUtils;
*/
public class GenerateDoc {
public static void main(String[] args) throws Exception {
new GenerateDoc().run(args);
}
String inDir = "src/docsrc/html";
String outDir = "docs/html";
Connection conn;
HashMap session = new HashMap();
Bnf bnf;
public static void main(String[] args) throws Exception {
new GenerateDoc().run(args);
}
void run(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-in")) {
......
......@@ -27,14 +27,14 @@ public class LinkChecker {
private static final String[] IGNORE_MISSING_LINKS_TO = new String[]{
"SysProperties", "ErrorCode"
};
private HashMap targets = new HashMap();
private HashMap links = new HashMap();
public static void main(String[] args) throws Exception {
new LinkChecker().run(args);
}
private HashMap targets = new HashMap();
private HashMap links = new HashMap();
private void run(String[] args) throws Exception {
String dir = "docs";
for (int i = 0; i < args.length; i++) {
......
......@@ -24,19 +24,21 @@ import org.h2.build.BuildBase;
*/
public class SpellChecker {
private HashSet dictionary = new HashSet();
private HashSet used = new HashSet();
private HashMap unknown = new HashMap();
private boolean debug;
private boolean printDictionary = false;
private boolean addToDictionary;
private static final String[] SUFFIX = new String[] { "html", "java", "sql", "txt", "xml", "jsp", "css", "bat",
"csv", "xml", "js", "Driver", "properties", "task", "MF", "sh", "" };
private static final String[] IGNORE = new String[] { "dev", "nsi", "gif", "png", "odg", "ico", "sxd", "zip",
"bz2", "rc", "layout", "res", "dll", "jar", "svg" };
private static final String PREFIX_IGNORE = "abc";
private static final String IGNORE_FILE = "mainWeb.html";
private HashSet dictionary = new HashSet();
private HashSet used = new HashSet();
private HashMap unknown = new HashMap();
private boolean debug;
private boolean printDictionary;
private boolean addToDictionary;
private int errorCount;
private int contextCount;
public static void main(String[] args) throws IOException {
String dir = "src";
......@@ -220,6 +222,10 @@ public class SpellChecker {
if (token.length() < 3) {
return;
}
if (contextCount > 0) {
// System.out.println(token);
contextCount--;
}
while (true) {
char last = token.charAt(token.length() - 1);
if (!Character.isDigit(last)) {
......@@ -258,6 +264,7 @@ public class SpellChecker {
Integer value = (Integer) map.get(key);
value = new Integer(value == null ? 0 : value.intValue() + 1);
map.put(key, value);
contextCount = 10;
}
}
......@@ -23,14 +23,14 @@ import org.h2.util.StringUtils;
*/
public class WebSite {
String sourceDir = "docs";
String targetDir = "dataWeb";
private static final String ANALYTICS_TAG = "<!-- analytics -->";
private static final String ANALYTICS_SCRIPT =
"<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>\n" +
"<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>";
String sourceDir = "docs";
String targetDir = "dataWeb";
public static void main(String[] args) throws Exception {
new WebSite().run();
}
......
......@@ -512,5 +512,7 @@ intentional knowing jcl plug facade deployment logback confusion visited
pickle associate subtraction negation multiplication visitors sharp connector
derbynet ado happy derbyclient unspecified federated sysadmin lengths doing
gives clunky cooperative paged conflicts ontology freely regards standards
placing refer informational unlocks
placing refer informational unlocks memo unlimited unmounted keeping hints
hides heterogeneous construction rutema prepending rowscn overrides jconsole
mbean explicit directs leaves printing holds covariant redirector
......@@ -34,6 +34,10 @@ import org.h2.util.StringUtils;
* a properties file and vice versa.
*/
public class PropertiesToUTF8 {
private PropertiesToUTF8() {
// utility class
}
public static void main(String[] args) throws Exception {
convert("bin/org/h2/res");
......
......@@ -13,6 +13,7 @@ import java.util.HashMap;
* character and vice versa.
*/
public class HtmlConverter {
private static HashMap charMap = new HashMap();
private static HashMap codeMap = new HashMap();
......@@ -49,6 +50,10 @@ public class HtmlConverter {
"rdquo:8221", "bdquo:8222", "dagger:8224", "Dagger:8225", "hellip:8230", "permil:8240", "lsaquo:8249",
"rsaquo:8250" };
private HtmlConverter() {
// utility class
}
static {
for (int i = 0; i < CHARS.length; i++) {
String token = CHARS[i];
......
......@@ -26,6 +26,9 @@ import org.h2.util.StringUtils;
*/
public class Indexer {
private static final int MIN_WORD_SIZE = 3;
private static final int MAX_RELATIONS = 20;
ArrayList pages = new ArrayList();
HashMap words = new HashMap();
HashSet noIndex = new HashSet();
......@@ -37,9 +40,6 @@ public class Indexer {
boolean title;
boolean heading;
private static final int MIN_WORD_SIZE = 3;
private static final int MAX_RELATIONS = 20;
public static void main(String[] args) throws Exception {
new Indexer().run(args);
}
......
......@@ -33,8 +33,10 @@ public class PgTcpRedirect {
// http://developer.postgresql.org/pgdocs/postgres/protocol.html
// int portServer = 9083, portClient = 9084;
// int portServer = 3306, portClient = 3307;
// int portServer = 5435, portClient = 5433; // H2 PgServer
int portServer = 5432, portClient = 5433; // PostgreSQL
// H2 PgServer
// int portServer = 5435, portClient = 5433;
// PostgreSQL
int portServer = 5432, portClient = 5433;
for (int i = 0; i < args.length; i++) {
if ("-client".equals(args[i])) {
......@@ -54,14 +56,16 @@ public class PgTcpRedirect {
}
}
/**
* This is the working thread of the TCP redirector.
*/
private class TcpRedirectThread implements Runnable {
private static final int STATE_INIT_CLIENT = 0, STATE_REGULAR = 1;
private Socket read, write;
private int state;
private boolean client;
private static final int STATE_INIT_CLIENT = 0, STATE_REGULAR = 1;
TcpRedirectThread(Socket read, Socket write, boolean client) {
this.read = read;
this.write = write;
......
......@@ -29,6 +29,10 @@ import org.h2.util.ByteUtils;
* in the function SecureSocketFactory.getKeyStore as specified
*/
public class SecureKeyStoreBuilder {
private SecureKeyStoreBuilder() {
// utility class
}
public static void main(String[] a) throws Exception {
String password = SecureSocketFactory.KEYSTORE_PASSWORD;
......
......@@ -12,9 +12,13 @@ import java.util.Random;
* This class converts binary to base64 and vice versa.
*/
public class Base64 {
private static final byte[] CODE = new byte[64];
private static final byte[] REV = new byte[256];
private Base64() {
// utility class
}
static {
for (int i = 'A'; i <= 'Z'; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论