Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c23dcee7
提交
c23dcee7
authored
7月 26, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
automate release process
上级
22f467ed
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
139 行增加
和
39 行删除
+139
-39
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+7
-0
SamplesTest.java
h2/src/test/org/h2/test/jaqu/SamplesTest.java
+5
-6
Build.java
h2/src/tools/org/h2/build/Build.java
+4
-4
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+120
-26
SwitchSource.java
h2/src/tools/org/h2/build/code/SwitchSource.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
c23dcee7
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
c23dcee7
...
...
@@ -270,6 +270,13 @@ java org.h2.test.TestAll timer
/*
H2 databases need to have a file name prefix.
Probably the database should throw a meaningful exception
if the last element in the URL path is a slash (or backslash).
I will try to implement that for the next release.
Improved compatibility with DB2: support for FETCH .. ROWS
drop table test;
create table test(a int);
insert into test values(1);
...
...
h2/src/test/org/h2/test/jaqu/SamplesTest.java
浏览文件 @
c23dcee7
...
...
@@ -6,8 +6,8 @@
*/
package
org
.
h2
.
test
.
jaqu
;
//## Java 1.5 begin ##
import
java.math.BigDecimal
;
//## Java 1.5 begin ##
import
java.util.List
;
import
org.h2.jaqu.Db
;
...
...
@@ -179,13 +179,13 @@ public class SamplesTest extends TestBase {
/**
* A result set class containing the product name and price.
*/
//## Java 1.5 begin ##
public
static
class
ProductPrice
{
public
String
productName
;
public
String
category
;
public
Double
price
;
}
//## Java 1.5 begin ##
private
void
testAnonymousTypes3
()
throws
Exception
{
// var productInfos =
...
...
@@ -220,13 +220,13 @@ public class SamplesTest extends TestBase {
/**
* A result set class containing customer data and the order total.
*/
//## Java 1.5 begin ##
public
static
class
CustOrder
{
public
String
customerId
;
public
Integer
orderId
;
public
BigDecimal
total
;
}
//## Java 1.5 begin ##
private
void
testSelectManyCompoundFrom2
()
throws
Exception
{
// var orders =
...
...
@@ -280,18 +280,17 @@ public class SamplesTest extends TestBase {
long
count
=
db
.
from
(
new
Product
()).
selectCount
();
assertEquals
(
77
,
count
);
}
//## Java 1.5 end ##
//## Java 1.5 end ##
/**
* A result set class containing product groups.
*/
//## Java 1.5 begin ##
public
static
class
ProductGroup
{
public
String
category
;
public
Long
productCount
;
}
//## Java 1.5 begin ##
private
void
testGroup
()
throws
Exception
{
// var orderGroups =
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
c23dcee7
...
...
@@ -242,7 +242,7 @@ public class Build extends BuildBase {
mkdir
(
"docs/javadoc"
);
javadoc
(
new
String
[]
{
"-sourcepath"
,
"src/main"
,
"org.h2.jdbc"
,
"org.h2.jdbcx"
,
"org.h2.tools"
,
"org.h2.api"
,
"org.h2.constant"
,
"-doclet"
,
"org.h2.build.doclet.Doclet"
});
"-doclet"
,
"org.h2.build.doclet.Doclet"
});
copy
(
"docs/javadoc"
,
getFiles
(
"src/docsrc/javadoc"
),
"src/docsrc/javadoc"
);
}
...
...
@@ -250,8 +250,7 @@ public class Build extends BuildBase {
* Create the Javadocs of the implementation.
*/
public
void
javadocImpl
()
{
mkdir
(
"docs/javadocImpl"
);
mkdir
(
"docs/javadocImpl2"
);
javadoc
(
new
String
[]
{
"-sourcepath"
,
"src/main"
+
File
.
pathSeparator
+
"src/test"
+
File
.
pathSeparator
+
"src/tools"
,
...
...
@@ -263,7 +262,7 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/lucene-core-2.2.0.jar"
,
"-subpackages"
,
"org.h2"
,
"-exclude"
,
"org.h2.
build.*,org.h2.dev.*
"
});
"-exclude"
,
"org.h2.
test.jaqu:org.h2.jaqu
"
});
System
.
setProperty
(
"h2.interfacesOnly"
,
"false"
);
System
.
setProperty
(
"h2.destDir"
,
"docs/javadocImpl"
);
...
...
@@ -274,6 +273,7 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/lucene-core-2.2.0.jar"
,
"-subpackages"
,
"org.h2"
,
"-exclude"
,
"org.h2.test.jaqu:org.h2.jaqu"
,
"-package"
,
"-doclet"
,
"org.h2.build.doclet.Doclet"
});
copy
(
"docs/javadocImpl"
,
getFiles
(
"src/docsrc/javadoc"
),
"src/docsrc/javadoc"
);
...
...
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
c23dcee7
...
...
@@ -11,6 +11,7 @@ import java.io.BufferedOutputStream;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.FilterOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
...
...
@@ -78,6 +79,11 @@ public class BuildBase {
*/
protected
PrintStream
out
=
System
.
out
;
/**
* If output should be disabled.
*/
protected
boolean
quiet
;
/**
* This method should be called by the main method.
*
...
...
@@ -90,6 +96,9 @@ public class BuildBase {
}
else
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
String
a
=
args
[
i
];
if
(
"-quiet"
.
equals
(
a
))
{
quiet
=
true
;
}
else
{
Method
m
=
null
;
try
{
m
=
getClass
().
getMethod
(
a
,
new
Class
[
0
]);
...
...
@@ -98,11 +107,12 @@ public class BuildBase {
projectHelp
();
break
;
}
out
.
println
(
"Target: "
+
a
);
println
(
"Target: "
+
a
);
invoke
(
m
,
this
,
new
Object
[
0
]);
}
}
out
.
println
(
"Done in "
+
(
System
.
currentTimeMillis
()
-
time
)
+
" ms"
);
}
println
(
"Done in "
+
(
System
.
currentTimeMillis
()
-
time
)
+
" ms"
);
}
private
Object
invoke
(
Method
m
,
Object
instance
,
Object
[]
args
)
{
...
...
@@ -178,19 +188,19 @@ public class BuildBase {
*/
protected
int
exec
(
String
command
,
String
[]
args
)
{
try
{
out
.
print
(
command
);
print
(
command
);
for
(
int
i
=
0
;
args
!=
null
&&
i
<
args
.
length
;
i
++)
{
out
.
print
(
" "
+
args
[
i
]);
print
(
" "
+
args
[
i
]);
}
out
.
println
(
);
println
(
""
);
String
[]
cmdArray
=
new
String
[
1
+
(
args
==
null
?
0
:
args
.
length
)];
cmdArray
[
0
]
=
command
;
if
(
args
!=
null
)
{
System
.
arraycopy
(
args
,
0
,
cmdArray
,
1
,
args
.
length
);
}
Process
p
=
Runtime
.
getRuntime
().
exec
(
cmdArray
);
copyInThread
(
p
.
getInputStream
(),
out
);
copyInThread
(
p
.
getErrorStream
(),
out
);
copyInThread
(
p
.
getInputStream
(),
quiet
?
null
:
out
);
copyInThread
(
p
.
getErrorStream
(),
quiet
?
null
:
out
);
p
.
waitFor
();
return
p
.
exitValue
();
}
catch
(
Exception
e
)
{
...
...
@@ -207,8 +217,10 @@ public class BuildBase {
if
(
x
<
0
)
{
return
;
}
if
(
out
!=
null
)
{
out
.
write
(
x
);
}
}
}
catch
(
Exception
e
)
{
throw
new
Error
(
"Error: "
+
e
,
e
);
}
...
...
@@ -260,7 +272,7 @@ public class BuildBase {
protected
void
copy
(
String
targetDir
,
List
files
,
String
baseDir
)
{
File
target
=
new
File
(
targetDir
);
File
base
=
new
File
(
baseDir
);
out
.
println
(
"Copying "
+
files
.
size
()
+
" files to "
+
target
.
getPath
());
println
(
"Copying "
+
files
.
size
()
+
" files to "
+
target
.
getPath
());
String
basePath
=
base
.
getPath
();
for
(
int
i
=
0
;
i
<
files
.
size
();
i
++)
{
File
f
=
(
File
)
files
.
get
(
i
);
...
...
@@ -271,6 +283,45 @@ public class BuildBase {
}
}
private
PrintStream
filter
(
PrintStream
out
,
final
String
[]
exclude
)
{
return
new
PrintStream
(
new
FilterOutputStream
(
out
)
{
private
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
();
public
void
write
(
byte
[]
b
)
throws
IOException
{
write
(
b
,
0
,
b
.
length
);
}
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
for
(
int
i
=
off
;
i
<
len
;
i
++)
{
write
(
b
[
i
]);
}
}
public
void
write
(
byte
b
)
throws
IOException
{
buff
.
write
(
b
);
if
(
b
==
'\n'
)
{
byte
[]
data
=
buff
.
toByteArray
();
String
line
=
new
String
(
data
,
"UTF-8"
);
boolean
print
=
true
;
for
(
int
i
=
0
;
i
<
exclude
.
length
;
i
++)
{
if
(
line
.
startsWith
(
exclude
[
i
]))
{
print
=
false
;
break
;
}
}
if
(
print
)
{
out
.
write
(
data
);
}
buff
.
reset
();
}
}
public
void
close
()
throws
IOException
{
write
(
'\n'
);
}
});
}
/**
* Run a Javadoc task.
*
...
...
@@ -278,13 +329,25 @@ public class BuildBase {
*/
protected
void
javadoc
(
String
[]
args
)
{
int
result
;
PrintStream
old
=
System
.
out
;
try
{
out
.
println
(
"Javadoc"
);
println
(
"Javadoc"
);
if
(
quiet
)
{
System
.
setOut
(
filter
(
System
.
out
,
new
String
[]
{
"Loading source files for package"
,
"Constructing Javadoc information"
,
"Generating "
,
"Standard Doclet"
,
"Building "
}));
}
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javadoc.Main"
);
Method
execute
=
clazz
.
getMethod
(
"execute"
,
new
Class
[]
{
String
[].
class
});
result
=
((
Integer
)
invoke
(
execute
,
null
,
new
Object
[]
{
args
})).
intValue
();
}
catch
(
Exception
e
)
{
result
=
exec
(
"javadoc"
,
args
);
}
finally
{
System
.
setOut
(
old
);
}
if
(
result
!=
0
)
{
throw
new
Error
(
"An error occurred"
);
...
...
@@ -328,7 +391,7 @@ public class BuildBase {
targetFile
.
getAbsoluteFile
().
getParentFile
().
mkdirs
();
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
();
try
{
out
.
println
(
"Downloading "
+
fileURL
);
println
(
"Downloading "
+
fileURL
);
URL
url
=
new
URL
(
fileURL
);
InputStream
in
=
new
BufferedInputStream
(
url
.
openStream
());
long
last
=
System
.
currentTimeMillis
();
...
...
@@ -336,7 +399,7 @@ public class BuildBase {
while
(
true
)
{
long
now
=
System
.
currentTimeMillis
();
if
(
now
>
last
+
1000
)
{
out
.
println
(
"Downloaded "
+
len
+
" bytes"
);
println
(
"Downloaded "
+
len
+
" bytes"
);
last
=
now
;
}
int
x
=
in
.
read
();
...
...
@@ -353,7 +416,7 @@ public class BuildBase {
byte
[]
data
=
buff
.
toByteArray
();
String
got
=
getSHA1
(
data
);
if
(
sha1Checksum
==
null
)
{
out
.
println
(
"SHA1 checksum: "
+
got
);
println
(
"SHA1 checksum: "
+
got
);
}
else
{
if
(!
got
.
equals
(
sha1Checksum
))
{
...
...
@@ -492,7 +555,7 @@ public class BuildBase {
*/
protected
void
jar
(
String
destFile
,
List
files
,
String
basePath
)
{
long
kb
=
zipOrJar
(
destFile
,
files
,
basePath
,
false
,
false
,
true
);
out
.
println
(
"Jar "
+
destFile
+
" ("
+
kb
+
" KB)"
);
println
(
"Jar "
+
destFile
+
" ("
+
kb
+
" KB)"
);
}
/**
...
...
@@ -506,7 +569,7 @@ public class BuildBase {
*/
protected
void
zip
(
String
destFile
,
List
files
,
String
basePath
,
boolean
storeOnly
,
boolean
sortBySuffix
)
{
long
kb
=
zipOrJar
(
destFile
,
files
,
basePath
,
storeOnly
,
sortBySuffix
,
false
);
out
.
println
(
"Zip "
+
destFile
+
" ("
+
kb
+
" KB)"
);
println
(
"Zip "
+
destFile
+
" ("
+
kb
+
" KB)"
);
}
private
long
zipOrJar
(
String
destFile
,
List
files
,
String
basePath
,
boolean
storeOnly
,
boolean
sortBySuffix
,
boolean
jar
)
{
...
...
@@ -585,13 +648,19 @@ public class BuildBase {
* @param files the file list
*/
protected
void
javac
(
String
[]
args
,
FileList
files
)
{
out
.
println
(
"Compiling "
+
files
.
size
()
+
" classes"
);
println
(
"Compiling "
+
files
.
size
()
+
" classes"
);
ArrayList
argList
=
new
ArrayList
(
Arrays
.
asList
(
args
));
argList
.
addAll
(
getPaths
(
filterFiles
(
files
,
true
,
".java"
)));
args
=
new
String
[
argList
.
size
()];
argList
.
toArray
(
args
);
int
result
;
PrintStream
old
=
System
.
err
;
try
{
if
(
quiet
)
{
System
.
setErr
(
filter
(
System
.
err
,
new
String
[]
{
"Note:"
}));
}
Class
clazz
=
Class
.
forName
(
"com.sun.tools.javac.Main"
);
Method
compile
=
clazz
.
getMethod
(
"compile"
,
new
Class
[]
{
String
[].
class
});
Object
instance
=
clazz
.
newInstance
();
...
...
@@ -599,6 +668,8 @@ public class BuildBase {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
=
exec
(
"javac"
,
args
);
}
finally
{
System
.
setErr
(
old
);
}
if
(
result
!=
0
)
{
throw
new
Error
(
"An error occurred"
);
...
...
@@ -612,7 +683,7 @@ public class BuildBase {
* @param args the command line parameters to pass
*/
protected
void
java
(
String
className
,
String
[]
args
)
{
out
.
println
(
"Running "
+
className
);
println
(
"Running "
+
className
);
if
(
args
==
null
)
{
args
=
new
String
[
0
];
}
...
...
@@ -648,7 +719,7 @@ public class BuildBase {
* @param dir the name of the directory
*/
protected
void
delete
(
String
dir
)
{
out
.
println
(
"Deleting "
+
dir
);
println
(
"Deleting "
+
dir
);
delete
(
new
File
(
dir
));
}
...
...
@@ -686,4 +757,27 @@ public class BuildBase {
index
=
next
+
after
.
length
();
}
}
/**
* Print a line to the output unless the quiet mode is enabled.
*
* @param s the text to write
*/
protected
void
println
(
String
s
)
{
if
(!
quiet
)
{
out
.
println
(
s
);
}
}
/**
* Print a message to the output unless the quiet mode is enabled.
*
* @param s the message to write
*/
protected
void
print
(
String
s
)
{
if
(!
quiet
)
{
out
.
print
(
s
);
}
}
}
h2/src/tools/org/h2/build/code/SwitchSource.java
浏览文件 @
c23dcee7
...
...
@@ -157,7 +157,7 @@ public class SwitchSource {
File
fileCopy
=
new
File
(
name
);
fileNew
.
renameTo
(
fileCopy
);
fileBack
.
delete
();
System
.
out
.
println
(
name
);
//
System.out.println(name);
}
}
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
c23dcee7
...
...
@@ -551,4 +551,4 @@ geocoder geocoding longitude estimating microarray latitude magnolia pfgrc
refill analyzers patches popular came growing indication arabic graphic toc
numbering goto outline makensis macro hyperlink dispatch setlocal wend
widows msgbox designer styles families uno soffice orphans stan ucb rem
pdfurl upate pagebreak
pdfurl upate pagebreak
ren echo
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论