提交 2409c63b authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 0dca9d2e
...@@ -10,7 +10,7 @@ mkdir ..\h2web ...@@ -10,7 +10,7 @@ mkdir ..\h2web
rmdir /s /q bin 2>nul rmdir /s /q bin 2>nul
rmdir /s /q temp 2>nul rmdir /s /q temp 2>nul
call java14 >nul 2>nul call java15 >nul 2>nul
call build -quiet call build -quiet
call java16 >nul 2>nul call java16 >nul 2>nul
......
...@@ -6,8 +6,8 @@ mkdir ../h2web ...@@ -6,8 +6,8 @@ mkdir ../h2web
rm -rf bin rm -rf bin
rm -rf temp rm -rf temp
JAVA_HOME=$JAVA14 JAVA_HOME=$JAVA15
PATH=$JAVA14/bin:$PATH PATH=$JAVA15/bin:$PATH
./build.sh -quiet ./build.sh -quiet
JAVA_HOME=$JAVA16 JAVA_HOME=$JAVA16
......
...@@ -44,10 +44,9 @@ public class CheckJavadoc { ...@@ -44,10 +44,9 @@ public class CheckJavadoc {
if (name.equals("CVS") || name.equals(".svn")) { if (name.equals("CVS") || name.equals(".svn")) {
return 0; return 0;
} }
File[] list = file.listFiles();
boolean foundPackageHtml = false, foundJava = false; boolean foundPackageHtml = false, foundJava = false;
for (int i = 0; i < list.length; i++) { for (File f : file.listFiles()) {
int type = check(list[i]); int type = check(f);
if (type == 1) { if (type == 1) {
foundJava = true; foundJava = true;
} else if (type == 2) { } else if (type == 2) {
......
...@@ -60,9 +60,8 @@ public class CheckTextFiles { ...@@ -60,9 +60,8 @@ public class CheckTextFiles {
if (name.equals("CVS") || name.equals(".svn")) { if (name.equals("CVS") || name.equals(".svn")) {
return; return;
} }
File[] list = file.listFiles(); for (File f : file.listFiles()) {
for (int i = 0; i < list.length; i++) { check(f);
check(list[i]);
} }
} else { } else {
String suffix = ""; String suffix = "";
...@@ -71,8 +70,8 @@ public class CheckTextFiles { ...@@ -71,8 +70,8 @@ public class CheckTextFiles {
suffix = name.substring(lastDot + 1); suffix = name.substring(lastDot + 1);
} }
boolean check = false, ignore = false; boolean check = false, ignore = false;
for (int i = 0; i < SUFFIX_CHECK.length; i++) { for (String s : SUFFIX_CHECK) {
if (suffix.equals(SUFFIX_CHECK[i])) { if (suffix.equals(s)) {
check = true; check = true;
} }
} }
...@@ -86,14 +85,13 @@ public class CheckTextFiles { ...@@ -86,14 +85,13 @@ public class CheckTextFiles {
check = false; check = false;
ignore = true; ignore = true;
} }
for (int i = 0; i < SUFFIX_IGNORE.length; i++) { for (String s : SUFFIX_IGNORE) {
if (suffix.equals(SUFFIX_IGNORE[i])) { if (suffix.equals(s)) {
ignore = true; ignore = true;
} }
} }
boolean checkLicense = true; boolean checkLicense = true;
for (int i = 0; i < suffixIgnoreLicense.length; i++) { for (String ig : suffixIgnoreLicense) {
String ig = suffixIgnoreLicense[i];
if (suffix.equals(ig) || name.endsWith(ig)) { if (suffix.equals(ig) || name.endsWith(ig)) {
checkLicense = false; checkLicense = false;
break; break;
......
...@@ -18,8 +18,8 @@ import java.util.ArrayList; ...@@ -18,8 +18,8 @@ import java.util.ArrayList;
*/ */
public class SwitchSource { public class SwitchSource {
private ArrayList enable = new ArrayList(); private ArrayList<String> enable = new ArrayList<String>();
private ArrayList disable = new ArrayList(); private ArrayList<String> disable = new ArrayList<String>();
/** /**
* This method is called when executing this application from the command * This method is called when executing this application from the command
...@@ -101,9 +101,8 @@ public class SwitchSource { ...@@ -101,9 +101,8 @@ public class SwitchSource {
} else if (name.endsWith(".java")) { } else if (name.endsWith(".java")) {
processFile(f); processFile(f);
} else if (f.isDirectory()) { } else if (f.isDirectory()) {
File[] files = f.listFiles(); for (File file : f.listFiles()) {
for (int i = 0; i < files.length; i++) { process(file);
process(files[i]);
} }
} }
} }
...@@ -135,13 +134,11 @@ public class SwitchSource { ...@@ -135,13 +134,11 @@ public class SwitchSource {
String source = new String(buffer); String source = new String(buffer);
String target = source; String target = source;
target = replaceAll(target, "//##", "//##"); target = replaceAll(target, "//##", "//##");
for (int i = 0; i < enable.size(); i++) { for (String x : enable) {
String x = (String) enable.get(i);
target = replaceAll(target, "/*## " + x + " begin ##", "//## " + x + " begin ##"); target = replaceAll(target, "/*## " + x + " begin ##", "//## " + x + " begin ##");
target = replaceAll(target, "## " + x + " end ##*/", "//## " + x + " end ##"); target = replaceAll(target, "## " + x + " end ##*/", "//## " + x + " end ##");
} }
for (int i = 0; i < disable.size(); i++) { for (String x : disable) {
String x = (String) disable.get(i);
target = replaceAll(target, "//## " + x + " begin ##", "/*## " + x + " begin ##"); target = replaceAll(target, "//## " + x + " begin ##", "/*## " + x + " begin ##");
target = replaceAll(target, "//## " + x + " end ##", "## " + x + " end ##*/"); target = replaceAll(target, "//## " + x + " end ##", "## " + x + " end ##*/");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论