Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
6737ea09
提交
6737ea09
authored
8月 12, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix issues found by CodePro Analytix
上级
ea2af107
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
29 行增加
和
38 行删除
+29
-38
RuleFixed.java
h2/src/main/org/h2/bnf/RuleFixed.java
+6
-6
Delete.java
h2/src/main/org/h2/command/dml/Delete.java
+1
-1
Insert.java
h2/src/main/org/h2/command/dml/Insert.java
+1
-1
Select.java
h2/src/main/org/h2/command/dml/Select.java
+1
-1
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+1
-1
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+1
-1
TriggerObject.java
h2/src/main/org/h2/schema/TriggerObject.java
+1
-3
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+1
-2
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+1
-2
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+2
-2
FileLock.java
h2/src/main/org/h2/store/FileLock.java
+2
-4
WriterThread.java
h2/src/main/org/h2/store/WriterThread.java
+1
-2
TableBase.java
h2/src/main/org/h2/table/TableBase.java
+1
-1
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+4
-4
ConvertTraceFile.java
h2/src/main/org/h2/tools/ConvertTraceFile.java
+1
-1
Shell.java
h2/src/main/org/h2/tools/Shell.java
+1
-1
MathUtils.java
h2/src/main/org/h2/util/MathUtils.java
+1
-1
Profiler.java
h2/src/main/org/h2/util/Profiler.java
+1
-2
Task.java
h2/src/main/org/h2/util/Task.java
+1
-2
没有找到文件。
h2/src/main/org/h2/bnf/RuleFixed.java
浏览文件 @
6737ea09
...
@@ -161,17 +161,17 @@ public class RuleFixed implements Rule {
...
@@ -161,17 +161,17 @@ public class RuleFixed implements Rule {
}
}
break
;
break
;
case
OPEN_BRACKET:
case
OPEN_BRACKET:
if
(
s
.
startsWith
(
"["
))
{
if
(
s
.
length
()
==
0
)
{
s
=
s
.
substring
(
1
);
}
else
if
(
s
.
length
()
==
0
)
{
sentence
.
add
(
"["
,
"["
,
Sentence
.
KEYWORD
);
sentence
.
add
(
"["
,
"["
,
Sentence
.
KEYWORD
);
}
else
if
(
s
.
charAt
(
0
)
==
'['
)
{
s
=
s
.
substring
(
1
);
}
}
break
;
break
;
case
CLOSE_BRACKET:
case
CLOSE_BRACKET:
if
(
s
.
startsWith
(
"]"
))
{
if
(
s
.
length
()
==
0
)
{
s
=
s
.
substring
(
1
);
}
else
if
(
s
.
length
()
==
0
)
{
sentence
.
add
(
"]"
,
"]"
,
Sentence
.
KEYWORD
);
sentence
.
add
(
"]"
,
"]"
,
Sentence
.
KEYWORD
);
}
else
if
(
s
.
charAt
(
0
)
==
']'
)
{
s
=
s
.
substring
(
1
);
}
}
break
;
break
;
// no autocomplete support for comments
// no autocomplete support for comments
...
...
h2/src/main/org/h2/command/dml/Delete.java
浏览文件 @
6737ea09
...
@@ -114,7 +114,7 @@ public class Delete extends Prepared {
...
@@ -114,7 +114,7 @@ public class Delete extends Prepared {
buff
.
append
(
"\nWHERE "
).
append
(
StringUtils
.
unEnclose
(
condition
.
getSQL
()));
buff
.
append
(
"\nWHERE "
).
append
(
StringUtils
.
unEnclose
(
condition
.
getSQL
()));
}
}
if
(
limitExpr
!=
null
)
{
if
(
limitExpr
!=
null
)
{
buff
.
append
(
"\nLIMIT ("
).
append
(
StringUtils
.
unEnclose
(
limitExpr
.
getSQL
())).
append
(
")"
);
buff
.
append
(
"\nLIMIT ("
).
append
(
StringUtils
.
unEnclose
(
limitExpr
.
getSQL
())).
append
(
')'
);
}
}
return
buff
.
toString
();
return
buff
.
toString
();
}
}
...
...
h2/src/main/org/h2/command/dml/Insert.java
浏览文件 @
6737ea09
...
@@ -187,7 +187,7 @@ public class Insert extends Prepared implements ResultTarget {
...
@@ -187,7 +187,7 @@ public class Insert extends Prepared implements ResultTarget {
buff
.
append
(
"VALUES "
);
buff
.
append
(
"VALUES "
);
int
row
=
0
;
int
row
=
0
;
if
(
list
.
size
()
>
1
)
{
if
(
list
.
size
()
>
1
)
{
buff
.
append
(
"\n"
);
buff
.
append
(
'\n'
);
}
}
for
(
Expression
[]
expr
:
list
)
{
for
(
Expression
[]
expr
:
list
)
{
if
(
row
++
>
0
)
{
if
(
row
++
>
0
)
{
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
6737ea09
...
@@ -981,7 +981,7 @@ public class Select extends Query {
...
@@ -981,7 +981,7 @@ public class Select extends Query {
}
}
for
(
int
i
=
0
;
i
<
visibleColumnCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
visibleColumnCount
;
i
++)
{
buff
.
appendExceptFirst
(
","
);
buff
.
appendExceptFirst
(
","
);
buff
.
append
(
"\n"
);
buff
.
append
(
'\n'
);
buff
.
append
(
StringUtils
.
indent
(
exprList
[
i
].
getSQL
(),
4
,
false
));
buff
.
append
(
StringUtils
.
indent
(
exprList
[
i
].
getSQL
(),
4
,
false
));
}
}
buff
.
append
(
"\nFROM "
);
buff
.
append
(
"\nFROM "
);
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
6737ea09
...
@@ -739,7 +739,7 @@ public class FullText {
...
@@ -739,7 +739,7 @@ public class FullText {
append
(
StringUtils
.
quoteIdentifier
(
table
)).
append
(
StringUtils
.
quoteIdentifier
(
table
)).
append
(
" FOR EACH ROW CALL \""
).
append
(
" FOR EACH ROW CALL \""
).
append
(
FullText
.
FullTextTrigger
.
class
.
getName
()).
append
(
FullText
.
FullTextTrigger
.
class
.
getName
()).
append
(
"\""
);
append
(
'\"'
);
stat
.
execute
(
buff
.
toString
());
stat
.
execute
(
buff
.
toString
());
}
}
}
}
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
6737ea09
...
@@ -239,7 +239,7 @@ public class FullTextLucene extends FullText {
...
@@ -239,7 +239,7 @@ public class FullTextLucene extends FullText {
append
(
StringUtils
.
quoteIdentifier
(
table
)).
append
(
StringUtils
.
quoteIdentifier
(
table
)).
append
(
" FOR EACH ROW CALL \""
).
append
(
" FOR EACH ROW CALL \""
).
append
(
FullTextLucene
.
FullTextTrigger
.
class
.
getName
()).
append
(
FullTextLucene
.
FullTextTrigger
.
class
.
getName
()).
append
(
"\""
);
append
(
'\"'
);
stat
.
execute
(
buff
.
toString
());
stat
.
execute
(
buff
.
toString
());
}
}
...
...
h2/src/main/org/h2/schema/TriggerObject.java
浏览文件 @
6737ea09
...
@@ -189,9 +189,7 @@ public class TriggerObject extends SchemaObjectBase {
...
@@ -189,9 +189,7 @@ public class TriggerObject extends SchemaObjectBase {
Object
[]
newListBackup
;
Object
[]
newListBackup
;
if
(
before
&&
newList
!=
null
)
{
if
(
before
&&
newList
!=
null
)
{
newListBackup
=
new
Object
[
newList
.
length
];
newListBackup
=
new
Object
[
newList
.
length
];
for
(
int
i
=
0
;
i
<
newList
.
length
;
i
++)
{
System
.
arraycopy
(
newList
,
0
,
newListBackup
,
0
,
newList
.
length
);
newListBackup
[
i
]
=
newList
[
i
];
}
}
else
{
}
else
{
newListBackup
=
null
;
newListBackup
=
null
;
}
}
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
6737ea09
...
@@ -239,9 +239,8 @@ public class TcpServer implements Service {
...
@@ -239,9 +239,8 @@ public class TcpServer implements Service {
Socket
s
=
serverSocket
.
accept
();
Socket
s
=
serverSocket
.
accept
();
TcpServerThread
c
=
new
TcpServerThread
(
s
,
this
,
nextThreadId
++);
TcpServerThread
c
=
new
TcpServerThread
(
s
,
this
,
nextThreadId
++);
running
.
add
(
c
);
running
.
add
(
c
);
Thread
thread
=
new
Thread
(
c
);
Thread
thread
=
new
Thread
(
c
,
threadName
+
" thread"
);
thread
.
setDaemon
(
isDaemon
);
thread
.
setDaemon
(
isDaemon
);
thread
.
setName
(
threadName
+
" thread"
);
c
.
setThread
(
thread
);
c
.
setThread
(
thread
);
thread
.
start
();
thread
.
start
();
}
}
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
6737ea09
...
@@ -187,9 +187,8 @@ public class PgServer implements Service {
...
@@ -187,9 +187,8 @@ public class PgServer implements Service {
PgServerThread
c
=
new
PgServerThread
(
s
,
this
);
PgServerThread
c
=
new
PgServerThread
(
s
,
this
);
running
.
add
(
c
);
running
.
add
(
c
);
c
.
setProcessId
(
running
.
size
());
c
.
setProcessId
(
running
.
size
());
Thread
thread
=
new
Thread
(
c
);
Thread
thread
=
new
Thread
(
c
,
threadName
+
" thread"
);
thread
.
setDaemon
(
isDaemon
);
thread
.
setDaemon
(
isDaemon
);
thread
.
setName
(
threadName
+
" thread"
);
c
.
setThread
(
thread
);
c
.
setThread
(
thread
);
thread
.
start
();
thread
.
start
();
}
}
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
6737ea09
...
@@ -171,7 +171,7 @@ public class WebApp {
...
@@ -171,7 +171,7 @@ public class WebApp {
for
(
String
value
:
elements
)
{
for
(
String
value
:
elements
)
{
buff
.
append
(
"<option value=\""
).
buff
.
append
(
"<option value=\""
).
append
(
PageParser
.
escapeHtmlData
(
value
)).
append
(
PageParser
.
escapeHtmlData
(
value
)).
append
(
"\""
);
append
(
'\"'
);
if
(
value
.
equals
(
selected
))
{
if
(
value
.
equals
(
selected
))
{
buff
.
append
(
" selected"
);
buff
.
append
(
" selected"
);
}
}
...
@@ -187,7 +187,7 @@ public class WebApp {
...
@@ -187,7 +187,7 @@ public class WebApp {
for
(
String
[]
n
:
elements
)
{
for
(
String
[]
n
:
elements
)
{
buff
.
append
(
"<option value=\""
).
buff
.
append
(
"<option value=\""
).
append
(
PageParser
.
escapeHtmlData
(
n
[
0
])).
append
(
PageParser
.
escapeHtmlData
(
n
[
0
])).
append
(
"\""
);
append
(
'\"'
);
if
(
n
[
0
].
equals
(
selected
))
{
if
(
n
[
0
].
equals
(
selected
))
{
buff
.
append
(
" selected"
);
buff
.
append
(
" selected"
);
}
}
...
...
h2/src/main/org/h2/store/FileLock.java
浏览文件 @
6737ea09
...
@@ -348,8 +348,7 @@ public class FileLock implements Runnable {
...
@@ -348,8 +348,7 @@ public class FileLock implements Runnable {
fileName
=
null
;
fileName
=
null
;
throw
getExceptionFatal
(
"Concurrent update"
,
null
);
throw
getExceptionFatal
(
"Concurrent update"
,
null
);
}
}
watchdog
=
new
Thread
(
this
);
watchdog
=
new
Thread
(
this
,
"H2 File Lock Watchdog "
+
fileName
);
watchdog
.
setName
(
"H2 File Lock Watchdog "
+
fileName
);
watchdog
.
setDaemon
(
true
);
watchdog
.
setDaemon
(
true
);
watchdog
.
setPriority
(
Thread
.
MAX_PRIORITY
-
1
);
watchdog
.
setPriority
(
Thread
.
MAX_PRIORITY
-
1
);
watchdog
.
start
();
watchdog
.
start
();
...
@@ -421,9 +420,8 @@ public class FileLock implements Runnable {
...
@@ -421,9 +420,8 @@ public class FileLock implements Runnable {
return
;
return
;
}
}
save
();
save
();
watchdog
=
new
Thread
(
this
);
watchdog
=
new
Thread
(
this
,
"H2 File Lock Watchdog (Socket) "
+
fileName
);
watchdog
.
setDaemon
(
true
);
watchdog
.
setDaemon
(
true
);
watchdog
.
setName
(
"H2 File Lock Watchdog (Socket) "
+
fileName
);
watchdog
.
start
();
watchdog
.
start
();
}
}
...
...
h2/src/main/org/h2/store/WriterThread.java
浏览文件 @
6737ea09
...
@@ -60,8 +60,7 @@ public class WriterThread implements Runnable {
...
@@ -60,8 +60,7 @@ public class WriterThread implements Runnable {
public
static
WriterThread
create
(
Database
database
,
int
writeDelay
)
{
public
static
WriterThread
create
(
Database
database
,
int
writeDelay
)
{
try
{
try
{
WriterThread
writer
=
new
WriterThread
(
database
,
writeDelay
);
WriterThread
writer
=
new
WriterThread
(
database
,
writeDelay
);
writer
.
thread
=
new
Thread
(
writer
);
writer
.
thread
=
new
Thread
(
writer
,
"H2 Log Writer "
+
database
.
getShortName
());
writer
.
thread
.
setName
(
"H2 Log Writer "
+
database
.
getShortName
());
writer
.
thread
.
setDaemon
(
true
);
writer
.
thread
.
setDaemon
(
true
);
return
writer
;
return
writer
;
}
catch
(
AccessControlException
e
)
{
}
catch
(
AccessControlException
e
)
{
...
...
h2/src/main/org/h2/table/TableBase.java
浏览文件 @
6737ea09
...
@@ -70,7 +70,7 @@ public abstract class TableBase extends Table {
...
@@ -70,7 +70,7 @@ public abstract class TableBase extends Table {
if
(
tableEngine
!=
null
)
{
if
(
tableEngine
!=
null
)
{
buff
.
append
(
"\nENGINE \""
);
buff
.
append
(
"\nENGINE \""
);
buff
.
append
(
tableEngine
);
buff
.
append
(
tableEngine
);
buff
.
append
(
"\""
);
buff
.
append
(
'\"'
);
}
}
if
(!
isPersistIndexes
()
&&
!
isPersistData
())
{
if
(!
isPersistIndexes
()
&&
!
isPersistData
())
{
buff
.
append
(
"\nNOT PERSISTENT"
);
buff
.
append
(
"\nNOT PERSISTENT"
);
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
6737ea09
...
@@ -630,12 +630,12 @@ public class TableFilter implements ColumnResolver {
...
@@ -630,12 +630,12 @@ public class TableFilter implements ColumnResolver {
TableFilter
n
=
nestedJoin
;
TableFilter
n
=
nestedJoin
;
do
{
do
{
buffNested
.
append
(
n
.
getPlanSQL
(
n
!=
nestedJoin
));
buffNested
.
append
(
n
.
getPlanSQL
(
n
!=
nestedJoin
));
buffNested
.
append
(
"\n"
);
buffNested
.
append
(
'\n'
);
n
=
n
.
getJoin
();
n
=
n
.
getJoin
();
}
while
(
n
!=
null
);
}
while
(
n
!=
null
);
buff
.
append
(
"(\n"
);
buff
.
append
(
"(\n"
);
buff
.
append
(
StringUtils
.
indent
(
buffNested
.
toString
(),
4
,
false
));
buff
.
append
(
StringUtils
.
indent
(
buffNested
.
toString
(),
4
,
false
));
buff
.
append
(
")"
);
buff
.
append
(
')'
);
if
(
isJoin
)
{
if
(
isJoin
)
{
buff
.
append
(
" ON "
);
buff
.
append
(
" ON "
);
if
(
joinCondition
==
null
)
{
if
(
joinCondition
==
null
)
{
...
@@ -653,7 +653,7 @@ public class TableFilter implements ColumnResolver {
...
@@ -653,7 +653,7 @@ public class TableFilter implements ColumnResolver {
buff
.
append
(
' '
).
append
(
Parser
.
quoteIdentifier
(
alias
));
buff
.
append
(
' '
).
append
(
Parser
.
quoteIdentifier
(
alias
));
}
}
if
(
index
!=
null
)
{
if
(
index
!=
null
)
{
buff
.
append
(
"\n"
);
buff
.
append
(
'\n'
);
StatementBuilder
planBuff
=
new
StatementBuilder
();
StatementBuilder
planBuff
=
new
StatementBuilder
();
planBuff
.
append
(
index
.
getPlanSQL
());
planBuff
.
append
(
index
.
getPlanSQL
());
if
(
indexConditions
.
size
()
>
0
)
{
if
(
indexConditions
.
size
()
>
0
)
{
...
@@ -680,7 +680,7 @@ public class TableFilter implements ColumnResolver {
...
@@ -680,7 +680,7 @@ public class TableFilter implements ColumnResolver {
}
}
}
}
if
(
filterCondition
!=
null
)
{
if
(
filterCondition
!=
null
)
{
buff
.
append
(
"\n"
);
buff
.
append
(
'\n'
);
String
condition
=
StringUtils
.
unEnclose
(
filterCondition
.
getSQL
());
String
condition
=
StringUtils
.
unEnclose
(
filterCondition
.
getSQL
());
condition
=
"/* WHERE "
+
StringUtils
.
quoteRemarkSQL
(
condition
)
+
"\n*/"
;
condition
=
"/* WHERE "
+
StringUtils
.
quoteRemarkSQL
(
condition
)
+
"\n*/"
;
buff
.
append
(
StringUtils
.
indent
(
condition
,
4
,
false
));
buff
.
append
(
StringUtils
.
indent
(
condition
,
4
,
false
));
...
...
h2/src/main/org/h2/tools/ConvertTraceFile.java
浏览文件 @
6737ea09
...
@@ -166,7 +166,7 @@ public class ConvertTraceFile extends Tool {
...
@@ -166,7 +166,7 @@ public class ConvertTraceFile extends Tool {
}
}
}
}
javaWriter
.
println
(
" }"
);
javaWriter
.
println
(
" }"
);
javaWriter
.
println
(
"}"
);
javaWriter
.
println
(
'}'
);
reader
.
close
();
reader
.
close
();
javaWriter
.
close
();
javaWriter
.
close
();
if
(
stats
.
size
()
>
0
)
{
if
(
stats
.
size
()
>
0
)
{
...
...
h2/src/main/org/h2/tools/Shell.java
浏览文件 @
6737ea09
...
@@ -373,7 +373,7 @@ public class Shell extends Tool implements Runnable {
...
@@ -373,7 +373,7 @@ public class Shell extends Tool implements Runnable {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// ignore, use the default solution
// ignore, use the default solution
}
}
Thread
passwordHider
=
new
Thread
(
this
);
Thread
passwordHider
=
new
Thread
(
this
,
"Password hider"
);
stopHide
=
false
;
stopHide
=
false
;
passwordHider
.
start
();
passwordHider
.
start
();
print
(
"Password > "
);
print
(
"Password > "
);
...
...
h2/src/main/org/h2/util/MathUtils.java
浏览文件 @
6737ea09
...
@@ -72,7 +72,7 @@ public class MathUtils {
...
@@ -72,7 +72,7 @@ public class MathUtils {
};
};
try
{
try
{
Thread
t
=
new
Thread
(
runnable
);
Thread
t
=
new
Thread
(
runnable
,
"Generate Seed"
);
// let the process terminate even if generating the seed is really slow
// let the process terminate even if generating the seed is really slow
t
.
setDaemon
(
true
);
t
.
setDaemon
(
true
);
t
.
start
();
t
.
start
();
...
...
h2/src/main/org/h2/util/Profiler.java
浏览文件 @
6737ea09
...
@@ -77,8 +77,7 @@ public class Profiler implements Runnable {
...
@@ -77,8 +77,7 @@ public class Profiler implements Runnable {
* Start collecting profiling data.
* Start collecting profiling data.
*/
*/
public
void
startCollecting
()
{
public
void
startCollecting
()
{
thread
=
new
Thread
(
this
);
thread
=
new
Thread
(
this
,
"Profiler"
);
thread
.
setName
(
"Profiler"
);
thread
.
setDaemon
(
true
);
thread
.
setDaemon
(
true
);
thread
.
start
();
thread
.
start
();
}
}
...
...
h2/src/main/org/h2/util/Task.java
浏览文件 @
6737ea09
...
@@ -47,9 +47,8 @@ public abstract class Task implements Runnable {
...
@@ -47,9 +47,8 @@ public abstract class Task implements Runnable {
* @return this
* @return this
*/
*/
public
Task
execute
()
{
public
Task
execute
()
{
thread
=
new
Thread
(
this
);
thread
=
new
Thread
(
this
,
getClass
().
getName
()
);
thread
.
setDaemon
(
true
);
thread
.
setDaemon
(
true
);
thread
.
setName
(
getClass
().
getName
());
thread
.
start
();
thread
.
start
();
return
this
;
return
this
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论