Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d33e4c69
提交
d33e4c69
authored
2月 01, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make methods static if possible.
上级
8f75466e
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
49 行增加
和
57 行删除
+49
-57
Build.java
h2/src/tools/org/h2/build/Build.java
+8
-8
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+15
-15
BnfSyntax.java
h2/src/tools/org/h2/build/doc/BnfSyntax.java
+1
-1
GenerateDoc.java
h2/src/tools/org/h2/build/doc/GenerateDoc.java
+1
-1
GenerateHelp.java
h2/src/tools/org/h2/build/doc/GenerateHelp.java
+0
-4
LinkChecker.java
h2/src/tools/org/h2/build/doc/LinkChecker.java
+1
-1
MergeDocs.java
h2/src/tools/org/h2/build/doc/MergeDocs.java
+2
-2
RailroadImages.java
h2/src/tools/org/h2/build/doc/RailroadImages.java
+1
-1
XMLChecker.java
h2/src/tools/org/h2/build/doc/XMLChecker.java
+1
-1
Doclet.java
h2/src/tools/org/h2/build/doclet/Doclet.java
+1
-1
PrepareTranslation.java
h2/src/tools/org/h2/build/i18n/PrepareTranslation.java
+2
-6
Indexer.java
h2/src/tools/org/h2/build/indexer/Indexer.java
+1
-1
FtpControl.java
h2/src/tools/org/h2/dev/ftp/server/FtpControl.java
+1
-1
FtpServer.java
h2/src/tools/org/h2/dev/ftp/server/FtpServer.java
+1
-1
PgTcpRedirect.java
h2/src/tools/org/h2/dev/net/PgTcpRedirect.java
+1
-1
ArrayUtils.java
h2/src/tools/org/h2/dev/util/ArrayUtils.java
+2
-2
FileViewer.java
h2/src/tools/org/h2/dev/util/FileViewer.java
+5
-5
Migrate.java
h2/src/tools/org/h2/dev/util/Migrate.java
+5
-5
没有找到文件。
h2/src/tools/org/h2/build/Build.java
浏览文件 @
d33e4c69
...
@@ -125,7 +125,7 @@ public class Build extends BuildBase {
...
@@ -125,7 +125,7 @@ public class Build extends BuildBase {
switchSource
(
true
);
switchSource
(
true
);
}
}
private
void
switchSource
(
boolean
enableCheck
)
{
private
static
void
switchSource
(
boolean
enableCheck
)
{
try
{
try
{
String
version
=
System
.
getProperty
(
"version"
);
String
version
=
System
.
getProperty
(
"version"
);
String
check
=
enableCheck
?
"+CHECK"
:
"-CHECK"
;
String
check
=
enableCheck
?
"+CHECK"
:
"-CHECK"
;
...
@@ -190,7 +190,7 @@ public class Build extends BuildBase {
...
@@ -190,7 +190,7 @@ public class Build extends BuildBase {
resources
(
clientOnly
,
basicResourcesOnly
);
resources
(
clientOnly
,
basicResourcesOnly
);
}
}
private
void
filter
(
String
source
,
String
target
,
String
old
,
String
replacement
)
{
private
static
void
filter
(
String
source
,
String
target
,
String
old
,
String
replacement
)
{
String
text
=
new
String
(
readFile
(
new
File
(
source
)));
String
text
=
new
String
(
readFile
(
new
File
(
source
)));
text
=
replaceAll
(
text
,
old
,
replacement
);
text
=
replaceAll
(
text
,
old
,
replacement
);
writeFile
(
new
File
(
target
),
text
.
getBytes
());
writeFile
(
new
File
(
target
),
text
.
getBytes
());
...
@@ -263,15 +263,15 @@ public class Build extends BuildBase {
...
@@ -263,15 +263,15 @@ public class Build extends BuildBase {
"4da67bb4a6eea5dc273f99c50ad2333eadb46f86"
);
"4da67bb4a6eea5dc273f99c50ad2333eadb46f86"
);
}
}
private
String
getVersion
()
{
private
static
String
getVersion
()
{
return
getStaticValue
(
"org.h2.engine.Constants"
,
"getVersion"
);
return
getStaticValue
(
"org.h2.engine.Constants"
,
"getVersion"
);
}
}
private
String
getLuceneJar
()
{
private
static
String
getLuceneJar
()
{
return
"lucene-core-"
+
(
getLuceneVersion
()
==
2
?
"2.2.0"
:
"3.0.2"
)
+
".jar"
;
return
"lucene-core-"
+
(
getLuceneVersion
()
==
2
?
"2.2.0"
:
"3.0.2"
)
+
".jar"
;
}
}
private
int
getLuceneVersion
()
{
private
static
int
getLuceneVersion
()
{
// use Lucene 2 for H2 1.2.x, and Lucene 3 for H2 1.3.x.
// use Lucene 2 for H2 1.2.x, and Lucene 3 for H2 1.3.x.
String
s
=
new
String
(
readFile
(
new
File
(
"src/main/org/h2/engine/Constants.java"
)));
String
s
=
new
String
(
readFile
(
new
File
(
"src/main/org/h2/engine/Constants.java"
)));
int
idx
=
s
.
indexOf
(
"VERSION_MINOR"
)
+
"VERSION_MINOR"
.
length
()
+
3
;
int
idx
=
s
.
indexOf
(
"VERSION_MINOR"
)
+
"VERSION_MINOR"
.
length
()
+
3
;
...
@@ -279,7 +279,7 @@ public class Build extends BuildBase {
...
@@ -279,7 +279,7 @@ public class Build extends BuildBase {
return
Integer
.
parseInt
(
System
.
getProperty
(
"lucene"
,
""
+
version
));
return
Integer
.
parseInt
(
System
.
getProperty
(
"lucene"
,
""
+
version
));
}
}
private
String
getJarSuffix
()
{
private
static
String
getJarSuffix
()
{
return
"-"
+
getVersion
()
+
".jar"
;
return
"-"
+
getVersion
()
+
".jar"
;
}
}
...
@@ -318,7 +318,7 @@ public class Build extends BuildBase {
...
@@ -318,7 +318,7 @@ public class Build extends BuildBase {
updateChecksum
(
"../h2web/html/download.html"
,
sha1Zip
,
sha1Exe
);
updateChecksum
(
"../h2web/html/download.html"
,
sha1Zip
,
sha1Exe
);
}
}
private
void
updateChecksum
(
String
fileName
,
String
sha1Zip
,
String
sha1Exe
)
{
private
static
void
updateChecksum
(
String
fileName
,
String
sha1Zip
,
String
sha1Exe
)
{
String
checksums
=
new
String
(
readFile
(
new
File
(
fileName
)));
String
checksums
=
new
String
(
readFile
(
new
File
(
fileName
)));
checksums
=
replaceAll
(
checksums
,
"<!-- sha1Zip -->"
,
checksums
=
replaceAll
(
checksums
,
"<!-- sha1Zip -->"
,
"(SHA1 checksum: "
+
sha1Zip
+
")"
);
"(SHA1 checksum: "
+
sha1Zip
+
")"
);
...
@@ -468,7 +468,7 @@ public class Build extends BuildBase {
...
@@ -468,7 +468,7 @@ public class Build extends BuildBase {
copy
(
"docs/javadocImpl"
,
files
(
"src/docsrc/javadoc"
),
"src/docsrc/javadoc"
);
copy
(
"docs/javadocImpl"
,
files
(
"src/docsrc/javadoc"
),
"src/docsrc/javadoc"
);
}
}
private
void
manifest
(
String
title
,
String
mainClassName
)
{
private
static
void
manifest
(
String
title
,
String
mainClassName
)
{
String
manifest
=
new
String
(
readFile
(
new
File
(
"src/main/META-INF/MANIFEST.MF"
)));
String
manifest
=
new
String
(
readFile
(
new
File
(
"src/main/META-INF/MANIFEST.MF"
)));
manifest
=
replaceAll
(
manifest
,
"${title}"
,
title
);
manifest
=
replaceAll
(
manifest
,
"${title}"
,
title
);
manifest
=
replaceAll
(
manifest
,
"${version}"
,
getVersion
());
manifest
=
replaceAll
(
manifest
,
"${version}"
,
getVersion
());
...
...
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
d33e4c69
...
@@ -236,7 +236,7 @@ public class BuildBase {
...
@@ -236,7 +236,7 @@ public class BuildBase {
}
}
}
}
private
Object
invoke
(
Method
m
,
Object
instance
,
Object
[]
args
)
{
private
static
Object
invoke
(
Method
m
,
Object
instance
,
Object
[]
args
)
{
try
{
try
{
try
{
try
{
return
m
.
invoke
(
instance
,
args
);
return
m
.
invoke
(
instance
,
args
);
...
@@ -290,7 +290,7 @@ public class BuildBase {
...
@@ -290,7 +290,7 @@ public class BuildBase {
sysOut
.
println
();
sysOut
.
println
();
}
}
private
boolean
isWindows
()
{
private
static
boolean
isWindows
()
{
return
System
.
getProperty
(
"os.name"
).
toLowerCase
().
indexOf
(
"windows"
)
>=
0
;
return
System
.
getProperty
(
"os.name"
).
toLowerCase
().
indexOf
(
"windows"
)
>=
0
;
}
}
...
@@ -340,7 +340,7 @@ public class BuildBase {
...
@@ -340,7 +340,7 @@ public class BuildBase {
}
}
}
}
private
void
copyInThread
(
final
InputStream
in
,
final
OutputStream
out
)
{
private
static
void
copyInThread
(
final
InputStream
in
,
final
OutputStream
out
)
{
new
Thread
()
{
new
Thread
()
{
public
void
run
()
{
public
void
run
()
{
try
{
try
{
...
@@ -367,7 +367,7 @@ public class BuildBase {
...
@@ -367,7 +367,7 @@ public class BuildBase {
* @param fieldName the field name
* @param fieldName the field name
* @return the value as a string
* @return the value as a string
*/
*/
protected
String
getStaticField
(
String
className
,
String
fieldName
)
{
protected
static
String
getStaticField
(
String
className
,
String
fieldName
)
{
try
{
try
{
Class
<?>
clazz
=
Class
.
forName
(
className
);
Class
<?>
clazz
=
Class
.
forName
(
className
);
Field
field
=
clazz
.
getField
(
fieldName
);
Field
field
=
clazz
.
getField
(
fieldName
);
...
@@ -384,7 +384,7 @@ public class BuildBase {
...
@@ -384,7 +384,7 @@ public class BuildBase {
* @param methodName the field name
* @param methodName the field name
* @return the value as a string
* @return the value as a string
*/
*/
protected
String
getStaticValue
(
String
className
,
String
methodName
)
{
protected
static
String
getStaticValue
(
String
className
,
String
methodName
)
{
try
{
try
{
Class
<?>
clazz
=
Class
.
forName
(
className
);
Class
<?>
clazz
=
Class
.
forName
(
className
);
Method
method
=
clazz
.
getMethod
(
methodName
);
Method
method
=
clazz
.
getMethod
(
methodName
);
...
@@ -485,7 +485,7 @@ public class BuildBase {
...
@@ -485,7 +485,7 @@ public class BuildBase {
}
}
}
}
private
String
convertBytesToString
(
byte
[]
value
)
{
private
static
String
convertBytesToString
(
byte
[]
value
)
{
StringBuilder
buff
=
new
StringBuilder
(
value
.
length
*
2
);
StringBuilder
buff
=
new
StringBuilder
(
value
.
length
*
2
);
for
(
byte
c
:
value
)
{
for
(
byte
c
:
value
)
{
int
x
=
c
&
0xff
;
int
x
=
c
&
0xff
;
...
@@ -501,7 +501,7 @@ public class BuildBase {
...
@@ -501,7 +501,7 @@ public class BuildBase {
* @param data the byte array
* @param data the byte array
* @return the SHA1 checksum
* @return the SHA1 checksum
*/
*/
protected
String
getSHA1
(
byte
[]
data
)
{
protected
static
String
getSHA1
(
byte
[]
data
)
{
MessageDigest
md
;
MessageDigest
md
;
try
{
try
{
md
=
MessageDigest
.
getInstance
(
"SHA-1"
);
md
=
MessageDigest
.
getInstance
(
"SHA-1"
);
...
@@ -580,7 +580,7 @@ public class BuildBase {
...
@@ -580,7 +580,7 @@ public class BuildBase {
* @param args the arguments
* @param args the arguments
* @return the string list
* @return the string list
*/
*/
protected
StringList
args
(
String
...
args
)
{
protected
static
StringList
args
(
String
...
args
)
{
return
new
StringList
(
args
);
return
new
StringList
(
args
);
}
}
...
@@ -597,7 +597,7 @@ public class BuildBase {
...
@@ -597,7 +597,7 @@ public class BuildBase {
}
}
}
}
private
String
removeBase
(
String
basePath
,
String
path
)
{
private
static
String
removeBase
(
String
basePath
,
String
path
)
{
if
(
path
.
startsWith
(
basePath
))
{
if
(
path
.
startsWith
(
basePath
))
{
path
=
path
.
substring
(
basePath
.
length
());
path
=
path
.
substring
(
basePath
.
length
());
}
}
...
@@ -653,7 +653,7 @@ public class BuildBase {
...
@@ -653,7 +653,7 @@ public class BuildBase {
* @param fileName the file name
* @param fileName the file name
* @return the suffix or an empty string if there is none
* @return the suffix or an empty string if there is none
*/
*/
String
getSuffix
(
String
fileName
)
{
static
String
getSuffix
(
String
fileName
)
{
int
idx
=
fileName
.
lastIndexOf
(
'.'
);
int
idx
=
fileName
.
lastIndexOf
(
'.'
);
return
idx
<
0
?
""
:
fileName
.
substring
(
idx
);
return
idx
<
0
?
""
:
fileName
.
substring
(
idx
);
}
}
...
@@ -686,7 +686,7 @@ public class BuildBase {
...
@@ -686,7 +686,7 @@ public class BuildBase {
println
(
"Zip "
+
destFile
+
" ("
+
kb
+
" KB)"
);
println
(
"Zip "
+
destFile
+
" ("
+
kb
+
" KB)"
);
}
}
private
long
zipOrJar
(
String
destFile
,
FileList
files
,
String
basePath
,
boolean
storeOnly
,
boolean
sortBySuffix
,
boolean
jar
)
{
private
static
long
zipOrJar
(
String
destFile
,
FileList
files
,
String
basePath
,
boolean
storeOnly
,
boolean
sortBySuffix
,
boolean
jar
)
{
if
(
sortBySuffix
)
{
if
(
sortBySuffix
)
{
// for better compressibility, sort by suffix, then name
// for better compressibility, sort by suffix, then name
Collections
.
sort
(
files
,
new
Comparator
<
File
>()
{
Collections
.
sort
(
files
,
new
Comparator
<
File
>()
{
...
@@ -742,11 +742,11 @@ public class BuildBase {
...
@@ -742,11 +742,11 @@ public class BuildBase {
*
*
* @return the java specification version
* @return the java specification version
*/
*/
protected
String
getJavaSpecVersion
()
{
protected
static
String
getJavaSpecVersion
()
{
return
System
.
getProperty
(
"java.specification.version"
);
return
System
.
getProperty
(
"java.specification.version"
);
}
}
private
List
<
String
>
getPaths
(
FileList
files
)
{
private
static
List
<
String
>
getPaths
(
FileList
files
)
{
StringList
list
=
new
StringList
();
StringList
list
=
new
StringList
();
for
(
File
f
:
files
)
{
for
(
File
f
:
files
)
{
list
.
add
(
f
.
getPath
());
list
.
add
(
f
.
getPath
());
...
@@ -811,7 +811,7 @@ public class BuildBase {
...
@@ -811,7 +811,7 @@ public class BuildBase {
*
*
* @param dir the directory to create
* @param dir the directory to create
*/
*/
protected
void
mkdir
(
String
dir
)
{
protected
static
void
mkdir
(
String
dir
)
{
File
f
=
new
File
(
dir
);
File
f
=
new
File
(
dir
);
if
(
f
.
exists
())
{
if
(
f
.
exists
())
{
if
(
f
.
isFile
())
{
if
(
f
.
isFile
())
{
...
@@ -822,7 +822,7 @@ public class BuildBase {
...
@@ -822,7 +822,7 @@ public class BuildBase {
}
}
}
}
private
void
mkdirs
(
File
f
)
{
private
static
void
mkdirs
(
File
f
)
{
if
(!
f
.
exists
())
{
if
(!
f
.
exists
())
{
if
(!
f
.
mkdirs
())
{
if
(!
f
.
mkdirs
())
{
throw
new
RuntimeException
(
"Can not create directory "
+
f
.
getAbsolutePath
());
throw
new
RuntimeException
(
"Can not create directory "
+
f
.
getAbsolutePath
());
...
...
h2/src/tools/org/h2/build/doc/BnfSyntax.java
浏览文件 @
d33e4c69
...
@@ -31,7 +31,7 @@ public class BnfSyntax implements BnfVisitor {
...
@@ -31,7 +31,7 @@ public class BnfSyntax implements BnfVisitor {
*/
*/
public
String
getHtml
(
Bnf
bnf
,
String
syntaxLines
)
{
public
String
getHtml
(
Bnf
bnf
,
String
syntaxLines
)
{
syntaxLines
=
StringUtils
.
replaceAll
(
syntaxLines
,
"\n "
,
"\n"
);
syntaxLines
=
StringUtils
.
replaceAll
(
syntaxLines
,
"\n "
,
"\n"
);
StringTokenizer
tokenizer
=
b
nf
.
getTokenizer
(
syntaxLines
);
StringTokenizer
tokenizer
=
B
nf
.
getTokenizer
(
syntaxLines
);
StringBuilder
buff
=
new
StringBuilder
();
StringBuilder
buff
=
new
StringBuilder
();
while
(
tokenizer
.
hasMoreTokens
())
{
while
(
tokenizer
.
hasMoreTokens
())
{
String
s
=
tokenizer
.
nextToken
();
String
s
=
tokenizer
.
nextToken
();
...
...
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
d33e4c69
...
@@ -176,7 +176,7 @@ public class GenerateDoc {
...
@@ -176,7 +176,7 @@ public class GenerateDoc {
}
}
}
}
private
String
addCode
(
String
text
)
{
private
static
String
addCode
(
String
text
)
{
text
=
StringUtils
.
replaceAll
(
text
,
"""
,
"\""
);
text
=
StringUtils
.
replaceAll
(
text
,
"""
,
"\""
);
StringBuilder
buff
=
new
StringBuilder
(
text
.
length
());
StringBuilder
buff
=
new
StringBuilder
(
text
.
length
());
int
len
=
text
.
length
();
int
len
=
text
.
length
();
...
...
h2/src/tools/org/h2/build/doc/GenerateHelp.java
浏览文件 @
d33e4c69
...
@@ -26,10 +26,6 @@ public class GenerateHelp {
...
@@ -26,10 +26,6 @@ public class GenerateHelp {
* @param args the command line parameters
* @param args the command line parameters
*/
*/
public
static
void
main
(
String
...
args
)
throws
Exception
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
new
GenerateHelp
().
run
();
}
private
void
run
()
throws
Exception
{
String
in
=
"src/docsrc/help/help.csv"
;
String
in
=
"src/docsrc/help/help.csv"
;
String
out
=
"src/main/org/h2/res/help.csv"
;
String
out
=
"src/main/org/h2/res/help.csv"
;
Csv
csv
=
Csv
.
getInstance
();
Csv
csv
=
Csv
.
getInstance
();
...
...
h2/src/tools/org/h2/build/doc/LinkChecker.java
浏览文件 @
d33e4c69
...
@@ -219,7 +219,7 @@ public class LinkChecker {
...
@@ -219,7 +219,7 @@ public class LinkChecker {
}
}
}
}
private
void
error
(
String
fileName
,
String
string
)
{
private
static
void
error
(
String
fileName
,
String
string
)
{
System
.
out
.
println
(
"ERROR with "
+
fileName
+
": "
+
string
);
System
.
out
.
println
(
"ERROR with "
+
fileName
+
": "
+
string
);
}
}
...
...
h2/src/tools/org/h2/build/doc/MergeDocs.java
浏览文件 @
d33e4c69
...
@@ -60,7 +60,7 @@ public class MergeDocs {
...
@@ -60,7 +60,7 @@ public class MergeDocs {
writer
.
close
();
writer
.
close
();
}
}
private
String
disableRailroads
(
String
text
)
{
private
static
String
disableRailroads
(
String
text
)
{
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- railroad-start -->"
,
"<!-- railroad-start "
);
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- railroad-start -->"
,
"<!-- railroad-start "
);
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- railroad-end -->"
,
" railroad-end -->"
);
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- railroad-end -->"
,
" railroad-end -->"
);
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- syntax-start"
,
"<!-- syntax-start -->"
);
text
=
StringUtils
.
replaceAll
(
text
,
"<!-- syntax-start"
,
"<!-- syntax-start -->"
);
...
@@ -68,7 +68,7 @@ public class MergeDocs {
...
@@ -68,7 +68,7 @@ public class MergeDocs {
return
text
;
return
text
;
}
}
private
String
removeHeaderFooter
(
String
fileName
,
String
text
)
{
private
static
String
removeHeaderFooter
(
String
fileName
,
String
text
)
{
// String start = "<body";
// String start = "<body";
// String end = "</body>";
// String end = "</body>";
...
...
h2/src/tools/org/h2/build/doc/RailroadImages.java
浏览文件 @
d33e4c69
...
@@ -98,7 +98,7 @@ public class RailroadImages {
...
@@ -98,7 +98,7 @@ public class RailroadImages {
}
}
}
}
private
BufferedImage
flipHorizontal
(
BufferedImage
img
)
{
private
static
BufferedImage
flipHorizontal
(
BufferedImage
img
)
{
int
w
=
img
.
getWidth
(),
h
=
img
.
getHeight
();
int
w
=
img
.
getWidth
(),
h
=
img
.
getHeight
();
BufferedImage
copy
=
new
BufferedImage
(
w
,
h
,
img
.
getType
());
BufferedImage
copy
=
new
BufferedImage
(
w
,
h
,
img
.
getType
());
Graphics2D
g
=
copy
.
createGraphics
();
Graphics2D
g
=
copy
.
createGraphics
();
...
...
h2/src/tools/org/h2/build/doc/XMLChecker.java
浏览文件 @
d33e4c69
...
@@ -53,7 +53,7 @@ public class XMLChecker {
...
@@ -53,7 +53,7 @@ public class XMLChecker {
}
}
}
}
private
void
processFile
(
String
fileName
)
throws
Exception
{
private
static
void
processFile
(
String
fileName
)
throws
Exception
{
int
idx
=
fileName
.
lastIndexOf
(
'.'
);
int
idx
=
fileName
.
lastIndexOf
(
'.'
);
if
(
idx
<
0
)
{
if
(
idx
<
0
)
{
return
;
return
;
...
...
h2/src/tools/org/h2/build/doclet/Doclet.java
浏览文件 @
d33e4c69
...
@@ -427,7 +427,7 @@ public class Doclet {
...
@@ -427,7 +427,7 @@ public class Doclet {
return
false
;
return
false
;
}
}
private
Type
getReturnType
(
ExecutableMemberDoc
method
)
{
private
static
Type
getReturnType
(
ExecutableMemberDoc
method
)
{
if
(
method
instanceof
MethodDoc
)
{
if
(
method
instanceof
MethodDoc
)
{
MethodDoc
m
=
(
MethodDoc
)
method
;
MethodDoc
m
=
(
MethodDoc
)
method
;
return
m
.
returnType
();
return
m
.
returnType
();
...
...
h2/src/tools/org/h2/build/i18n/PrepareTranslation.java
浏览文件 @
d33e4c69
...
@@ -43,10 +43,6 @@ public class PrepareTranslation {
...
@@ -43,10 +43,6 @@ public class PrepareTranslation {
* @param args the command line parameters
* @param args the command line parameters
*/
*/
public
static
void
main
(
String
...
args
)
throws
Exception
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
new
PrepareTranslation
().
run
();
}
private
void
run
()
throws
Exception
{
String
baseDir
=
"src/docsrc/textbase"
;
String
baseDir
=
"src/docsrc/textbase"
;
prepare
(
baseDir
,
"src/main/org/h2/res"
,
true
);
prepare
(
baseDir
,
"src/main/org/h2/res"
,
true
);
prepare
(
baseDir
,
"src/main/org/h2/server/web/res"
,
true
);
prepare
(
baseDir
,
"src/main/org/h2/server/web/res"
,
true
);
...
@@ -391,7 +387,7 @@ public class PrepareTranslation {
...
@@ -391,7 +387,7 @@ public class PrepareTranslation {
prop
.
setProperty
(
document
,
s
);
prop
.
setProperty
(
document
,
s
);
}
}
private
void
prepare
(
String
baseDir
,
String
path
,
boolean
utf8
)
throws
IOException
{
private
static
void
prepare
(
String
baseDir
,
String
path
,
boolean
utf8
)
throws
IOException
{
String
suffix
=
utf8
?
".prop"
:
".properties"
;
String
suffix
=
utf8
?
".prop"
:
".properties"
;
File
dir
=
new
File
(
path
);
File
dir
=
new
File
(
path
);
File
main
=
null
;
File
main
=
null
;
...
@@ -435,7 +431,7 @@ public class PrepareTranslation {
...
@@ -435,7 +431,7 @@ public class PrepareTranslation {
}
}
}
}
private
void
prepare
(
Properties
main
,
Properties
base
,
File
trans
,
boolean
utf8
)
throws
IOException
{
private
static
void
prepare
(
Properties
main
,
Properties
base
,
File
trans
,
boolean
utf8
)
throws
IOException
{
SortedProperties
p
=
load
(
trans
.
getAbsolutePath
(),
utf8
);
SortedProperties
p
=
load
(
trans
.
getAbsolutePath
(),
utf8
);
Properties
oldTranslations
=
new
Properties
();
Properties
oldTranslations
=
new
Properties
();
for
(
Object
k
:
base
.
keySet
())
{
for
(
Object
k
:
base
.
keySet
())
{
...
...
h2/src/tools/org/h2/build/indexer/Indexer.java
浏览文件 @
d33e4c69
...
@@ -354,7 +354,7 @@ public class Indexer {
...
@@ -354,7 +354,7 @@ public class Indexer {
}
}
}
}
private
String
convertUTF
(
String
s
)
{
private
static
String
convertUTF
(
String
s
)
{
s
=
StringUtils
.
quoteJavaString
(
s
);
s
=
StringUtils
.
quoteJavaString
(
s
);
s
=
s
.
substring
(
1
,
s
.
length
()
-
1
);
s
=
s
.
substring
(
1
,
s
.
length
()
-
1
);
return
s
;
return
s
;
...
...
h2/src/tools/org/h2/dev/ftp/server/FtpControl.java
浏览文件 @
d33e4c69
...
@@ -214,7 +214,7 @@ public class FtpControl extends Thread {
...
@@ -214,7 +214,7 @@ public class FtpControl extends Thread {
if
(
"PWD"
.
equals
(
command
))
{
if
(
"PWD"
.
equals
(
command
))
{
reply
(
257
,
StringUtils
.
quoteIdentifier
(
currentDir
)
+
" directory"
);
reply
(
257
,
StringUtils
.
quoteIdentifier
(
currentDir
)
+
" directory"
);
}
else
if
(
"PASV"
.
equals
(
command
))
{
}
else
if
(
"PASV"
.
equals
(
command
))
{
ServerSocket
dataSocket
=
s
erver
.
createDataSocket
();
ServerSocket
dataSocket
=
FtpS
erver
.
createDataSocket
();
data
=
new
FtpData
(
server
,
control
.
getInetAddress
(),
dataSocket
);
data
=
new
FtpData
(
server
,
control
.
getInetAddress
(),
dataSocket
);
data
.
start
();
data
.
start
();
int
port
=
dataSocket
.
getLocalPort
();
int
port
=
dataSocket
.
getLocalPort
();
...
...
h2/src/tools/org/h2/dev/ftp/server/FtpServer.java
浏览文件 @
d33e4c69
...
@@ -215,7 +215,7 @@ public class FtpServer extends Tool implements Service {
...
@@ -215,7 +215,7 @@ public class FtpServer extends Tool implements Service {
*
*
* @return the server socket
* @return the server socket
*/
*/
ServerSocket
createDataSocket
()
{
static
ServerSocket
createDataSocket
()
{
return
NetUtils
.
createServerSocket
(
0
,
false
);
return
NetUtils
.
createServerSocket
(
0
,
false
);
}
}
...
...
h2/src/tools/org/h2/dev/net/PgTcpRedirect.java
浏览文件 @
d33e4c69
...
@@ -537,7 +537,7 @@ public class PgTcpRedirect {
...
@@ -537,7 +537,7 @@ public class PgTcpRedirect {
* @param buffer the byte array
* @param buffer the byte array
* @param len the length
* @param len the length
*/
*/
synchronized
void
printData
(
byte
[]
buffer
,
int
len
)
{
synchronized
static
void
printData
(
byte
[]
buffer
,
int
len
)
{
if
(
DEBUG
)
{
if
(
DEBUG
)
{
System
.
out
.
print
(
" "
);
System
.
out
.
print
(
" "
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
...
...
h2/src/tools/org/h2/dev/util/ArrayUtils.java
浏览文件 @
d33e4c69
...
@@ -22,7 +22,7 @@ public class ArrayUtils {
...
@@ -22,7 +22,7 @@ public class ArrayUtils {
* @param right the index of the rightmost element
* @param right the index of the rightmost element
* @param comp the comparison class
* @param comp the comparison class
*/
*/
public
<
T
>
void
binaryInsertionSort
(
T
[]
d
,
int
left
,
int
right
,
Comparator
<
T
>
comp
)
{
public
static
<
T
>
void
binaryInsertionSort
(
T
[]
d
,
int
left
,
int
right
,
Comparator
<
T
>
comp
)
{
for
(
int
i
=
left
+
1
;
i
<=
right
;
i
++)
{
for
(
int
i
=
left
+
1
;
i
<=
right
;
i
++)
{
T
t
=
d
[
i
];
T
t
=
d
[
i
];
int
l
=
left
;
int
l
=
left
;
...
@@ -50,7 +50,7 @@ public class ArrayUtils {
...
@@ -50,7 +50,7 @@ public class ArrayUtils {
* @param right the index of the rightmost element
* @param right the index of the rightmost element
* @param comp the comparison class
* @param comp the comparison class
*/
*/
public
<
T
>
void
insertionSort
(
T
[]
d
,
int
left
,
int
right
,
Comparator
<
T
>
comp
)
{
public
static
<
T
>
void
insertionSort
(
T
[]
d
,
int
left
,
int
right
,
Comparator
<
T
>
comp
)
{
for
(
int
i
=
left
+
1
,
j
;
i
<=
right
;
i
++)
{
for
(
int
i
=
left
+
1
,
j
;
i
<=
right
;
i
++)
{
T
t
=
d
[
i
];
T
t
=
d
[
i
];
for
(
j
=
i
-
1
;
j
>=
left
&&
comp
.
compare
(
d
[
j
],
t
)
>
0
;
j
--)
{
for
(
j
=
i
-
1
;
j
>=
left
&&
comp
.
compare
(
d
[
j
],
t
)
>
0
;
j
--)
{
...
...
h2/src/tools/org/h2/dev/util/FileViewer.java
浏览文件 @
d33e4c69
...
@@ -86,7 +86,7 @@ public class FileViewer extends Tool {
...
@@ -86,7 +86,7 @@ public class FileViewer extends Tool {
}
}
}
}
private
void
process
(
String
fileName
,
String
find
,
boolean
head
,
boolean
tail
,
long
start
,
int
lines
,
boolean
quiet
)
throws
IOException
{
private
static
void
process
(
String
fileName
,
String
find
,
boolean
head
,
boolean
tail
,
long
start
,
int
lines
,
boolean
quiet
)
throws
IOException
{
RandomAccessFile
file
=
new
RandomAccessFile
(
fileName
,
"r"
);
RandomAccessFile
file
=
new
RandomAccessFile
(
fileName
,
"r"
);
long
length
=
file
.
length
();
long
length
=
file
.
length
();
if
(
head
)
{
if
(
head
)
{
...
@@ -121,7 +121,7 @@ public class FileViewer extends Tool {
...
@@ -121,7 +121,7 @@ public class FileViewer extends Tool {
}
}
}
}
private
long
find
(
RandomAccessFile
file
,
byte
[]
find
,
boolean
quiet
)
throws
IOException
{
private
static
long
find
(
RandomAccessFile
file
,
byte
[]
find
,
boolean
quiet
)
throws
IOException
{
long
pos
=
file
.
getFilePointer
();
long
pos
=
file
.
getFilePointer
();
long
length
=
file
.
length
();
long
length
=
file
.
length
();
int
bufferSize
=
4
*
1024
;
int
bufferSize
=
4
*
1024
;
...
@@ -150,7 +150,7 @@ public class FileViewer extends Tool {
...
@@ -150,7 +150,7 @@ public class FileViewer extends Tool {
return
-
1
;
return
-
1
;
}
}
private
int
find
(
byte
[]
data
,
byte
[]
find
,
int
max
)
{
private
static
int
find
(
byte
[]
data
,
byte
[]
find
,
int
max
)
{
outer:
outer:
for
(
int
i
=
0
;
i
<
max
;
i
++)
{
for
(
int
i
=
0
;
i
<
max
;
i
++)
{
for
(
int
j
=
0
;
j
<
find
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
find
.
length
;
j
++)
{
...
@@ -163,7 +163,7 @@ public class FileViewer extends Tool {
...
@@ -163,7 +163,7 @@ public class FileViewer extends Tool {
return
-
1
;
return
-
1
;
}
}
private
void
list
(
long
pos
,
String
header
,
ArrayList
<
String
>
list
)
{
private
static
void
list
(
long
pos
,
String
header
,
ArrayList
<
String
>
list
)
{
System
.
out
.
println
(
"-----------------------------------------------"
);
System
.
out
.
println
(
"-----------------------------------------------"
);
System
.
out
.
println
(
"["
+
pos
+
"]: "
+
header
);
System
.
out
.
println
(
"["
+
pos
+
"]: "
+
header
);
System
.
out
.
println
(
"-----------------------------------------------"
);
System
.
out
.
println
(
"-----------------------------------------------"
);
...
@@ -173,7 +173,7 @@ public class FileViewer extends Tool {
...
@@ -173,7 +173,7 @@ public class FileViewer extends Tool {
System
.
out
.
println
(
"-----------------------------------------------"
);
System
.
out
.
println
(
"-----------------------------------------------"
);
}
}
private
ArrayList
<
String
>
readLines
(
RandomAccessFile
file
,
int
maxLines
)
throws
IOException
{
private
static
ArrayList
<
String
>
readLines
(
RandomAccessFile
file
,
int
maxLines
)
throws
IOException
{
ArrayList
<
String
>
lines
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
lines
=
new
ArrayList
<
String
>();
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
(
100
);
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
(
100
);
boolean
lastNewline
=
false
;
boolean
lastNewline
=
false
;
...
...
h2/src/tools/org/h2/dev/util/Migrate.java
浏览文件 @
d33e4c69
...
@@ -93,7 +93,7 @@ public class Migrate {
...
@@ -93,7 +93,7 @@ public class Migrate {
new
File
(
TEMP_SCRIPT
).
delete
();
new
File
(
TEMP_SCRIPT
).
delete
();
}
}
private
String
getJavaExecutablePath
()
{
private
static
String
getJavaExecutablePath
()
{
String
pathToJava
;
String
pathToJava
;
if
(
File
.
separator
.
equals
(
"\\"
))
{
if
(
File
.
separator
.
equals
(
"\\"
))
{
pathToJava
=
System
.
getProperty
(
"java.home"
)
+
File
.
separator
+
"bin"
+
File
.
separator
+
"java.exe"
;
pathToJava
=
System
.
getProperty
(
"java.home"
)
+
File
.
separator
+
"bin"
+
File
.
separator
+
"java.exe"
;
...
@@ -149,7 +149,7 @@ public class Migrate {
...
@@ -149,7 +149,7 @@ public class Migrate {
writeFile
(
targetFile
,
data
);
writeFile
(
targetFile
,
data
);
}
}
private
void
mkdirs
(
File
f
)
{
private
static
void
mkdirs
(
File
f
)
{
if
(!
f
.
exists
())
{
if
(!
f
.
exists
())
{
if
(!
f
.
mkdirs
())
{
if
(!
f
.
mkdirs
())
{
throw
new
RuntimeException
(
"Can not create directory "
+
f
.
getAbsolutePath
());
throw
new
RuntimeException
(
"Can not create directory "
+
f
.
getAbsolutePath
());
...
@@ -169,7 +169,7 @@ public class Migrate {
...
@@ -169,7 +169,7 @@ public class Migrate {
}
}
}
}
private
String
getSHA1
(
byte
[]
data
)
{
private
static
String
getSHA1
(
byte
[]
data
)
{
MessageDigest
md
;
MessageDigest
md
;
try
{
try
{
md
=
MessageDigest
.
getInstance
(
"SHA-1"
);
md
=
MessageDigest
.
getInstance
(
"SHA-1"
);
...
@@ -179,7 +179,7 @@ public class Migrate {
...
@@ -179,7 +179,7 @@ public class Migrate {
}
}
}
}
private
String
convertBytesToString
(
byte
[]
value
)
{
private
static
String
convertBytesToString
(
byte
[]
value
)
{
StringBuilder
buff
=
new
StringBuilder
(
value
.
length
*
2
);
StringBuilder
buff
=
new
StringBuilder
(
value
.
length
*
2
);
for
(
byte
c
:
value
)
{
for
(
byte
c
:
value
)
{
int
x
=
c
&
0xff
;
int
x
=
c
&
0xff
;
...
@@ -216,7 +216,7 @@ public class Migrate {
...
@@ -216,7 +216,7 @@ public class Migrate {
}
}
}
}
private
void
copyInThread
(
final
InputStream
in
,
final
OutputStream
out
)
{
private
static
void
copyInThread
(
final
InputStream
in
,
final
OutputStream
out
)
{
new
Thread
()
{
new
Thread
()
{
public
void
run
()
{
public
void
run
()
{
try
{
try
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论