提交 fda7e2d5 authored 作者: Thomas Mueller's avatar Thomas Mueller

Limit line length to 80 characters

上级 69051adc
......@@ -39,36 +39,36 @@ public class Build extends BuildBase {
* Run the benchmarks.
*/
public void benchmark() {
downloadUsingMaven("ext/hsqldb-2.0.0.jar",
downloadUsingMaven("ext/hsqldb-2.0.0.jar",
"hsqldb", "hsqldb", "2.0.0",
"c9d525ce1a464185e6b01c7de872127a06092673");
downloadUsingMaven("ext/derby-10.6.1.0.jar",
downloadUsingMaven("ext/derby-10.6.1.0.jar",
"org/apache/derby", "derby", "10.6.1.0",
"01137cd636b0e3c22f0d273478adb58aa30e984a");
downloadUsingMaven("ext/derbyclient-10.6.1.0.jar",
downloadUsingMaven("ext/derbyclient-10.6.1.0.jar",
"org/apache/derby", "derbyclient", "10.6.1.0",
"e7c6fbaca2ef4dbcad27fa7d8a9cd1ac0d1e4b00");
downloadUsingMaven("ext/derbynet-10.6.1.0.jar",
downloadUsingMaven("ext/derbynet-10.6.1.0.jar",
"org/apache/derby", "derbynet", "10.6.1.0",
"d5d9d7b783eeaef016be85c34d5c65d1e7cec764");
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
"postgresql", "postgresql", "8.3-603.jdbc3",
"33d531c3c53055ddcbea3d88bfa093466ffef924");
downloadUsingMaven("ext/mysql-connector-java-5.1.6.jar",
downloadUsingMaven("ext/mysql-connector-java-5.1.6.jar",
"mysql", "mysql-connector-java", "5.1.6",
"380ef5226de2c85ff3b38cbfefeea881c5fce09d");
compile();
String cp = "temp" +
File.pathSeparator + "bin/h2" + getJarSuffix() +
File.pathSeparator + "ext/hsqldb.jar" +
File.pathSeparator + "ext/hsqldb-2.0.0.jar" +
File.pathSeparator + "ext/derby-10.6.1.0.jar" +
File.pathSeparator + "ext/derbyclient-10.6.1.0.jar" +
File.pathSeparator + "ext/derbynet-10.6.1.0.jar" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
String cp = "temp" +
File.pathSeparator + "bin/h2" + getJarSuffix() +
File.pathSeparator + "ext/hsqldb.jar" +
File.pathSeparator + "ext/hsqldb-2.0.0.jar" +
File.pathSeparator + "ext/derby-10.6.1.0.jar" +
File.pathSeparator + "ext/derbyclient-10.6.1.0.jar" +
File.pathSeparator + "ext/derbynet-10.6.1.0.jar" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + "ext/mysql-connector-java-5.1.6.jar";
StringList args = args("-Xmx128m",
StringList args = args("-Xmx128m",
"-cp", cp, "org.h2.test.bench.TestPerformance");
exec("java", args.plus("-init", "-db", "1"));
exec("java", args.plus("-db", "2"));
......@@ -101,7 +101,7 @@ public class Build extends BuildBase {
private void compileTools() {
FileList files = files("src/tools").keep("src/tools/org/h2/build/*");
StringList args = args("-d", "temp", "-sourcepath", "src/tools" +
File.pathSeparator + "src/test" +
File.pathSeparator + "src/test" +
File.pathSeparator + "src/main");
mkdir("temp");
javac(args, files);
......@@ -126,7 +126,7 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/jts-1.13.jar" +
File.pathSeparator + "ext/slf4j-api-1.6.0.jar" +
File.pathSeparator + "ext/slf4j-nop-1.6.0.jar" +
File.pathSeparator + System.getProperty("java.home") +
File.pathSeparator + System.getProperty("java.home") +
"/../lib/tools.jar";
// -XX:-UseSplitVerifier is for Java 7 compatibility
exec("java", args(
......@@ -136,7 +136,7 @@ public class Build extends BuildBase {
"-cp", "temp",
"-sp", "src/main",
"-r", "html,txt",
"-ix", "-org.h2.test.*,-org.h2.dev.*," +
"-ix", "-org.h2.test.*,-org.h2.dev.*," +
"-org.h2.jaqu.*,-org.h2.mode.*,-org.h2.server.pg.*",
"org.h2.test.TestAll"));
}
......@@ -277,22 +277,22 @@ public class Build extends BuildBase {
}
private void downloadOrVerify(boolean offline) {
downloadOrVerify("ext/servlet-api-2.4.jar",
downloadOrVerify("ext/servlet-api-2.4.jar",
"javax/servlet", "servlet-api", "2.4",
"3fc542fe8bb8164e8d3e840fe7403bc0518053c0", offline);
downloadOrVerify("ext/lucene-core-3.0.2.jar",
downloadOrVerify("ext/lucene-core-3.0.2.jar",
"org/apache/lucene", "lucene-core", "3.0.2",
"c2b48995ab855c1b9ea13867a0f976c994e0105d", offline);
downloadOrVerify("ext/slf4j-api-1.6.0.jar",
downloadOrVerify("ext/slf4j-api-1.6.0.jar",
"org/slf4j", "slf4j-api", "1.6.0",
"b353147a7d51fcfcd818d8aa6784839783db0915", offline);
downloadOrVerify("ext/org.osgi.core-4.2.0.jar",
downloadOrVerify("ext/org.osgi.core-4.2.0.jar",
"org/osgi", "org.osgi.core", "4.2.0",
"66ab449ff3aa5c4adfc82c89025cc983b422eb95", offline);
downloadOrVerify("ext/org.osgi.enterprise-4.2.0.jar",
downloadOrVerify("ext/org.osgi.enterprise-4.2.0.jar",
"org/osgi", "org.osgi.enterprise", "4.2.0",
"8634dcb0fc62196e820ed0f1062993c377f74972", offline);
downloadOrVerify("ext/jts-1.13.jar",
downloadOrVerify("ext/jts-1.13.jar",
"com/vividsolutions", "jts", "1.13",
"3ccfb9b60f04d71add996a666ceb8902904fd805", offline);
}
......@@ -317,16 +317,16 @@ public class Build extends BuildBase {
"http://h2database.com/h2mig_pagestore_addon.jar",
"6dfafe1b86959c3ba4f7cf03e99535e8b9719965");
// for TestOldVersion
downloadUsingMaven("ext/h2-1.2.127.jar",
downloadUsingMaven("ext/h2-1.2.127.jar",
"com/h2database", "h2", "1.2.127",
"056e784c7cf009483366ab9cd8d21d02fe47031a");
// for TestPgServer
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
"postgresql", "postgresql", "8.3-603.jdbc3",
"33d531c3c53055ddcbea3d88bfa093466ffef924");
// for TestTraceSystem
downloadUsingMaven("ext/slf4j-nop-1.6.0.jar",
downloadUsingMaven("ext/slf4j-nop-1.6.0.jar",
"org/slf4j", "slf4j-nop", "1.6.0",
"4da67bb4a6eea5dc273f99c50ad2333eadb46f86");
}
......@@ -548,8 +548,8 @@ public class Build extends BuildBase {
public void javadocImpl() {
compileTools();
mkdir("docs/javadocImpl2");
javadoc("-sourcepath", "src/main" +
File.pathSeparator + "src/test" +
javadoc("-sourcepath", "src/main" +
File.pathSeparator + "src/test" +
File.pathSeparator + "src/tools" ,
"-noindex",
"-tag", "h2.resource",
......@@ -566,12 +566,12 @@ public class Build extends BuildBase {
"-exclude", "org.h2.test.jaqu:org.h2.jaqu");
System.setProperty("h2.interfacesOnly", "false");
System.setProperty("h2.javadocDestDir", "docs/javadocImpl");
javadoc("-sourcepath", "src/main" +
File.pathSeparator + "src/test" +
File.pathSeparator + "src/tools",
javadoc("-sourcepath", "src/main" +
File.pathSeparator + "src/test" +
File.pathSeparator + "src/tools",
"-classpath",
System.getProperty("java.home") + "/../lib/tools.jar" +
File.pathSeparator + "ext/slf4j-api-1.6.0.jar" +
System.getProperty("java.home") + "/../lib/tools.jar" +
File.pathSeparator + "ext/slf4j-api-1.6.0.jar" +
File.pathSeparator + "ext/servlet-api-2.4.jar" +
File.pathSeparator + "ext/lucene-core-3.0.2.jar" +
File.pathSeparator + "ext/org.osgi.core-4.2.0.jar" +
......
......@@ -213,7 +213,7 @@ public class BuildBase {
private void runShell() {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String last = "", line;
System.out.println("Shell mode. Type the target, then [Enter]. " +
System.out.println("Shell mode. Type the target, then [Enter]. " +
"Just [Enter] repeats the last target.");
while (true) {
System.out.print("build> ");
......
......@@ -18,10 +18,12 @@ import java.util.Arrays;
*/
public class CheckTextFiles {
private static final int MAX_SOURCE_LINE_SIZE = 100;
// must contain "+" otherwise this here counts as well
private static final String COPYRIGHT = "Copyright 2004-2013 " +
private static final String COPYRIGHT = "Copyright 2004-2013 " +
"H2 Group.";
private static final String LICENSE = "Multiple-Licensed " +
private static final String LICENSE = "Multiple-Licensed " +
"under the H2 License";
private static final String[] SUFFIX_CHECK = { "html", "jsp", "js", "css",
......@@ -90,8 +92,8 @@ public class CheckTextFiles {
// check = false;
// ignore = true;
// }
if (name.endsWith(".utf8.txt") ||
(name.startsWith("_docs_") &&
if (name.endsWith(".utf8.txt") ||
(name.startsWith("_docs_") &&
name.endsWith(".properties"))) {
check = false;
ignore = true;
......@@ -164,6 +166,7 @@ public class CheckTextFiles {
}
}
int line = 1;
int startLinePos = 0;
boolean lastWasWhitespace = false;
for (int i = 0; i < data.length; i++) {
char ch = (char) (data[i] & 0xff);
......@@ -186,6 +189,13 @@ public class CheckTextFiles {
}
lastWasWhitespace = false;
line++;
int lineLength = i - startLinePos;
if (lineLength > MAX_SOURCE_LINE_SIZE) {
if (file.getName().endsWith(".java")) {
fail(file, "line too long: " + lineLength, line);
}
}
startLinePos = i;
} else if (ch == '\r') {
if (!ALLOW_CR) {
fail(file, "contains CR", line);
......
......@@ -39,7 +39,7 @@ public class BnfRailroad implements BnfVisitor {
StringBuilder buff = new StringBuilder();
for (String s : syntaxList) {
bnf.visit(this, s);
html = StringUtils.replaceAll(html, "</code></td>" +
html = StringUtils.replaceAll(html, "</code></td>" +
"<td class=\"d\"><code class=\"c\">", " ");
if (buff.length() > 0) {
buff.append("<br />");
......@@ -138,7 +138,7 @@ public class BnfRailroad implements BnfVisitor {
for (Rule r : list) {
String a = i == 0 ? "t" : i == list.size() - 1 ? "l" : "k";
i++;
buff.append("<tr class=\"railroad\"><td class=\"" +
buff.append("<tr class=\"railroad\"><td class=\"" +
a + "s\"></td><td class=\"d\">");
r.accept(this);
buff.append(html);
......@@ -163,9 +163,9 @@ public class BnfRailroad implements BnfVisitor {
public void visitRuleOptional(Rule rule) {
StringBuilder buff = new StringBuilder();
buff.append("<table class=\"railroad\">");
buff.append("<tr class=\"railroad\"><td class=\"ts\"></td>" +
buff.append("<tr class=\"railroad\"><td class=\"ts\"></td>" +
"<td class=\"d\">&nbsp;</td><td class=\"te\"></td></tr>");
buff.append("<tr class=\"railroad\">" +
buff.append("<tr class=\"railroad\">" +
"<td class=\"ls\"></td><td class=\"d\">");
rule.accept(this);
buff.append(html);
......
......@@ -36,7 +36,7 @@ public class GenerateDoc {
private String inDir = "src/docsrc/html";
private String outDir = "docs/html";
private Connection conn;
private final HashMap<String, Object> session =
private final HashMap<String, Object> session =
new HashMap<String, Object>();
private Bnf bnf;
......@@ -69,37 +69,37 @@ public class GenerateDoc {
session.put("stableVersion", Constants.getVersionStable());
session.put("stableVersionDate", Constants.BUILD_DATE_STABLE);
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
String help = "SELECT ROWNUM ID, * FROM CSVREAD('" +
String help = "SELECT ROWNUM ID, * FROM CSVREAD('" +
IN_HELP + "', NULL, 'lineComment=#') WHERE SECTION ";
map("commands",
map("commands",
help + "LIKE 'Commands%' ORDER BY ID", true);
map("commandsDML",
map("commandsDML",
help + "= 'Commands (DML)' ORDER BY ID", false);
map("commandsDDL",
map("commandsDDL",
help + "= 'Commands (DDL)' ORDER BY ID", false);
map("commandsOther",
map("commandsOther",
help + "= 'Commands (Other)' ORDER BY ID", false);
map("otherGrammar",
map("otherGrammar",
help + "= 'Other Grammar' ORDER BY ID", true);
map("functionsAggregate",
map("functionsAggregate",
help + "= 'Functions (Aggregate)' ORDER BY ID", false);
map("functionsNumeric",
map("functionsNumeric",
help + "= 'Functions (Numeric)' ORDER BY ID", false);
map("functionsString",
map("functionsString",
help + "= 'Functions (String)' ORDER BY ID", false);
map("functionsTimeDate",
map("functionsTimeDate",
help + "= 'Functions (Time and Date)' ORDER BY ID", false);
map("functionsSystem",
map("functionsSystem",
help + "= 'Functions (System)' ORDER BY ID", false);
map("functionsAll",
map("functionsAll",
help + "LIKE 'Functions%' ORDER BY SECTION, ID", true);
map("dataTypes",
map("dataTypes",
help + "LIKE 'Data Types%' ORDER BY SECTION, ID", true);
map("informationSchema", "SELECT TABLE_NAME TOPIC, " +
"GROUP_CONCAT(COLUMN_NAME " +
"ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX " +
"FROM INFORMATION_SCHEMA.COLUMNS " +
"WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' " +
map("informationSchema", "SELECT TABLE_NAME TOPIC, " +
"GROUP_CONCAT(COLUMN_NAME " +
"ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX " +
"FROM INFORMATION_SCHEMA.COLUMNS " +
"WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' " +
"GROUP BY TABLE_NAME ORDER BY TABLE_NAME", false);
processAll("");
conn.close();
......@@ -142,7 +142,7 @@ public class GenerateDoc {
try {
stat = conn.createStatement();
rs = stat.executeQuery(sql);
ArrayList<HashMap<String, String>> list =
ArrayList<HashMap<String, String>> list =
new ArrayList<HashMap<String, String>>();
while (rs.next()) {
HashMap<String, String> map = new HashMap<String, String>();
......@@ -168,9 +168,9 @@ public class GenerateDoc {
String text = map.get("text");
if (text != null) {
// text is enclosed in <p> .. </p> so this works.
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"<br /><br />", "</p><p>");
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"<br />", " ");
text = addCode(text);
map.put("text", text);
......
......@@ -52,7 +52,7 @@ public class GenerateHelp {
rs2.addRow(row);
}
BufferedWriter writer = new BufferedWriter(new FileWriter(out));
writer.write("# Copyright 2004-2013 H2 Group. " +
writer.write("# Copyright 2004-2013 H2 Group. " +
"Multiple-Licensed under the H2 License,\n" +
"# Version 1.0, and under the Eclipse Public License, Version 1.0\n" +
"# (http://h2database.com/html/license.html).\n" +
......
......@@ -47,10 +47,10 @@ public class MergeDocs {
String finalText = buff.toString();
File output = new File(BASE_DIR, "onePage.html");
PrintWriter writer = new PrintWriter(new FileWriter(output));
writer.println("<html><head><meta http-equiv=\"Content-Type\" " +
writer.println("<html><head><meta http-equiv=\"Content-Type\" " +
"content=\"text/html;charset=utf-8\" /><title>");
writer.println("H2 Documentation");
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" " +
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" " +
"href=\"stylesheetPdf.css\" /></head><body>");
writer.println("<h1>H2 Database Engine</h1>");
writer.println("<p>Version " + Constants.getFullVersion() + "</p>");
......@@ -60,16 +60,16 @@ public class MergeDocs {
}
private static String disableRailroads(String text) {
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"<!-- railroad-start -->",
"<!-- railroad-start ");
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"<!-- railroad-end -->",
" railroad-end -->");
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"<!-- syntax-start",
"<!-- syntax-start -->");
text = StringUtils.replaceAll(text,
text = StringUtils.replaceAll(text,
"syntax-end -->",
"<!-- syntax-end -->");
return text;
......@@ -80,7 +80,7 @@ public class MergeDocs {
// String end = "</body>";
String start = "<!-- } -->";
String end = "<!-- [close] { --></div></td></tr></table>" +
String end = "<!-- [close] { --></div></td></tr></table>" +
"<!-- } --><!-- analytics --></body></html>";
int idx = text.indexOf(end);
......
......@@ -31,7 +31,7 @@ public class SpellChecker {
private static final String[] IGNORE = { "dev", "nsi", "gif", "png", "odg",
"ico", "sxd", "zip", "bz2", "rc", "layout", "res", "dll", "jar",
"svg", "prefs", "prop", "iml" };
private static final String DELIMITERS =
private static final String DELIMITERS =
" \n.();-\"=,*/{}_<>+\r:'@[]&\\!#|?$^%~`\t";
private static final String PREFIX_IGNORE = "abc";
private static final String[] IGNORE_FILES = { "mainWeb.html",
......@@ -49,11 +49,11 @@ public class SpellChecker {
*/
public boolean printDictionary;
private final HashSet<String> dictionary =
private final HashSet<String> dictionary =
new HashSet<String>();
private final HashSet<String> used =
private final HashSet<String> used =
new HashSet<String>();
private final HashMap<String, Integer> unknown =
private final HashMap<String, Integer> unknown =
new HashMap<String, Integer>();
private boolean addToDictionary;
private int errorCount;
......@@ -147,7 +147,7 @@ public class SpellChecker {
}
}
if (!ok) {
throw new IOException("Unsupported suffix: " +
throw new IOException("Unsupported suffix: " +
suffix + " for file: " + fileName);
}
String text = new String(BuildBase.readFile(file));
......@@ -206,7 +206,7 @@ public class SpellChecker {
pos += "http://".length();
while (true) {
char c = text.charAt(pos);
if (!Character.isJavaIdentifierPart(c) &&
if (!Character.isJavaIdentifierPart(c) &&
".#/?&=%+_-:".indexOf(c) < 0) {
break;
}
......
......@@ -105,7 +105,7 @@ public class UploadBuild {
if (ftp.exists("/httpdocs/automated", "history.sql")) {
buildSql = new String(ftp.retrieve("/httpdocs/automated/history.sql"));
} else {
buildSql = "create table item(id identity, title varchar, " +
buildSql = "create table item(id identity, title varchar, " +
"issued timestamp, desc varchar);\n";
}
String ts = new java.sql.Timestamp(System.currentTimeMillis()).toString();
......@@ -114,21 +114,21 @@ public class UploadBuild {
if (idx >= 0) {
int end = testOutput.indexOf("<br />", idx);
if (end >= 0) {
String result = testOutput.substring(idx +
String result = testOutput.substring(idx +
"Statements per second: ".length(), end);
now += " " + result + " op/s";
}
}
String sql = "insert into item(title, issued, desc) values('Build " +
String sql = "insert into item(title, issued, desc) values('Build " +
now +
(error ? " FAILED" : "") +
(coverageFailed ? " COVERAGE" : "") +
"', '" + ts +
"', '<a href=\"http://www.h2database.com/" +
"', '" + ts +
"', '<a href=\"http://www.h2database.com/" +
"html/testOutput.html\">Output</a>" +
" - <a href=\"http://www.h2database.com/" +
" - <a href=\"http://www.h2database.com/" +
"coverage/overview.html\">Coverage</a>" +
" - <a href=\"http://www.h2database.com/" +
" - <a href=\"http://www.h2database.com/" +
"automated/h2-latest.jar\">Jar</a>');\n";
buildSql += sql;
Connection conn;
......@@ -157,21 +157,21 @@ public class UploadBuild {
rs.next();
String content = rs.getString("content");
conn.close();
ftp.store("/httpdocs/automated/history.sql",
ftp.store("/httpdocs/automated/history.sql",
new ByteArrayInputStream(buildSql.getBytes()));
ftp.store("/httpdocs/automated/news.xml",
ftp.store("/httpdocs/automated/news.xml",
new ByteArrayInputStream(content.getBytes()));
ftp.store("/httpdocs/html/testOutput.html",
ftp.store("/httpdocs/html/testOutput.html",
new ByteArrayInputStream(testOutput.getBytes()));
String jarFileName = "bin/h2-" + Constants.getVersion() + ".jar";
if (FileUtils.exists(jarFileName)) {
ftp.store("/httpdocs/automated/h2-latest.jar",
ftp.store("/httpdocs/automated/h2-latest.jar",
new FileInputStream(jarFileName));
}
if (coverage) {
ftp.store("/httpdocs/coverage/overview.html",
ftp.store("/httpdocs/coverage/overview.html",
new FileInputStream("coverage/overview.html"));
ftp.store("/httpdocs/coverage/coverage.zip",
ftp.store("/httpdocs/coverage/coverage.zip",
new FileInputStream("coverage.zip"));
FileUtils.delete("coverage.zip");
}
......
......@@ -26,7 +26,7 @@ public class WebSite {
private static final String ANALYTICS_TAG = "<!-- analytics -->";
private static final String ANALYTICS_SCRIPT =
"<script src=\"http://www.google-analytics.com/ga.js\" " +
"<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\");" +
......
......@@ -87,25 +87,25 @@ public class Doclet {
String className = getClass(clazz);
FileWriter out = new FileWriter(fileName);
PrintWriter writer = new PrintWriter(new BufferedWriter(out));
writer.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD " +
writer.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD " +
"XHTML 1.0 Strict//EN\" " +
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
String language = "en";
writer.println("<html xmlns=\"http://www.w3.org/1999/xhtml\" " +
"lang=\"" + language + "\" xml:lang=\"" + language + "\">");
writer.println("<head>" +
"<meta http-equiv=\"Content-Type\" " +
writer.println("<head>" +
"<meta http-equiv=\"Content-Type\" " +
"content=\"text/html;charset=utf-8\" /><title>");
writer.println(className);
writer.println("</title>" +
"<link rel=\"stylesheet\" type=\"text/css\" " +
writer.println("</title>" +
"<link rel=\"stylesheet\" type=\"text/css\" " +
"href=\"../../../stylesheet.css\" />");
writer.println("<script type=\"text/javascript\" " +
writer.println("<script type=\"text/javascript\" " +
"src=\"../../../animate.js\"></script>");
writer.println("</head><body onload=\"openLink();\">");
writer.println("<table class=\"content\">" +
"<tr class=\"content\">" +
"<td class=\"content\">" +
writer.println("<table class=\"content\">" +
"<tr class=\"content\">" +
"<td class=\"content\">" +
"<div class=\"contentDiv\">");
writer.println("<h1>" + className + "</h1>");
writer.println(formatText(clazz.commentText()) + "<br /><br />");
......@@ -113,7 +113,7 @@ public class Doclet {
// methods
ConstructorDoc[] constructors = clazz.constructors();
MethodDoc[] methods = clazz.methods();
ExecutableMemberDoc[] constructorsMethods =
ExecutableMemberDoc[] constructorsMethods =
new ExecutableMemberDoc[constructors.length
+ methods.length];
System.arraycopy(constructors, 0, constructorsMethods, 0,
......@@ -151,16 +151,16 @@ public class Doclet {
continue;
}
if (!hasMethods) {
writer.println("<table class=\"block\">" +
"<tr onclick=\"return allDetails()\">" +
writer.println("<table class=\"block\">" +
"<tr onclick=\"return allDetails()\">" +
"<th colspan=\"2\">Methods</th></tr>");
hasMethods = true;
}
String type = getTypeName(method.isStatic(), false,
getReturnType(method));
writer.println("<tr id=\"__" + id + "\" onclick=\"return on(" +
writer.println("<tr id=\"__" + id + "\" onclick=\"return on(" +
id + ")\">");
writer.println("<td class=\"return\">" + type +
writer.println("<td class=\"return\">" + type +
"</td><td class=\"method\">");
Parameter[] params = method.parameters();
StringBuilder buff = new StringBuilder();
......@@ -188,18 +188,18 @@ public class Doclet {
signatures.add(null);
}
signatures.add(i, signature);
writer.println("<a id=\"" + signature +
"\" href=\"#" + signature + "\">" +
writer.println("<a id=\"" + signature +
"\" href=\"#" + signature + "\">" +
name + "</a>" + buff.toString());
String firstSentence = getFirstSentence(method.firstSentenceTags());
if (firstSentence != null) {
writer.println("<div class=\"methodText\">" +
writer.println("<div class=\"methodText\">" +
formatText(firstSentence) + "</div>");
}
writer.println("</td></tr>");
writer.println("<tr onclick=\"return off("+
writer.println("<tr onclick=\"return off("+
id +")\" class=\"detail\" id=\"_"+id+"\">");
writer.println("<td class=\"return\">" +
writer.println("<td class=\"return\">" +
type + "</td><td>");
writeMethodDetails(writer, clazz, method, signature);
writer.println("</td></tr>");
......@@ -228,7 +228,7 @@ public class Doclet {
String name = field.name();
String text = field.commentText();
if (text == null || text.trim().length() == 0) {
addError("Undocumented field (" +
addError("Undocumented field (" +
getLink(clazz, field.position().line()) + ") " + name);
}
if (text != null && text.startsWith("INTERNAL")) {
......@@ -238,7 +238,7 @@ public class Doclet {
writer.println("<br /><table><tr><th colspan=\"2\">Fields</th></tr>");
}
String type = getTypeName(true, false, field.type());
writer.println("<tr><td class=\"return\">" + type +
writer.println("<tr><td class=\"return\">" + type +
"</td><td class=\"method\">");
String constant = field.constantValueExpression();
......@@ -293,7 +293,7 @@ public class Doclet {
String name = field.name();
String constant = field.constantValueExpression();
String link = getFieldLink(text, constant, clazz, name);
writer.println("<h4 id=\"" + link + "\"><span class=\"methodName\">" +
writer.println("<h4 id=\"" + link + "\"><span class=\"methodName\">" +
name);
if (constant == null) {
writer.println();
......@@ -335,11 +335,11 @@ public class Doclet {
if (isDeprecated(method)) {
name = "<span class=\"deprecated\">" + name + "</span>";
}
writer.println("<a id=\"" + signature + "\" href=\"#" + signature + "\">" +
writer.println("<a id=\"" + signature + "\" href=\"#" + signature + "\">" +
name + "</a>" + buff.toString());
boolean hasComment = method.commentText() != null &&
boolean hasComment = method.commentText() != null &&
method.commentText().trim().length() != 0;
writer.println("<div class=\"methodText\">" +
writer.println("<div class=\"methodText\">" +
formatText(method.commentText()) + "</div>");
ParamTag[] paramTags = method.paramTags();
ThrowsTag[] throwsTags = method.throwsTags();
......@@ -349,7 +349,7 @@ public class Doclet {
// [Not supported] and such are not problematic
addError("Undocumented parameter(s) (" +
getLink(clazz, method.position().line()) + ") " +
name + " documented: " + paramTags.length +
name + " documented: " + paramTags.length +
" params: "+ params.length);
}
}
......@@ -358,7 +358,7 @@ public class Doclet {
String comment = paramTags[j].parameterComment();
if (comment.trim().length() == 0) {
addError("Undocumented parameter (" +
getLink(clazz, method.position().line()) + ") " +
getLink(clazz, method.position().line()) + ") " +
name + " " + paramName);
}
String p = paramName + " - " + comment;
......@@ -378,7 +378,7 @@ public class Doclet {
}
writer.println("<div class=\"item\">" + returnComment + "</div>");
} else if (returnType != null && !returnType.toString().equals("void")) {
if (hasComment && !method.commentText().startsWith("[") &&
if (hasComment && !method.commentText().startsWith("[") &&
!hasThrowsTag) {
// [Not supported] and such are not problematic
// also not problematic are methods that always throw an exception
......@@ -417,7 +417,7 @@ public class Doclet {
int linkEnd = text.indexOf("</code>", linkStart);
link = text.substring(linkStart + "<code>".length(), linkEnd);
if (constant != null && !constant.equals(link)) {
System.out.println("Wrong code tag? " + clazz.name() + "." +
System.out.println("Wrong code tag? " + clazz.name() + "." +
name +
" code: " + link + " constant: " + constant);
errorCount++;
......
......@@ -14,9 +14,9 @@ import java.util.HashMap;
*/
public class HtmlConverter {
private static final HashMap<String, Character> CHAR_MAP =
private static final HashMap<String, Character> CHAR_MAP =
new HashMap<String, Character>();
private static final HashMap<Character, String> CODE_MAP =
private static final HashMap<Character, String> CODE_MAP =
new HashMap<Character, String>();
private static final String[] CHARS = { "quot:34", "amp:38", "lt:60",
......
......@@ -458,39 +458,39 @@ public class FileShell extends Tool {
private void showHelp() {
println("Commands are case sensitive");
println("? or help " +
println("? or help " +
"Display this help");
println("cat <file> " +
println("cat <file> " +
"Print the contents of the file");
println("cd <dir> " +
println("cd <dir> " +
"Change the directory");
println("chmod -w <file> " +
println("chmod -w <file> " +
"Make the file read-only");
println("cp <source> <target> " +
println("cp <source> <target> " +
"Copy a file");
println("head <file> " +
println("head <file> " +
"Print the first few lines of the contents");
println("ls [<dir>] " +
println("ls [<dir>] " +
"Print the directory contents");
println("mkdir <dir> " +
println("mkdir <dir> " +
"Create a directory (including parent directories)");
println("mv <source> <target> " +
println("mv <source> <target> " +
"Rename a file or directory");
println("pwd " +
println("pwd " +
"Print the current working directory");
println("rm <file> " +
println("rm <file> " +
"Remove a file");
println("rm -r <dir> " +
println("rm -r <dir> " +
"Remove a directory, recursively");
println("rm -rf <dir> " +
println("rm -rf <dir> " +
"Remove a directory, recursively; force");
println("touch <file> " +
println("touch <file> " +
"Update the last modified date (creates the file)");
println("truncate -s <size> <file> " +
println("truncate -s <size> <file> " +
"Set the file length");
println("unzip <zip> " +
println("unzip <zip> " +
"Extract all files from the zip file");
println("zip [-r] <zip> <files..> " +
println("zip [-r] <zip> <files..> " +
"Create a zip file (-r to recurse directories)");
println("exit Exit");
println("");
......
......@@ -239,7 +239,7 @@ public class FtpServer extends Tool implements Service {
Date now = new Date(), mod = new Date(FileUtils.lastModified(fileName));
String date;
if (mod.after(now)
|| Math.abs((now.getTime() - mod.getTime()) /
|| Math.abs((now.getTime() - mod.getTime()) /
1000 / 60 / 60 / 24) > 180) {
synchronized (dateFormatOld) {
date = dateFormatOld.format(mod);
......
......@@ -58,13 +58,13 @@ public class SecureKeyStoreBuilder {
String alias = en.nextElement();
Key key = store.getKey(alias, password.toCharArray());
System.out.println(
"KeyFactory keyFactory = KeyFactory.getInstance(\""
"KeyFactory keyFactory = KeyFactory.getInstance(\""
+ key.getAlgorithm() + "\");");
System.out.println("store.load(null, password.toCharArray());");
String pkFormat = key.getFormat();
String encoded = StringUtils.convertBytesToHex(key.getEncoded());
System.out.println(
pkFormat + "EncodedKeySpec keySpec = new "
pkFormat + "EncodedKeySpec keySpec = new "
+ pkFormat + "EncodedKeySpec(getBytes(\""
+ encoded + "\"));");
System.out.println(
......
......@@ -34,9 +34,9 @@ public class Migrate {
private static final String USER = "sa";
private static final String PASSWORD = "sa";
private static final File OLD_H2_FILE = new File("./h2-1.2.127.jar");
private static final String DOWNLOAD_URL =
private static final String DOWNLOAD_URL =
"http://repo2.maven.org/maven2/com/h2database/h2/1.2.127/h2-1.2.127.jar";
private static final String CHECKSUM =
private static final String CHECKSUM =
"056e784c7cf009483366ab9cd8d21d02fe47031a";
private static final String TEMP_SCRIPT = "backup.sql";
private final PrintStream sysOut = System.out;
......
......@@ -86,7 +86,7 @@ public class Db {
/**
* Create a new database instance using a data source. This method is fast,
* so that you can always call open() / close() on usage.
*
*
* @param ds the data source
* @return the database instance.
*/
......@@ -315,7 +315,7 @@ public class Db {
/**
* Run a SQL query directly against the database.
*
*
* @param sql the SQL statement
* @return the result set
*/
......@@ -329,7 +329,7 @@ public class Db {
/**
* Run a SQL statement directly against the database.
*
*
* @param sql the SQL statement
* @return the update count
*/
......
......@@ -35,7 +35,7 @@ public class DbInspector {
/**
* Set the preferred class to store date and time. Possible values are:
* java.util.Date (default) and java.sql.Timestamp.
*
*
* @param dateTimeClass the new class
*/
public void setPreferredDateTimeClass(
......@@ -48,7 +48,7 @@ public class DbInspector {
* name is undefined, models will be generated for every table within the
* specified schema. Additionally, if no schema is defined, models will be
* generated for all schemas and all tables.
*
*
* @param schema the schema name (optional)
* @param table the table name (optional)
* @param packageName the package name (optional)
......@@ -75,7 +75,7 @@ public class DbInspector {
/**
* Validates a model.
*
*
* @param <T> the model class
* @param model an instance of the model class
* @param throwOnError if errors should cause validation to fail
......@@ -104,7 +104,7 @@ public class DbInspector {
/**
* Get the table in the database based on the model definition.
*
*
* @param <T> the model class
* @param model an instance of the model class
* @return the table inspector
......@@ -125,7 +125,7 @@ public class DbInspector {
/**
* Returns a list of tables. This method always returns at least one
* element. If no table is found, an exception is thrown.
*
*
* @param schema the schema name
* @param table the table name
* @return a list of table inspectors (always contains at least one element)
......
......@@ -19,7 +19,7 @@ public interface DbUpgrader {
* Defines method interface to handle database upgrades. This method is only
* called if your <i>DbUpgrader</i> implementation is annotated with
* JQDatabase.
*
*
* @param db the database
* @param fromVersion the old version
* @param toVersion the new version
......@@ -30,7 +30,7 @@ public interface DbUpgrader {
/**
* Defines method interface to handle table upgrades.
*
*
* @param db the database
* @param schema the schema
* @param table the table
......
......@@ -12,7 +12,7 @@ import org.h2.jaqu.Table.JQTable;
/**
* A system table to track database and table versions.
*/
@JQTable(name = "_jq_versions",
@JQTable(name = "_jq_versions",
primaryKey = "schemaName tableName", memoryTable = true)
public class DbVersion {
......@@ -32,7 +32,7 @@ public class DbVersion {
/**
* Constructor for defining a version entry. Both the schema and the table
* are empty strings, which means this is the row for the 'database'.
*
*
* @param version the database version
*/
public DbVersion(int version) {
......
......@@ -26,7 +26,7 @@ public class ModelUtils {
* The list of supported data types. It is used by the runtime mapping for
* CREATE statements.
*/
private static final Map<Class<?>, String> SUPPORTED_TYPES =
private static final Map<Class<?>, String> SUPPORTED_TYPES =
new HashMap<Class<?>, String>();
static {
......@@ -51,7 +51,7 @@ public class ModelUtils {
* Convert SQL type aliases to the list of supported types.
* This map is used by generation and validation.
*/
private static final Map<String, String> SQL_TYPES =
private static final Map<String, String> SQL_TYPES =
new HashMap<String, String>();
static {
......
......@@ -23,7 +23,7 @@ import org.h2.util.New;
/**
* This class represents a query.
*
*
* @param <T> the return type
*/
public class Query<T> {
......@@ -285,7 +285,7 @@ public class Query<T> {
/**
* Sets the Limit and Offset of a query.
*
*
* @return the query
*/
public Query<T> limit(long limit) {
......@@ -300,7 +300,7 @@ public class Query<T> {
/**
* Order by a number of columns.
*
*
* @param expressions the columns
* @return the query
*/
......@@ -327,7 +327,7 @@ public class Query<T> {
/**
* INTERNAL
*
*
* @param stat the statement
* @param x the alias object
*/
......@@ -409,7 +409,7 @@ public class Query<T> {
/**
* Join another table.
*
*
* @param alias an alias for the table to join
* @return the joined query
*/
......
......@@ -18,7 +18,7 @@ public interface SQLDialect {
/**
* Get the SQL snippet for the table name.
*
*
* @param schema the schema name, or null for no schema
* @param table the table name
* @return the SQL snippet
......@@ -27,7 +27,7 @@ public interface SQLDialect {
/**
* Get the CREATE INDEX statement.
*
*
* @param schema the schema name
* @param table the table name
* @param index the index definition
......@@ -37,7 +37,7 @@ public interface SQLDialect {
/**
* Append "LIMIT limit" to the SQL statement.
*
*
* @param stat the statement
* @param limit the limit
*/
......@@ -45,7 +45,7 @@ public interface SQLDialect {
/**
* Append "OFFSET offset" to the SQL statement.
*
*
* @param stat the statement
* @param offset the offset
*/
......@@ -53,7 +53,7 @@ public interface SQLDialect {
/**
* Whether memory tables are supported.
*
*
* @return true if they are
*/
boolean supportsMemoryTables();
......
......@@ -12,7 +12,7 @@ import org.h2.util.New;
/**
* This class represents a table in a query.
*
*
* @param <T> the table class
*/
class SelectTable<T> {
......
......@@ -62,7 +62,7 @@ public class TableInspector {
/**
* Tests to see if this TableInspector represents schema.table.
* <p>
*
*
* @param schema the schema name
* @param table the table name
* @return true if the table matches
......@@ -84,7 +84,7 @@ public class TableInspector {
/**
* Reads the DatabaseMetaData for the details of this table including
* primary keys and indexes.
*
*
* @param metaData the database meta data
*/
void read(DatabaseMetaData metaData) throws SQLException {
......@@ -154,7 +154,7 @@ public class TableInspector {
* the model between databases), and if to automatically trim strings for
* those that have a maximum length.
* <p>
*
*
* @return a complete model (class definition) for this table as a string
*/
String generateModel(String packageName, boolean annotateSchema,
......@@ -369,7 +369,7 @@ public class TableInspector {
* returned as a list of validation remarks which includes recommendations,
* warnings, and errors about the model. The caller may choose to have
* validate throw an exception on any validation ERROR.
*
*
* @param <T> the table type
* @param def the table definition
* @param throwError whether or not to throw an exception if an error was
......
......@@ -93,7 +93,7 @@ public class GenerateModels {
/**
* Generates models from the database.
*
*
* @param url the database URL
* @param user the user name
* @param password the password
......@@ -149,7 +149,7 @@ public class GenerateModels {
/**
* Throw a SQLException saying this command line option is not supported.
*
*
* @param option the unsupported option
* @return this method never returns normally
*/
......
......@@ -58,19 +58,19 @@ public class ClassObj {
/**
* The per-instance fields.
*/
LinkedHashMap<String, FieldObj> instanceFields =
LinkedHashMap<String, FieldObj> instanceFields =
new LinkedHashMap<String, FieldObj>();
/**
* The static fields of this class.
*/
LinkedHashMap<String, FieldObj> staticFields =
LinkedHashMap<String, FieldObj> staticFields =
new LinkedHashMap<String, FieldObj>();
/**
* The methods.
*/
LinkedHashMap<String, ArrayList<MethodObj>> methods =
LinkedHashMap<String, ArrayList<MethodObj>> methods =
new LinkedHashMap<String, ArrayList<MethodObj>>();
/**
......@@ -246,7 +246,7 @@ class MethodObj {
/**
* The parameter list.
*/
LinkedHashMap<String, FieldObj> parameters =
LinkedHashMap<String, FieldObj> parameters =
new LinkedHashMap<String, FieldObj>();
/**
......
......@@ -59,7 +59,7 @@ public class JavaParser {
private FieldObj thisPointer;
private final HashMap<String, String> importMap = New.hashMap();
private final HashMap<String, ClassObj> classes = New.hashMap();
private final LinkedHashMap<String, FieldObj> localVars =
private final LinkedHashMap<String, FieldObj> localVars =
new LinkedHashMap<String, FieldObj>();
private final HashMap<String, MethodObj> allMethodsMap = New.hashMap();
private final ArrayList<Statement> nativeHeaders = New.arrayList();
......@@ -109,7 +109,7 @@ public class JavaParser {
/**
* Get the wrapper class for the given primitive class.
*
*
* @param c the class
* @return the wrapper class
*/
......@@ -156,7 +156,7 @@ public class JavaParser {
/**
* Parse the source code.
*
*
* @param baseDir the base directory
* @param className the fully qualified name of the class to parse
*/
......@@ -268,7 +268,7 @@ public class JavaParser {
/**
* Get the class for a built-in type.
*
*
* @param type the type
* @return the class or null if not found
*/
......@@ -1240,7 +1240,7 @@ public class JavaParser {
/**
* Replace all Unicode escapes.
*
*
* @param s the text
* @return the cleaned text
*/
......@@ -1270,7 +1270,7 @@ public class JavaParser {
/**
* Replace all Unicode escapes and remove all remarks.
*
*
* @param s the source code
* @return the cleaned source code
*/
......@@ -1475,7 +1475,7 @@ public class JavaParser {
/**
* Parse a number literal and returns it.
*
*
* @param s the source code
* @return the number
*/
......@@ -1594,7 +1594,7 @@ public class JavaParser {
/**
* Write the C++ header.
*
*
* @param out the output writer
*/
void writeHeader(PrintWriter out) {
......@@ -1705,7 +1705,7 @@ public class JavaParser {
/**
* Write the C++ source code.
*
*
* @param out the output writer
*/
void writeSource(PrintWriter out) {
......@@ -1789,7 +1789,7 @@ public class JavaParser {
/**
* Move the source code 4 levels to the right.
*
*
* @param o the source code
* @return the indented code
*/
......@@ -1799,7 +1799,7 @@ public class JavaParser {
/**
* Get the C++ representation of this identifier.
*
*
* @param identifier the identifier
* @return the C representation
*/
......@@ -1813,7 +1813,7 @@ public class JavaParser {
/**
* Get the class of the given name.
*
*
* @param className the name
* @return the class
*/
......
......@@ -157,7 +157,7 @@ class SwitchStatement extends StatementBase {
private StatementBlock defaultBlock;
private final ArrayList<Expr> cases = new ArrayList<Expr>();
private final ArrayList<StatementBlock> blocks =
private final ArrayList<StatementBlock> blocks =
new ArrayList<StatementBlock>();
private final Expr expr;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论