Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9b9efb99
提交
9b9efb99
authored
9月 28, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs
上级
6a0beab2
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
126 行增加
和
86 行删除
+126
-86
Update.java
h2/src/main/org/h2/command/dml/Update.java
+1
-1
tree.js
h2/src/main/org/h2/server/web/res/tree.js
+1
-1
FileLock.java
h2/src/main/org/h2/store/FileLock.java
+1
-0
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+0
-20
IntArray.java
h2/src/main/org/h2/util/IntArray.java
+5
-1
GenerateHelp.java
h2/src/tools/org/h2/build/doc/GenerateHelp.java
+1
-1
LinkChecker.java
h2/src/tools/org/h2/build/doc/LinkChecker.java
+55
-36
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+2
-1
Doclet.java
h2/src/tools/org/h2/build/doclet/Doclet.java
+60
-25
没有找到文件。
h2/src/main/org/h2/command/dml/Update.java
浏览文件 @
9b9efb99
...
@@ -124,7 +124,7 @@ public class Update extends Prepared {
...
@@ -124,7 +124,7 @@ public class Update extends Prepared {
// don't work if update is multi-row and 'inversed' the condition!
// don't work if update is multi-row and 'inversed' the condition!
// probably need multi-row triggers with 'deleted' and 'inserted'
// probably need multi-row triggers with 'deleted' and 'inserted'
// at the same time. anyway good for sql compatibility
// at the same time. anyway good for sql compatibility
// TODO update in-place (but if the
position
changes,
// TODO update in-place (but if the
key
changes,
// we need to update all indexes) before row triggers
// we need to update all indexes) before row triggers
// the cached row is already updated - we need the old values
// the cached row is already updated - we need the old values
...
...
h2/src/main/org/h2/server/web/res/tree.js
浏览文件 @
9b9efb99
...
@@ -98,7 +98,7 @@ function writeTree() {
...
@@ -98,7 +98,7 @@ function writeTree() {
if
(
node
.
link
==
null
)
{
if
(
node
.
link
==
null
)
{
document
.
write
(
node
.
text
);
document
.
write
(
node
.
text
);
}
else
{
}
else
{
document
.
write
(
"<a
name
='"
+
node
.
text
+
"' href=
\"
"
+
node
.
link
+
"
\"
>"
+
node
.
text
+
"</a>"
);
document
.
write
(
"<a
id
='"
+
node
.
text
+
"' href=
\"
"
+
node
.
link
+
"
\"
>"
+
node
.
text
+
"</a>"
);
}
}
document
.
write
(
"<br />"
);
document
.
write
(
"<br />"
);
}
}
...
...
h2/src/main/org/h2/store/FileLock.java
浏览文件 @
9b9efb99
...
@@ -105,6 +105,7 @@ public class FileLock {
...
@@ -105,6 +105,7 @@ public class FileLock {
* Create a new file locking object.
* Create a new file locking object.
*
*
* @param traceSystem the trace system to use
* @param traceSystem the trace system to use
* @param fileName the file name
* @param sleep the number of milliseconds to sleep
* @param sleep the number of milliseconds to sleep
*/
*/
public
FileLock
(
TraceSystem
traceSystem
,
String
fileName
,
int
sleep
)
{
public
FileLock
(
TraceSystem
traceSystem
,
String
fileName
,
int
sleep
)
{
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
9b9efb99
...
@@ -201,26 +201,6 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -201,26 +201,6 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
this
.
source
=
source
;
this
.
source
=
source
;
}
}
/**
* Constructor a new result set that is later populated with addRow.
*
* @return the new object
*/
public
static
SimpleResultSet
newInstance
()
{
return
new
SimpleResultSet
();
}
/**
* Constructor a new result set if the rows should be retrieved using
* the specified row source object.
*
* @param source the row source
* @return the new object
*/
public
static
SimpleResultSet
newInstance
(
SimpleRowSource
source
)
{
return
new
SimpleResultSet
(
source
);
}
/**
/**
* Adds a column to the result set.
* Adds a column to the result set.
*
*
...
...
h2/src/main/org/h2/util/IntArray.java
浏览文件 @
9b9efb99
...
@@ -22,11 +22,13 @@ public class IntArray {
...
@@ -22,11 +22,13 @@ public class IntArray {
* Create an int array with the default initial capacity.
* Create an int array with the default initial capacity.
*/
*/
public
IntArray
()
{
public
IntArray
()
{
data
=
new
int
[
10
]
;
this
(
10
)
;
}
}
/**
/**
* Create an int array with specified initial capacity.
* Create an int array with specified initial capacity.
*
* @param capacity the initial capacity
*/
*/
public
IntArray
(
int
capacity
)
{
public
IntArray
(
int
capacity
)
{
data
=
new
int
[
capacity
];
data
=
new
int
[
capacity
];
...
@@ -34,6 +36,8 @@ public class IntArray {
...
@@ -34,6 +36,8 @@ public class IntArray {
/**
/**
* Create an int array with the given values and size.
* Create an int array with the given values and size.
*
* @param data the int array
*/
*/
public
IntArray
(
int
[]
data
)
{
public
IntArray
(
int
[]
data
)
{
this
.
data
=
data
;
this
.
data
=
data
;
...
...
h2/src/tools/org/h2/build/doc/GenerateHelp.java
浏览文件 @
9b9efb99
...
@@ -33,7 +33,7 @@ public class GenerateHelp {
...
@@ -33,7 +33,7 @@ public class GenerateHelp {
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"
;
ResultSet
rs
=
Csv
.
getInstance
().
read
(
in
,
null
,
null
);
ResultSet
rs
=
Csv
.
getInstance
().
read
(
in
,
null
,
null
);
SimpleResultSet
rs2
=
SimpleResultSet
.
newInstance
();
SimpleResultSet
rs2
=
new
SimpleResultSet
();
ResultSetMetaData
meta
=
rs
.
getMetaData
();
ResultSetMetaData
meta
=
rs
.
getMetaData
();
int
columnCount
=
meta
.
getColumnCount
()
-
1
;
int
columnCount
=
meta
.
getColumnCount
()
-
1
;
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
...
...
h2/src/tools/org/h2/build/doc/LinkChecker.java
浏览文件 @
9b9efb99
...
@@ -77,7 +77,7 @@ public class LinkChecker {
...
@@ -77,7 +77,7 @@ public class LinkChecker {
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
)
{
errors
.
add
(
links
.
get
(
link
)
+
":
l
ink missing "
+
link
);
errors
.
add
(
links
.
get
(
link
)
+
":
L
ink missing "
+
link
);
}
}
}
}
}
}
...
@@ -87,7 +87,7 @@ public class LinkChecker {
...
@@ -87,7 +87,7 @@ public class LinkChecker {
}
}
}
}
for
(
String
name
:
targets
.
keySet
())
{
for
(
String
name
:
targets
.
keySet
())
{
if
(
targets
.
get
(
name
).
equals
(
"
name
"
))
{
if
(
targets
.
get
(
name
).
equals
(
"
id
"
))
{
boolean
ignore
=
false
;
boolean
ignore
=
false
;
for
(
String
to
:
IGNORE_MISSING_LINKS_TO
)
{
for
(
String
to
:
IGNORE_MISSING_LINKS_TO
)
{
if
(
name
.
indexOf
(
to
)
>=
0
)
{
if
(
name
.
indexOf
(
to
)
>=
0
)
{
...
@@ -138,13 +138,56 @@ public class LinkChecker {
...
@@ -138,13 +138,56 @@ public class LinkChecker {
if
(
idx
<
0
)
{
if
(
idx
<
0
)
{
break
;
break
;
}
}
int
start
=
idx
+
4
;
int
start
=
idx
+
" id=\""
.
length
();
int
end
=
html
.
indexOf
(
"\""
,
start
);
if
(
end
<
0
)
{
error
(
fileName
,
"Expected \" after id= "
+
html
.
substring
(
idx
,
idx
+
100
));
}
String
ref
=
html
.
substring
(
start
,
end
);
if
(!
ref
.
startsWith
(
"_"
))
{
targets
.
put
(
path
+
"#"
+
ref
,
"id"
);
}
}
idx
=
-
1
;
while
(
true
)
{
idx
=
html
.
indexOf
(
" href=\""
,
idx
+
1
);
if
(
idx
<
0
)
{
break
;
}
int
start
=
html
.
indexOf
(
"\""
,
idx
);
if
(
start
<
0
)
{
error
(
fileName
,
"Expected \" after href= at "
+
html
.
substring
(
idx
,
idx
+
100
));
}
int
end
=
html
.
indexOf
(
"\""
,
start
+
1
);
int
end
=
html
.
indexOf
(
"\""
,
start
+
1
);
if
(
end
<
0
)
{
if
(
end
<
0
)
{
error
(
fileName
,
"
expected \" after id=
"
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"
Expected \" after href= at
"
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
String
ref
=
html
.
substring
(
start
+
1
,
end
);
String
ref
=
html
.
substring
(
start
+
1
,
end
);
targets
.
put
(
path
+
"#"
+
ref
,
"id"
);
if
(
ref
.
startsWith
(
"http:"
)
||
ref
.
startsWith
(
"https:"
))
{
// ok
}
else
if
(
ref
.
startsWith
(
"javascript:"
))
{
ref
=
null
;
// ok
}
else
if
(
ref
.
length
()
==
0
)
{
ref
=
null
;
// ok
}
else
if
(
ref
.
startsWith
(
"#"
))
{
ref
=
path
+
ref
;
}
else
{
String
p
=
parent
;
while
(
ref
.
startsWith
(
"."
))
{
if
(
ref
.
startsWith
(
"./"
))
{
ref
=
ref
.
substring
(
2
);
}
else
if
(
ref
.
startsWith
(
"../"
))
{
ref
=
ref
.
substring
(
3
);
p
=
p
.
substring
(
0
,
p
.
lastIndexOf
(
'/'
));
}
}
ref
=
p
+
"/"
+
ref
;
}
if
(
ref
!=
null
)
{
links
.
put
(
ref
,
path
);
}
}
}
idx
=
-
1
;
idx
=
-
1
;
while
(
true
)
{
while
(
true
)
{
...
@@ -154,48 +197,24 @@ public class LinkChecker {
...
@@ -154,48 +197,24 @@ public class LinkChecker {
}
}
int
equals
=
html
.
indexOf
(
"="
,
idx
);
int
equals
=
html
.
indexOf
(
"="
,
idx
);
if
(
equals
<
0
)
{
if
(
equals
<
0
)
{
error
(
fileName
,
"
e
xpected = after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"
E
xpected = after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
String
type
=
html
.
substring
(
idx
+
2
,
equals
).
trim
();
String
type
=
html
.
substring
(
idx
+
2
,
equals
).
trim
();
int
start
=
html
.
indexOf
(
"\""
,
idx
);
int
start
=
html
.
indexOf
(
"\""
,
idx
);
if
(
start
<
0
)
{
if
(
start
<
0
)
{
error
(
fileName
,
"
e
xpected \" after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"
E
xpected \" after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
int
end
=
html
.
indexOf
(
"\""
,
start
+
1
);
int
end
=
html
.
indexOf
(
"\""
,
start
+
1
);
if
(
end
<
0
)
{
if
(
end
<
0
)
{
error
(
fileName
,
"
e
xpected \" after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"
E
xpected \" after <a at "
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
String
ref
=
html
.
substring
(
start
+
1
,
end
);
String
ref
=
html
.
substring
(
start
+
1
,
end
);
if
(
type
.
equals
(
"href"
))
{
if
(
type
.
equals
(
"href"
))
{
if
(
ref
.
startsWith
(
"http:"
)
||
ref
.
startsWith
(
"https:"
))
{
// already checked
// ok
}
else
if
(
type
.
equals
(
"id"
))
{
}
else
if
(
ref
.
startsWith
(
"javascript:"
))
{
targets
.
put
(
path
+
"#"
+
ref
,
"id"
);
ref
=
null
;
// ok
}
else
if
(
ref
.
length
()
==
0
)
{
ref
=
null
;
// ok
}
else
if
(
ref
.
startsWith
(
"#"
))
{
ref
=
path
+
ref
;
}
else
{
String
p
=
parent
;
while
(
ref
.
startsWith
(
"."
))
{
if
(
ref
.
startsWith
(
"./"
))
{
ref
=
ref
.
substring
(
2
);
}
else
if
(
ref
.
startsWith
(
"../"
))
{
ref
=
ref
.
substring
(
3
);
p
=
p
.
substring
(
0
,
p
.
lastIndexOf
(
'/'
));
}
}
ref
=
p
+
"/"
+
ref
;
}
if
(
ref
!=
null
)
{
links
.
put
(
ref
,
path
);
}
}
else
if
(
type
.
equals
(
"name"
))
{
targets
.
put
(
path
+
"#"
+
ref
,
"name"
);
}
else
{
}
else
{
error
(
fileName
,
"
u
nsupported <a ?: "
+
html
.
substring
(
idx
,
idx
+
100
));
error
(
fileName
,
"
U
nsupported <a ?: "
+
html
.
substring
(
idx
,
idx
+
100
));
}
}
}
}
}
}
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
9b9efb99
...
@@ -612,4 +612,5 @@ locals multianewarray icmpne fneg faload ifeq decompiler zeroes forgot
...
@@ -612,4 +612,5 @@ locals multianewarray icmpne fneg faload ifeq decompiler zeroes forgot
modern slight boost characteristics significantly gae vfs centrally ten
modern slight boost characteristics significantly gae vfs centrally ten
approach risky getters suxxess gmb delegate delegating delegates collisions
approach risky getters suxxess gmb delegate delegating delegates collisions
linkage superfluous disallow scoop moebius inputs copilot dmoebius leod jenkov
linkage superfluous disallow scoop moebius inputs copilot dmoebius leod jenkov
jakob poker docware peter unstable measurable scramble reissued recreation
jakob poker docware peter unstable measurable scramble reissued recreation
\ No newline at end of file
scrambling distinguish official
\ No newline at end of file
h2/src/tools/org/h2/build/doclet/Doclet.java
浏览文件 @
9b9efb99
...
@@ -18,6 +18,8 @@ import java.util.HashSet;
...
@@ -18,6 +18,8 @@ import java.util.HashSet;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
com.sun.javadoc.ClassDoc
;
import
com.sun.javadoc.ClassDoc
;
import
com.sun.javadoc.ConstructorDoc
;
import
com.sun.javadoc.ExecutableMemberDoc
;
import
com.sun.javadoc.FieldDoc
;
import
com.sun.javadoc.FieldDoc
;
import
com.sun.javadoc.LanguageVersion
;
import
com.sun.javadoc.LanguageVersion
;
import
com.sun.javadoc.MethodDoc
;
import
com.sun.javadoc.MethodDoc
;
...
@@ -98,9 +100,13 @@ public class Doclet {
...
@@ -98,9 +100,13 @@ public class Doclet {
writer
.
println
(
formatText
(
clazz
.
commentText
())
+
"<br /><br />"
);
writer
.
println
(
formatText
(
clazz
.
commentText
())
+
"<br /><br />"
);
// methods
// methods
ConstructorDoc
[]
constructors
=
clazz
.
constructors
();
MethodDoc
[]
methods
=
clazz
.
methods
();
MethodDoc
[]
methods
=
clazz
.
methods
();
Arrays
.
sort
(
methods
,
new
Comparator
<
MethodDoc
>()
{
ExecutableMemberDoc
[]
constructorsMethods
=
new
ExecutableMemberDoc
[
constructors
.
length
+
methods
.
length
];
public
int
compare
(
MethodDoc
a
,
MethodDoc
b
)
{
System
.
arraycopy
(
constructors
,
0
,
constructorsMethods
,
0
,
constructors
.
length
);
System
.
arraycopy
(
methods
,
0
,
constructorsMethods
,
constructors
.
length
,
methods
.
length
);
Arrays
.
sort
(
constructorsMethods
,
new
Comparator
<
ExecutableMemberDoc
>()
{
public
int
compare
(
ExecutableMemberDoc
a
,
ExecutableMemberDoc
b
)
{
// sort static method before non-static methods
// sort static method before non-static methods
if
(
a
.
isStatic
()
!=
b
.
isStatic
())
{
if
(
a
.
isStatic
()
!=
b
.
isStatic
())
{
return
a
.
isStatic
()
?
-
1
:
1
;
return
a
.
isStatic
()
?
-
1
:
1
;
...
@@ -108,11 +114,22 @@ public class Doclet {
...
@@ -108,11 +114,22 @@ public class Doclet {
return
a
.
name
().
compareTo
(
b
.
name
());
return
a
.
name
().
compareTo
(
b
.
name
());
}
}
});
});
//
//
// Arrays.sort(methods, new Comparator<MethodDoc>() {
// public int compare(MethodDoc a, MethodDoc b) {
// // sort static method before non-static methods
// if (a.isStatic() != b.isStatic()) {
// return a.isStatic() ? -1 : 1;
// }
// return a.name().compareTo(b.name());
// }
// });
ArrayList
<
String
>
signatures
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
signatures
=
new
ArrayList
<
String
>();
boolean
hasMethods
=
false
;
boolean
hasMethods
=
false
;
int
id
=
0
;
int
id
=
0
;
for
(
int
i
=
0
;
i
<
m
ethods
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
constructorsM
ethods
.
length
;
i
++)
{
MethodDoc
method
=
m
ethods
[
i
];
ExecutableMemberDoc
method
=
constructorsM
ethods
[
i
];
String
name
=
method
.
name
();
String
name
=
method
.
name
();
if
(
skipMethod
(
method
))
{
if
(
skipMethod
(
method
))
{
continue
;
continue
;
...
@@ -121,28 +138,26 @@ public class Doclet {
...
@@ -121,28 +138,26 @@ public class Doclet {
writer
.
println
(
"<table class=\"block\"><tr onclick=\"return allDetails()\"><th colspan=\"2\">Methods</th></tr>"
);
writer
.
println
(
"<table class=\"block\"><tr onclick=\"return allDetails()\"><th colspan=\"2\">Methods</th></tr>"
);
hasMethods
=
true
;
hasMethods
=
true
;
}
}
String
type
=
getTypeName
(
method
.
isStatic
(),
false
,
method
.
returnType
(
));
String
type
=
getTypeName
(
method
.
isStatic
(),
false
,
getReturnType
(
method
));
writer
.
println
(
"<tr id=\"
tm"
+
id
+
"\" onclick=\"return on('m"
+
id
+
"'
)\"><td class=\"return\">"
+
type
+
"</td><td class=\"method\">"
);
writer
.
println
(
"<tr id=\"
__"
+
id
+
"\" onclick=\"return on("
+
id
+
"
)\"><td class=\"return\">"
+
type
+
"</td><td class=\"method\">"
);
Parameter
[]
params
=
method
.
parameters
();
Parameter
[]
params
=
method
.
parameters
();
StringBuilder
buff
=
new
StringBuilder
();
StringBuilder
buff
=
new
StringBuilder
();
StringBuilder
buffSignature
=
new
StringBuilder
(
name
);
StringBuilder
buffSignature
=
new
StringBuilder
(
name
);
buffSignature
.
append
(
'('
);
buff
.
append
(
'('
);
buff
.
append
(
'('
);
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
if
(
j
>
0
)
{
if
(
j
>
0
)
{
buff
.
append
(
", "
);
buff
.
append
(
", "
);
buffSignature
.
append
(
','
);
}
}
buffSignature
.
append
(
'_'
);
Parameter
param
=
params
[
j
];
Parameter
param
=
params
[
j
];
boolean
isVarArgs
=
method
.
isVarArgs
()
&&
j
==
params
.
length
-
1
;
boolean
isVarArgs
=
method
.
isVarArgs
()
&&
j
==
params
.
length
-
1
;
String
typeName
=
getTypeName
(
false
,
isVarArgs
,
param
.
type
());
String
typeName
=
getTypeName
(
false
,
isVarArgs
,
param
.
type
());
buff
.
append
(
typeName
);
buff
.
append
(
typeName
);
buffSignature
.
append
(
typeName
);
buffSignature
.
append
(
StringUtils
.
replaceAll
(
typeName
,
"[]"
,
"-"
)
);
buff
.
append
(
' '
);
buff
.
append
(
' '
);
buff
.
append
(
param
.
name
());
buff
.
append
(
param
.
name
());
}
}
buff
.
append
(
')'
);
buff
.
append
(
')'
);
buffSignature
.
append
(
')'
);
if
(
isDeprecated
(
method
))
{
if
(
isDeprecated
(
method
))
{
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
}
}
...
@@ -151,15 +166,14 @@ public class Doclet {
...
@@ -151,15 +166,14 @@ public class Doclet {
signatures
.
add
(
null
);
signatures
.
add
(
null
);
}
}
signatures
.
add
(
i
,
signature
);
signatures
.
add
(
i
,
signature
);
writer
.
println
(
"<a href=\"#"
+
signature
+
"\">"
+
name
+
"</a>"
+
buff
.
toString
());
writer
.
println
(
"<a
id=\""
+
signature
+
"\"
href=\"#"
+
signature
+
"\">"
+
name
+
"</a>"
+
buff
.
toString
());
String
firstSentence
=
getFirstSentence
(
method
.
firstSentenceTags
());
String
firstSentence
=
getFirstSentence
(
method
.
firstSentenceTags
());
if
(
firstSentence
!=
null
)
{
if
(
firstSentence
!=
null
)
{
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
firstSentence
)
+
"</div>"
);
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
firstSentence
)
+
"</div>"
);
}
}
writer
.
println
(
"</td></tr>"
);
writer
.
println
(
"</td></tr>"
);
writer
.
println
(
"<tr onclick=\"return off(
'm"
+
id
+
"')\" class=\"detail\" id=\"m
"
+
id
+
"\">"
);
writer
.
println
(
"<tr onclick=\"return off(
"
+
id
+
")\" class=\"detail\" id=\"_
"
+
id
+
"\">"
);
writer
.
println
(
"<td class=\"return\">"
+
type
+
"</td><td>"
);
writer
.
println
(
"<td class=\"return\">"
+
type
+
"</td><td>"
);
writer
.
println
(
"<a name=\""
+
signature
+
"\"></a>"
);
writeMethodDetails
(
writer
,
clazz
,
method
,
signature
);
writeMethodDetails
(
writer
,
clazz
,
method
,
signature
);
writer
.
println
(
"</td></tr>"
);
writer
.
println
(
"</td></tr>"
);
id
++;
id
++;
...
@@ -244,8 +258,7 @@ public class Doclet {
...
@@ -244,8 +258,7 @@ public class Doclet {
String
name
=
field
.
name
();
String
name
=
field
.
name
();
String
constant
=
field
.
constantValueExpression
();
String
constant
=
field
.
constantValueExpression
();
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
writer
.
println
(
"<a name=\""
+
link
+
"\"></a>"
);
writer
.
println
(
"<h4 id=\""
+
link
+
"\"><span class=\"methodName\">"
+
name
);
writer
.
println
(
"<h4><span class=\"methodName\">"
+
name
);
if
(
constant
==
null
)
{
if
(
constant
==
null
)
{
writer
.
println
();
writer
.
println
();
}
else
{
}
else
{
...
@@ -256,7 +269,7 @@ public class Doclet {
...
@@ -256,7 +269,7 @@ public class Doclet {
writer
.
println
(
"<hr />"
);
writer
.
println
(
"<hr />"
);
}
}
private
void
writeMethodDetails
(
PrintWriter
writer
,
ClassDoc
clazz
,
Method
Doc
method
,
String
signature
)
{
private
void
writeMethodDetails
(
PrintWriter
writer
,
ClassDoc
clazz
,
ExecutableMember
Doc
method
,
String
signature
)
{
String
name
=
method
.
name
();
String
name
=
method
.
name
();
if
(
skipMethod
(
method
))
{
if
(
skipMethod
(
method
))
{
return
;
return
;
...
@@ -285,7 +298,7 @@ public class Doclet {
...
@@ -285,7 +298,7 @@ public class Doclet {
if
(
isDeprecated
(
method
))
{
if
(
isDeprecated
(
method
))
{
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
name
=
"<span class=\"deprecated\">"
+
name
+
"</span>"
;
}
}
writer
.
println
(
"<a href=\"#"
+
signature
+
"\">"
+
name
+
"</a>"
+
buff
.
toString
());
writer
.
println
(
"<a
id=\""
+
signature
+
"\"
href=\"#"
+
signature
+
"\">"
+
name
+
"</a>"
+
buff
.
toString
());
boolean
hasComment
=
method
.
commentText
()
!=
null
&&
method
.
commentText
().
trim
().
length
()
!=
0
;
boolean
hasComment
=
method
.
commentText
()
!=
null
&&
method
.
commentText
().
trim
().
length
()
!=
0
;
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
method
.
commentText
())
+
"</div>"
);
writer
.
println
(
"<div class=\"methodText\">"
+
formatText
(
method
.
commentText
())
+
"</div>"
);
ParamTag
[]
paramTags
=
method
.
paramTags
();
ParamTag
[]
paramTags
=
method
.
paramTags
();
...
@@ -313,6 +326,7 @@ public class Doclet {
...
@@ -313,6 +326,7 @@ public class Doclet {
writer
.
println
(
"<div class=\"item\">"
+
p
+
"</div>"
);
writer
.
println
(
"<div class=\"item\">"
+
p
+
"</div>"
);
}
}
Tag
[]
returnTags
=
method
.
tags
(
"return"
);
Tag
[]
returnTags
=
method
.
tags
(
"return"
);
Type
returnType
=
getReturnType
(
method
);
if
(
returnTags
!=
null
&&
returnTags
.
length
>
0
)
{
if
(
returnTags
!=
null
&&
returnTags
.
length
>
0
)
{
writer
.
println
(
"<div class=\"itemTitle\">Returns:</div>"
);
writer
.
println
(
"<div class=\"itemTitle\">Returns:</div>"
);
String
returnComment
=
returnTags
[
0
].
text
();
String
returnComment
=
returnTags
[
0
].
text
();
...
@@ -321,12 +335,12 @@ public class Doclet {
...
@@ -321,12 +335,12 @@ public class Doclet {
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
name
);
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
name
);
}
}
writer
.
println
(
"<div class=\"item\">"
+
returnComment
+
"</div>"
);
writer
.
println
(
"<div class=\"item\">"
+
returnComment
+
"</div>"
);
}
else
if
(
!
method
.
returnType
()
.
toString
().
equals
(
"void"
))
{
}
else
if
(
returnType
!=
null
&&
!
returnType
.
toString
().
equals
(
"void"
))
{
if
(
hasComment
&&
!
method
.
commentText
().
startsWith
(
"["
)
&&
!
hasThrowsTag
)
{
if
(
hasComment
&&
!
method
.
commentText
().
startsWith
(
"["
)
&&
!
hasThrowsTag
)
{
// [Not supported] and such are not problematic
// [Not supported] and such are not problematic
// also not problematic are methods that always throw an exception
// also not problematic are methods that always throw an exception
addError
(
"Undocumented return value ("
+
addError
(
"Undocumented return value ("
+
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
name
+
" "
+
method
.
returnType
(
));
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
name
+
" "
+
getReturnType
(
method
));
}
}
}
}
if
(
hasThrowsTag
)
{
if
(
hasThrowsTag
)
{
...
@@ -354,7 +368,9 @@ public class Doclet {
...
@@ -354,7 +368,9 @@ public class Doclet {
errorCount
++;
errorCount
++;
}
}
}
}
if
(
Character
.
isDigit
(
link
.
charAt
(
0
)))
{
if
(
link
.
startsWith
(
"\""
))
{
link
=
name
;
}
else
if
(
Character
.
isDigit
(
link
.
charAt
(
0
)))
{
link
=
"c"
+
link
;
link
=
"c"
+
link
;
}
}
return
link
;
return
link
;
...
@@ -375,9 +391,10 @@ public class Doclet {
...
@@ -375,9 +391,10 @@ public class Doclet {
return
false
;
return
false
;
}
}
private
boolean
skipMethod
(
Method
Doc
method
)
{
private
boolean
skipMethod
(
ExecutableMember
Doc
method
)
{
ClassDoc
clazz
=
method
.
containingClass
();
ClassDoc
clazz
=
method
.
containingClass
();
boolean
isInterface
=
clazz
.
isInterface
()
||
(
clazz
.
isAbstract
()
&&
method
.
isAbstract
());
boolean
isAbstract
=
method
instanceof
MethodDoc
&&
((
MethodDoc
)
method
).
isAbstract
();
boolean
isInterface
=
clazz
.
isInterface
()
||
(
clazz
.
isAbstract
()
&&
isAbstract
);
if
(
INTERFACES_ONLY
&&
!
isInterface
)
{
if
(
INTERFACES_ONLY
&&
!
isInterface
)
{
return
true
;
return
true
;
}
}
...
@@ -385,6 +402,9 @@ public class Doclet {
...
@@ -385,6 +402,9 @@ public class Doclet {
if
(
method
.
isPrivate
()
||
name
.
equals
(
"finalize"
))
{
if
(
method
.
isPrivate
()
||
name
.
equals
(
"finalize"
))
{
return
true
;
return
true
;
}
}
if
(
method
.
isConstructor
()
&&
method
.
getRawCommentText
().
trim
().
length
()
==
0
)
{
return
true
;
}
if
(
method
.
getRawCommentText
().
trim
().
startsWith
(
"@deprecated INTERNAL"
))
{
if
(
method
.
getRawCommentText
().
trim
().
startsWith
(
"@deprecated INTERNAL"
))
{
return
true
;
return
true
;
}
}
...
@@ -397,7 +417,8 @@ public class Doclet {
...
@@ -397,7 +417,8 @@ public class Doclet {
if
(!
doesOverride
(
method
))
{
if
(!
doesOverride
(
method
))
{
boolean
setterOrGetter
=
name
.
startsWith
(
"set"
)
&&
method
.
parameters
().
length
==
1
;
boolean
setterOrGetter
=
name
.
startsWith
(
"set"
)
&&
method
.
parameters
().
length
==
1
;
setterOrGetter
|=
name
.
startsWith
(
"get"
)
&&
method
.
parameters
().
length
==
0
;
setterOrGetter
|=
name
.
startsWith
(
"get"
)
&&
method
.
parameters
().
length
==
0
;
setterOrGetter
|=
name
.
startsWith
(
"is"
)
&&
method
.
parameters
().
length
==
0
&&
method
.
returnType
().
toString
().
equals
(
"boolean"
);
Type
returnType
=
getReturnType
(
method
);
setterOrGetter
|=
name
.
startsWith
(
"is"
)
&&
method
.
parameters
().
length
==
0
&&
returnType
!=
null
&&
returnType
.
toString
().
equals
(
"boolean"
);
if
(!
setterOrGetter
)
{
if
(!
setterOrGetter
)
{
addError
(
"Undocumented method "
+
" ("
+
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
clazz
+
"."
+
name
+
" "
+
raw
);
addError
(
"Undocumented method "
+
" ("
+
clazz
.
name
()
+
".java:"
+
method
.
position
().
line
()
+
") "
+
clazz
+
"."
+
name
+
" "
+
raw
);
return
true
;
return
true
;
...
@@ -407,6 +428,14 @@ public class Doclet {
...
@@ -407,6 +428,14 @@ public class Doclet {
return
false
;
return
false
;
}
}
private
Type
getReturnType
(
ExecutableMemberDoc
method
)
{
if
(
method
instanceof
MethodDoc
)
{
MethodDoc
m
=
(
MethodDoc
)
method
;
return
m
.
returnType
();
}
return
null
;
}
private
void
addError
(
String
s
)
{
private
void
addError
(
String
s
)
{
if
(
errors
.
add
(
s
))
{
if
(
errors
.
add
(
s
))
{
System
.
out
.
println
(
s
);
System
.
out
.
println
(
s
);
...
@@ -414,7 +443,10 @@ public class Doclet {
...
@@ -414,7 +443,10 @@ public class Doclet {
}
}
}
}
private
boolean
doesOverride
(
MethodDoc
method
)
{
private
boolean
doesOverride
(
ExecutableMemberDoc
method
)
{
if
(
method
.
isConstructor
())
{
return
true
;
}
ClassDoc
clazz
=
method
.
containingClass
();
ClassDoc
clazz
=
method
.
containingClass
();
int
parameterCount
=
method
.
parameters
().
length
;
int
parameterCount
=
method
.
parameters
().
length
;
return
foundMethod
(
clazz
,
false
,
method
.
name
(),
parameterCount
);
return
foundMethod
(
clazz
,
false
,
method
.
name
(),
parameterCount
);
...
@@ -447,6 +479,9 @@ public class Doclet {
...
@@ -447,6 +479,9 @@ public class Doclet {
}
}
private
static
String
getTypeName
(
boolean
isStatic
,
boolean
isVarArgs
,
Type
type
)
{
private
static
String
getTypeName
(
boolean
isStatic
,
boolean
isVarArgs
,
Type
type
)
{
if
(
type
==
null
)
{
return
""
;
}
String
s
=
type
.
typeName
()
+
type
.
dimension
();
String
s
=
type
.
typeName
()
+
type
.
dimension
();
if
(
isVarArgs
)
{
if
(
isVarArgs
)
{
// remove the last "[]" and add "..." instead
// remove the last "[]" and add "..." instead
...
@@ -458,7 +493,7 @@ public class Doclet {
...
@@ -458,7 +493,7 @@ public class Doclet {
return
s
;
return
s
;
}
}
private
static
boolean
isDeprecated
(
Method
Doc
method
)
{
private
static
boolean
isDeprecated
(
ExecutableMember
Doc
method
)
{
for
(
Tag
t
:
method
.
tags
())
{
for
(
Tag
t
:
method
.
tags
())
{
if
(
t
.
kind
().
equals
(
"@deprecated"
))
{
if
(
t
.
kind
().
equals
(
"@deprecated"
))
{
return
true
;
return
true
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论