提交 0dca9d2e authored 作者: Thomas Mueller's avatar Thomas Mueller

Require Java 1.5 compiler

上级 9919c5a0
......@@ -3,5 +3,5 @@ if "%JAVA_HOME%"=="" echo Error: JAVA_HOME is not defined.
if "%1"=="clean" rmdir /s /q temp | rmdir /s /q bin
if not exist temp mkdir temp
if not exist bin mkdir bin
javac -source 1.4 -sourcepath src/tools -d bin src/tools/org/h2/build/*.java
javac -sourcepath src/tools -d bin src/tools/org/h2/build/*.java
"%JAVA_HOME%/bin/java" -Xmx256m -cp "bin;%JAVA_HOME%/lib/tools.jar;temp" org.h2.build.Build %*
\ No newline at end of file
......@@ -9,5 +9,5 @@ fi
if [ "$1" == "clean" ] ; then rm -rf temp bin ; fi
if [ ! -d "temp" ] ; then mkdir temp ; fi
if [ ! -d "bin" ] ; then mkdir bin ; fi
javac -source 1.4 -sourcepath src/tools -d bin src/tools/org/h2/build/*.java
javac -sourcepath src/tools -d bin src/tools/org/h2/build/*.java
"$JAVA_HOME/bin/java" -Xmx256m -cp "bin:$JAVA_HOME/lib/tools.jar:temp" org.h2.build.Build $@
......@@ -34,7 +34,7 @@ public class GenerateDoc {
private String inDir = "src/docsrc/html";
private String outDir = "docs/html";
private Connection conn;
private HashMap session = new HashMap();
private HashMap<String, Object> session = new HashMap<String, Object>();
private Bnf bnf;
/**
......@@ -91,8 +91,7 @@ public class GenerateDoc {
return;
}
File[] list = new File(inDir + "/" + dir).listFiles();
for (int i = 0; i < list.length; i++) {
File file = list[i];
for (File file : list) {
if (file.isDirectory()) {
processAll(dir + file.getName());
} else {
......@@ -123,9 +122,9 @@ public class GenerateDoc {
try {
stat = conn.createStatement();
rs = stat.executeQuery(sql);
ArrayList list = new ArrayList();
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
while (rs.next()) {
HashMap map = new HashMap();
HashMap<String, String> map = new HashMap<String, String>();
ResultSetMetaData meta = rs.getMetaData();
for (int i = 0; i < meta.getColumnCount(); i++) {
String k = StringUtils.toLowerEnglish(meta.getColumnLabel(i + 1));
......@@ -141,7 +140,7 @@ public class GenerateDoc {
map.put("syntax", syntax);
// remove newlines in the regular text
String text = (String) map.get("text");
String text = map.get("text");
if (text != null) {
text = text.trim();
// text is enclosed in <p> .. </p> so this works.
......
......@@ -11,7 +11,6 @@ import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import org.h2.util.IOUtils;
import org.h2.util.StartBrowser;
......@@ -28,8 +27,8 @@ public class LinkChecker {
"SysProperties", "ErrorCode"
};
private HashMap targets = new HashMap();
private HashMap links = new HashMap();
private HashMap<String, String> targets = new HashMap<String, String>();
private HashMap<String, String> links = new HashMap<String, String>();
/**
* This method is called when executing this application from the command
......@@ -54,8 +53,7 @@ public class LinkChecker {
}
private void listExternalLinks() {
for (Iterator it = links.keySet().iterator(); it.hasNext();) {
String link = (String) it.next();
for (String link : links.keySet()) {
if (link.startsWith("http")) {
if (link.indexOf("//localhost") > 0) {
continue;
......@@ -74,9 +72,8 @@ public class LinkChecker {
}
private void listBadLinks() throws Exception {
ArrayList errors = new ArrayList();
for (Iterator it = links.keySet().iterator(); it.hasNext();) {
String link = (String) it.next();
ArrayList<String> errors = new ArrayList<String>();
for (String link : links.keySet()) {
if (!link.startsWith("http") && !link.endsWith("h2.pdf")
&& link.indexOf("_ja.") < 0) {
if (targets.get(link) == null) {
......@@ -84,18 +81,16 @@ public class LinkChecker {
}
}
}
for (Iterator it = links.keySet().iterator(); it.hasNext();) {
String link = (String) it.next();
for (String link : links.keySet()) {
if (!link.startsWith("http")) {
targets.remove(link);
}
}
for (Iterator it = targets.keySet().iterator(); it.hasNext();) {
String name = (String) it.next();
for (String name : targets.keySet()) {
if (targets.get(name).equals("name")) {
boolean ignore = false;
for (int i = 0; i < IGNORE_MISSING_LINKS_TO.length; i++) {
if (name.indexOf(IGNORE_MISSING_LINKS_TO[i]) >= 0) {
for (String to : IGNORE_MISSING_LINKS_TO) {
if (name.indexOf(to) >= 0) {
ignore = true;
break;
}
......@@ -106,8 +101,8 @@ public class LinkChecker {
}
}
Collections.sort(errors);
for (int i = 0; i < errors.size(); i++) {
System.out.println(errors.get(i));
for (String error : errors) {
System.out.println(error);
}
if (errors.size() > 0) {
throw new Exception("Problems where found by the Link Checker");
......@@ -120,9 +115,8 @@ public class LinkChecker {
}
File file = new File(path);
if (file.isDirectory()) {
String[] list = file.list();
for (int i = 0; i < list.length; i++) {
process(path + "/" + list[i]);
for (String n : file.list()) {
process(path + "/" + n);
}
} else {
processFile(path);
......
......@@ -589,4 +589,4 @@ handing bonita placed euros embeds reliability singular unregister quotas
overall httpdocs tigris eclemma separates underscore yajsw she her truncating
relocating smtps smtp osde joist catching guesses delimiters shortlist sheet
rowspan cheat partitioning datepart dreamsource toussi locates fred
longnvarchar collate localdb nan bootclasspath bcp
\ No newline at end of file
longnvarchar collate localdb nan bootclasspath bcp retrotranslator
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论