Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
268c6620
提交
268c6620
authored
1月 06, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable warning for 'Local variable declaration hides another field or variable'.
上级
2b2162f8
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
67 行增加
和
69 行删除
+67
-69
Bnf.java
h2/src/main/org/h2/bnf/Bnf.java
+4
-4
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-2
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+6
-6
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+3
-3
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+2
-2
PageBtreeIndex.java
h2/src/main/org/h2/index/PageBtreeIndex.java
+0
-1
PageData.java
h2/src/main/org/h2/index/PageData.java
+3
-3
PageDataIndex.java
h2/src/main/org/h2/index/PageDataIndex.java
+0
-1
PageDataLeaf.java
h2/src/main/org/h2/index/PageDataLeaf.java
+2
-2
PageDelegateIndex.java
h2/src/main/org/h2/index/PageDelegateIndex.java
+2
-2
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+3
-3
JdbcDataSource.java
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
+12
-12
LogFile.java
h2/src/main/org/h2/log/LogFile.java
+13
-13
Trace.java
h2/src/main/org/h2/message/Trace.java
+4
-4
TraceObject.java
h2/src/main/org/h2/message/TraceObject.java
+7
-7
TraceSystem.java
h2/src/main/org/h2/message/TraceSystem.java
+4
-4
没有找到文件。
h2/src/main/org/h2/bnf/Bnf.java
浏览文件 @
268c6620
...
...
@@ -136,12 +136,12 @@ public class Bnf {
/**
* Get the HTML railroad for a given syntax.
*
* @param
syntax
the syntax
* @param
bnf
the syntax
* @return the HTML formatted railroad
*/
public
String
getRailroadHtml
(
String
syntax
)
{
syntax
=
StringUtils
.
replaceAll
(
syntax
,
"\n "
,
" "
);
String
[]
syntaxList
=
StringUtils
.
arraySplit
(
syntax
,
'\n'
,
true
);
public
String
getRailroadHtml
(
String
bnf
)
{
bnf
=
StringUtils
.
replaceAll
(
bnf
,
"\n "
,
" "
);
String
[]
syntaxList
=
StringUtils
.
arraySplit
(
bnf
,
'\n'
,
true
);
StringBuilder
buff
=
new
StringBuilder
();
for
(
String
s
:
syntaxList
)
{
this
.
syntax
=
s
;
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
268c6620
...
...
@@ -4283,8 +4283,8 @@ public class Parser {
throw
Message
.
getSQLException
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
tableName
);
}
private
Sequence
findSequence
(
String
schema
Name
,
String
sequenceName
)
throws
SQLException
{
Sequence
sequence
=
database
.
getSchema
(
schema
Name
).
findSequence
(
sequenceName
);
private
Sequence
findSequence
(
String
schema
,
String
sequenceName
)
throws
SQLException
{
Sequence
sequence
=
database
.
getSchema
(
schema
).
findSequence
(
sequenceName
);
if
(
sequence
!=
null
)
{
return
sequence
;
}
...
...
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
268c6620
...
...
@@ -322,15 +322,15 @@ public class ConstraintReferential extends Constraint {
int
refIdx
=
refCol
.
getColumnId
();
check
.
setValue
(
refIdx
,
refCol
.
convert
(
v
));
}
if
(!
found
(
session
,
refIndex
,
check
,
null
))
{
if
(!
existsRow
(
session
,
refIndex
,
check
,
null
))
{
throw
Message
.
getSQLException
(
ErrorCode
.
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
,
getShortDescription
());
}
}
private
boolean
found
(
Session
session
,
Index
searchIndex
,
SearchRow
check
,
Row
excluding
)
throws
SQLException
{
Table
t
able
=
searchIndex
.
getTable
();
t
able
.
lock
(
session
,
false
,
false
);
private
boolean
existsRow
(
Session
session
,
Index
searchIndex
,
SearchRow
check
,
Row
excluding
)
throws
SQLException
{
Table
searchT
able
=
searchIndex
.
getTable
();
searchT
able
.
lock
(
session
,
false
,
false
);
Cursor
cursor
=
searchIndex
.
find
(
session
,
check
,
check
);
while
(
cursor
.
next
())
{
SearchRow
found
;
...
...
@@ -344,7 +344,7 @@ public class ConstraintReferential extends Constraint {
int
idx
=
cols
[
i
].
getColumnId
();
Value
c
=
check
.
getValue
(
idx
);
Value
f
=
found
.
getValue
(
idx
);
if
(
t
able
.
compareTypeSave
(
c
,
f
)
!=
0
)
{
if
(
searchT
able
.
compareTypeSave
(
c
,
f
)
!=
0
)
{
allEqual
=
false
;
break
;
}
...
...
@@ -371,7 +371,7 @@ public class ConstraintReferential extends Constraint {
}
// exclude the row only for self-referencing constraints
Row
excluding
=
(
refTable
==
table
)
?
oldRow
:
null
;
if
(
found
(
session
,
index
,
check
,
excluding
))
{
if
(
existsRow
(
session
,
index
,
check
,
excluding
))
{
throw
Message
.
getSQLException
(
ErrorCode
.
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
,
getShortDescription
());
}
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
268c6620
...
...
@@ -474,9 +474,9 @@ public class FullTextLucene extends FullText {
prep
.
setString
(
2
,
tableName
);
rs
=
prep
.
executeQuery
();
if
(
rs
.
next
())
{
String
col
umn
s
=
rs
.
getString
(
1
);
if
(
col
umn
s
!=
null
)
{
for
(
String
s
:
StringUtils
.
arraySplit
(
col
umn
s
,
','
,
true
))
{
String
cols
=
rs
.
getString
(
1
);
if
(
cols
!=
null
)
{
for
(
String
s
:
StringUtils
.
arraySplit
(
cols
,
','
,
true
))
{
indexList
.
add
(
s
);
}
}
...
...
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
268c6620
...
...
@@ -321,11 +321,11 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
return
buff
.
toString
();
}
public
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
)
{
public
String
getCreateSQLForCopy
(
Table
ta
rgetTa
ble
,
String
quotedName
)
{
StringBuilder
buff
=
new
StringBuilder
(
"CREATE "
);
buff
.
append
(
indexType
.
getSQL
());
buff
.
append
(
' '
).
append
(
quotedName
);
buff
.
append
(
" ON "
).
append
(
table
.
getSQL
());
buff
.
append
(
" ON "
).
append
(
ta
rgetTa
ble
.
getSQL
());
if
(
comment
!=
null
)
{
buff
.
append
(
" COMMENT "
).
append
(
StringUtils
.
quoteStringSQL
(
comment
));
}
...
...
h2/src/main/org/h2/index/PageBtreeIndex.java
浏览文件 @
268c6620
...
...
@@ -98,7 +98,6 @@ public class PageBtreeIndex extends PageIndex {
PageBtree
page1
=
root
;
PageBtree
page2
=
root
.
split
(
splitPoint
);
store
.
logUndo
(
page2
,
null
);
int
rootPageId
=
root
.
getPos
();
int
id
=
store
.
allocatePage
();
page1
.
setPageId
(
id
);
page1
.
setParentPageId
(
rootPageId
);
...
...
h2/src/main/org/h2/index/PageData.java
浏览文件 @
268c6620
...
...
@@ -127,11 +127,11 @@ abstract class PageData extends Page {
/**
* Get the key at this position.
*
* @param
index
the index
* @param
at
the index
* @return the key
*/
long
getKey
(
int
index
)
{
return
keys
[
index
];
long
getKey
(
int
at
)
{
return
keys
[
at
];
}
/**
...
...
h2/src/main/org/h2/index/PageDataIndex.java
浏览文件 @
268c6620
...
...
@@ -160,7 +160,6 @@ public class PageDataIndex extends PageIndex implements RowIndex {
long
pivot
=
splitPoint
==
0
?
row
.
getKey
()
:
root
.
getKey
(
splitPoint
-
1
);
PageData
page1
=
root
;
PageData
page2
=
root
.
split
(
splitPoint
);
int
rootPageId
=
root
.
getPos
();
int
id
=
store
.
allocatePage
();
page1
.
setPageId
(
id
);
page1
.
setParentPageId
(
rootPageId
);
...
...
h2/src/main/org/h2/index/PageDataLeaf.java
浏览文件 @
268c6620
...
...
@@ -423,8 +423,8 @@ public class PageDataLeaf extends PageData {
}
Row
getRow
(
long
key
)
throws
SQLException
{
int
index
=
find
(
key
);
return
getRowAt
(
index
);
int
at
=
find
(
key
);
return
getRowAt
(
at
);
}
int
getRowCount
()
{
...
...
h2/src/main/org/h2/index/PageDelegateIndex.java
浏览文件 @
268c6620
...
...
@@ -24,8 +24,8 @@ public class PageDelegateIndex extends PageIndex {
private
final
PageDataIndex
mainIndex
;
public
PageDelegateIndex
(
TableData
table
,
int
id
,
String
name
,
IndexType
indexType
,
PageDataIndex
mainIndex
,
int
headPos
,
Session
session
)
throws
SQLException
{
IndexColumn
[]
col
umn
s
=
IndexColumn
.
wrap
(
new
Column
[]
{
table
.
getColumn
(
mainIndex
.
getMainIndexColumn
())});
this
.
initBaseIndex
(
table
,
id
,
name
,
col
umn
s
,
indexType
);
IndexColumn
[]
cols
=
IndexColumn
.
wrap
(
new
Column
[]
{
table
.
getColumn
(
mainIndex
.
getMainIndexColumn
())});
this
.
initBaseIndex
(
table
,
id
,
name
,
cols
,
indexType
);
this
.
mainIndex
=
mainIndex
;
if
(!
database
.
isPersistent
()
||
id
<
0
)
{
throw
Message
.
throwInternalError
(
""
+
name
);
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
268c6620
...
...
@@ -61,7 +61,7 @@ import java.sql.SQLXML;
*/
public
class
JdbcPreparedStatement
extends
JdbcStatement
implements
PreparedStatement
{
private
final
String
sql
;
private
final
String
sql
Statement
;
private
CommandInterface
command
;
private
ObjectArray
<
Value
[]>
batchParameters
;
...
...
@@ -69,7 +69,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
int
resultSetConcurrency
,
boolean
closeWithResultSet
)
throws
SQLException
{
super
(
conn
,
id
,
resultSetType
,
resultSetConcurrency
,
closeWithResultSet
);
setTrace
(
session
.
getTrace
(),
TraceObject
.
PREPARED_STATEMENT
,
id
);
this
.
sql
=
sql
;
this
.
sql
Statement
=
sql
;
command
=
conn
.
prepareCommand
(
sql
,
fetchSize
);
}
...
...
@@ -1495,7 +1495,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
if
(
super
.
checkClosed
(
write
))
{
// if the session was re-connected, re-prepare the statement
ObjectArray
<
?
extends
ParameterInterface
>
oldParams
=
command
.
getParameters
();
command
=
conn
.
prepareCommand
(
sql
,
fetchSize
);
command
=
conn
.
prepareCommand
(
sql
Statement
,
fetchSize
);
ObjectArray
<
?
extends
ParameterInterface
>
newParams
=
command
.
getParameters
();
for
(
int
i
=
0
;
i
<
oldParams
.
size
();
i
++)
{
ParameterInterface
old
=
oldParams
.
get
(
i
);
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
浏览文件 @
268c6620
...
...
@@ -74,8 +74,8 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
private
transient
JdbcDataSourceFactory
factory
;
private
transient
PrintWriter
logWriter
;
private
int
loginTimeout
;
private
String
user
=
""
;
private
char
[]
password
=
new
char
[
0
];
private
String
user
Name
=
""
;
private
char
[]
password
Chars
=
new
char
[
0
];
private
String
url
=
""
;
static
{
...
...
@@ -150,7 +150,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
public
Connection
getConnection
()
throws
SQLException
{
debugCodeCall
(
"getConnection"
);
return
getJdbcConnection
(
user
,
StringUtils
.
cloneCharArray
(
password
));
return
getJdbcConnection
(
user
Name
,
StringUtils
.
cloneCharArray
(
passwordChars
));
}
/**
...
...
@@ -205,7 +205,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
public
void
setPassword
(
String
password
)
{
debugCodeCall
(
"setPassword"
,
""
);
this
.
password
=
convertToCharArray
(
password
);
this
.
password
Chars
=
convertToCharArray
(
password
);
}
/**
...
...
@@ -217,7 +217,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
if
(
isDebugEnabled
())
{
debugCode
(
"setPasswordChars(new char[0]);"
);
}
this
.
password
=
password
;
this
.
password
Chars
=
password
;
}
private
char
[]
convertToCharArray
(
String
s
)
{
...
...
@@ -235,7 +235,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
public
String
getPassword
()
{
debugCodeCall
(
"getPassword"
);
return
convertToString
(
password
);
return
convertToString
(
password
Chars
);
}
/**
...
...
@@ -245,7 +245,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
public
String
getUser
()
{
debugCodeCall
(
"getUser"
);
return
user
;
return
user
Name
;
}
/**
...
...
@@ -255,7 +255,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
public
void
setUser
(
String
user
)
{
debugCodeCall
(
"setUser"
,
user
);
this
.
user
=
user
;
this
.
user
Name
=
user
;
}
/**
...
...
@@ -269,8 +269,8 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
String
factoryClassName
=
JdbcDataSourceFactory
.
class
.
getName
();
Reference
ref
=
new
Reference
(
getClass
().
getName
(),
factoryClassName
,
null
);
ref
.
add
(
new
StringRefAddr
(
"url"
,
url
));
ref
.
add
(
new
StringRefAddr
(
"user"
,
user
));
ref
.
add
(
new
StringRefAddr
(
"password"
,
convertToString
(
password
)));
ref
.
add
(
new
StringRefAddr
(
"user"
,
user
Name
));
ref
.
add
(
new
StringRefAddr
(
"password"
,
convertToString
(
password
Chars
)));
ref
.
add
(
new
StringRefAddr
(
"loginTimeout"
,
String
.
valueOf
(
loginTimeout
)));
return
ref
;
}
...
...
@@ -285,7 +285,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
public
XAConnection
getXAConnection
()
throws
SQLException
{
debugCodeCall
(
"getXAConnection"
);
int
id
=
getNextId
(
XA_DATA_SOURCE
);
return
new
JdbcXAConnection
(
factory
,
id
,
url
,
user
,
password
);
return
new
JdbcXAConnection
(
factory
,
id
,
url
,
user
Name
,
passwordChars
);
}
//## Java 1.4 end ##
...
...
@@ -362,7 +362,7 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
* INTERNAL
*/
public
String
toString
()
{
return
getTraceObjectName
()
+
": url="
+
url
+
" user="
+
user
;
return
getTraceObjectName
()
+
": url="
+
url
+
" user="
+
user
Name
;
}
}
h2/src/main/org/h2/log/LogFile.java
浏览文件 @
268c6620
...
...
@@ -69,7 +69,7 @@ public class LogFile {
private
byte
[]
buffer
;
private
ObjectArray
<
Record
>
unwritten
;
private
DataPage
rowBuff
;
private
int
p
os
=
LogSystem
.
LOG_WRITTEN
;
private
int
logP
os
=
LogSystem
.
LOG_WRITTEN
;
private
int
firstUncommittedPos
=
LogSystem
.
LOG_WRITTEN
;
private
int
firstUnwrittenPos
=
LogSystem
.
LOG_WRITTEN
;
...
...
@@ -88,8 +88,8 @@ public class LogFile {
if
(!
log
.
getDatabase
().
isReadOnly
())
{
writeHeader
();
}
p
os
=
getBlock
();
firstUncommittedPos
=
p
os
;
logP
os
=
getBlock
();
firstUncommittedPos
=
logP
os
;
}
catch
(
SQLException
e
)
{
close
(
false
);
throw
e
;
...
...
@@ -167,12 +167,12 @@ public class LogFile {
if
(
buff
.
length
()
>=
buffer
.
length
)
{
// special case really long write request: write it without buffering
file
.
write
(
buff
.
getBytes
(),
0
,
buff
.
length
());
p
os
=
getBlock
();
logP
os
=
getBlock
();
return
;
}
System
.
arraycopy
(
buff
.
getBytes
(),
0
,
buffer
,
bufferPos
,
buff
.
length
());
bufferPos
+=
buff
.
length
();
p
os
=
getBlock
()
+
(
bufferPos
/
BLOCK_SIZE
);
logP
os
=
getBlock
()
+
(
bufferPos
/
BLOCK_SIZE
);
}
/**
...
...
@@ -367,9 +367,9 @@ public class LogFile {
try
{
int
max
=
(
int
)
(
length
/
BLOCK_SIZE
);
while
(
true
)
{
p
os
=
getBlock
();
database
.
setProgress
(
DatabaseEventListener
.
STATE_RECOVER
,
fileName
,
p
os
,
max
);
if
((
long
)
p
os
*
BLOCK_SIZE
>=
length
)
{
logP
os
=
getBlock
();
database
.
setProgress
(
DatabaseEventListener
.
STATE_RECOVER
,
fileName
,
logP
os
,
max
);
if
((
long
)
logP
os
*
BLOCK_SIZE
>=
length
)
{
break
;
}
boolean
more
=
redoOrUndo
(
false
,
readOnly
);
...
...
@@ -392,7 +392,7 @@ public class LogFile {
// on power loss, sometime there is garbage at the end of the file
// we stop recovering in this case (checksum mismatch)
}
go
(
p
os
);
go
(
logP
os
);
}
/**
...
...
@@ -424,13 +424,13 @@ public class LogFile {
throw
Message
.
getSQLException
(
ErrorCode
.
DATABASE_IS_CLOSED
);
}
file
.
write
(
buffer
,
0
,
bufferPos
);
p
os
=
getBlock
();
logP
os
=
getBlock
();
for
(
Record
r
:
unwritten
)
{
r
.
setLogWritten
(
id
,
p
os
);
r
.
setLogWritten
(
id
,
logP
os
);
}
unwritten
.
clear
();
bufferPos
=
0
;
long
min
=
(
long
)
p
os
*
BLOCK_SIZE
;
long
min
=
(
long
)
logP
os
*
BLOCK_SIZE
;
min
=
MathUtils
.
scaleUp50Percent
(
Constants
.
FILE_MIN_SIZE
,
min
,
Constants
.
FILE_PAGE_SIZE
,
Constants
.
FILE_MAX_INCREMENT
);
if
(
min
>
file
.
length
())
{
file
.
setLength
(
min
);
...
...
@@ -598,7 +598,7 @@ public class LogFile {
}
int
getPos
()
{
return
p
os
;
return
logP
os
;
}
long
getFileSize
()
throws
SQLException
{
...
...
h2/src/main/org/h2/message/Trace.java
浏览文件 @
268c6620
...
...
@@ -102,7 +102,7 @@ public class Trace {
private
TraceWriter
traceWriter
;
private
String
module
;
private
String
lineSeparator
;
private
int
l
evel
=
TraceSystem
.
PARENT
;
private
int
traceL
evel
=
TraceSystem
.
PARENT
;
Trace
(
TraceWriter
traceWriter
,
String
module
)
{
this
.
traceWriter
=
traceWriter
;
...
...
@@ -117,14 +117,14 @@ public class Trace {
* @param level the new level
*/
public
void
setLevel
(
int
level
)
{
this
.
l
evel
=
level
;
this
.
traceL
evel
=
level
;
}
private
boolean
isEnabled
(
int
level
)
{
if
(
this
.
l
evel
==
TraceSystem
.
PARENT
)
{
if
(
this
.
traceL
evel
==
TraceSystem
.
PARENT
)
{
return
traceWriter
.
isEnabled
(
level
);
}
return
level
<=
this
.
l
evel
;
return
level
<=
this
.
traceL
evel
;
}
/**
...
...
h2/src/main/org/h2/message/TraceObject.java
浏览文件 @
268c6620
...
...
@@ -114,7 +114,7 @@ public class TraceObject {
};
private
Trace
trace
;
private
int
type
;
private
int
t
raceT
ype
;
private
int
id
;
/**
...
...
@@ -126,7 +126,7 @@ public class TraceObject {
*/
protected
void
setTrace
(
Trace
trace
,
int
type
,
int
id
)
{
this
.
trace
=
trace
;
this
.
type
=
type
;
this
.
t
raceT
ype
=
type
;
this
.
id
=
id
;
}
...
...
@@ -159,7 +159,7 @@ public class TraceObject {
* INTERNAL
*/
public
String
getTraceObjectName
()
{
return
PREFIX
[
type
]
+
id
;
return
PREFIX
[
t
raceT
ype
]
+
id
;
}
/**
...
...
@@ -195,13 +195,13 @@ public class TraceObject {
* className prefixId = objectName.value.
*
* @param className the class name of the result
* @param
t
ype the prefix type
* @param
i
d the trace object id of the created object
* @param
newT
ype the prefix type
* @param
newI
d the trace object id of the created object
* @param value the value to assign this new object to
*/
protected
void
debugCodeAssign
(
String
className
,
int
type
,
int
i
d
,
String
value
)
{
protected
void
debugCodeAssign
(
String
className
,
int
newType
,
int
newI
d
,
String
value
)
{
if
(
trace
.
isDebugEnabled
())
{
trace
.
debugCode
(
className
+
" "
+
PREFIX
[
type
]
+
i
d
+
" = "
+
getTraceObjectName
()
+
"."
+
value
+
";"
);
trace
.
debugCode
(
className
+
" "
+
PREFIX
[
newType
]
+
newI
d
+
" = "
+
getTraceObjectName
()
+
"."
+
value
+
";"
);
}
}
...
...
h2/src/main/org/h2/message/TraceSystem.java
浏览文件 @
268c6620
...
...
@@ -84,7 +84,7 @@ public class TraceSystem implements TraceWriter {
private
int
levelSystemOut
=
DEFAULT_TRACE_LEVEL_SYSTEM_OUT
;
private
int
levelFile
=
DEFAULT_TRACE_LEVEL_FILE
;
private
int
level
;
private
int
level
Max
;
private
int
maxFileSize
=
DEFAULT_MAX_FILE_SIZE
;
private
String
fileName
;
private
SmallLRUCache
<
String
,
Trace
>
traces
;
...
...
@@ -109,7 +109,7 @@ public class TraceSystem implements TraceWriter {
}
private
void
updateLevel
()
{
level
=
Math
.
max
(
levelSystemOut
,
levelFile
);
level
Max
=
Math
.
max
(
levelSystemOut
,
levelFile
);
}
/**
...
...
@@ -140,7 +140,7 @@ public class TraceSystem implements TraceWriter {
}
public
boolean
isEnabled
(
int
level
)
{
return
level
<=
this
.
level
;
return
level
<=
this
.
level
Max
;
}
/**
...
...
@@ -217,7 +217,7 @@ public class TraceSystem implements TraceWriter {
}
public
void
write
(
int
level
,
String
module
,
String
s
,
Throwable
t
)
{
if
(
level
<=
levelSystemOut
||
level
>
this
.
level
)
{
if
(
level
<=
levelSystemOut
||
level
>
this
.
level
Max
)
{
// level <= levelSystemOut: the system out level is set higher
// level > this.level: the level for this module is set higher
System
.
out
.
println
(
format
(
module
,
s
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论