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