Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
16c09993
提交
16c09993
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed unused code and reduce visibility where possible.
上级
32e1650a
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
41 行增加
和
41 行删除
+41
-41
Command.java
h2/src/main/org/h2/command/Command.java
+6
-6
CommandContainer.java
h2/src/main/org/h2/command/CommandContainer.java
+1
-1
CommandList.java
h2/src/main/org/h2/command/CommandList.java
+2
-2
Comment.java
h2/src/main/org/h2/engine/Comment.java
+1
-1
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+2
-2
Database.java
h2/src/main/org/h2/engine/Database.java
+7
-7
DatabaseCloser.java
h2/src/main/org/h2/engine/DatabaseCloser.java
+2
-2
Engine.java
h2/src/main/org/h2/engine/Engine.java
+1
-1
Mode.java
h2/src/main/org/h2/engine/Mode.java
+1
-1
RightOwner.java
h2/src/main/org/h2/engine/RightOwner.java
+2
-2
Session.java
h2/src/main/org/h2/engine/Session.java
+3
-3
SessionFactory.java
h2/src/main/org/h2/engine/SessionFactory.java
+1
-1
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+1
-1
SessionWithState.java
h2/src/main/org/h2/engine/SessionWithState.java
+1
-1
SettingsBase.java
h2/src/main/org/h2/engine/SettingsBase.java
+1
-1
UndoLog.java
h2/src/main/org/h2/engine/UndoLog.java
+5
-5
UndoLogRecord.java
h2/src/main/org/h2/engine/UndoLogRecord.java
+3
-3
User.java
h2/src/main/org/h2/engine/User.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Command.java
浏览文件 @
16c09993
...
...
@@ -28,14 +28,14 @@ public abstract class Command implements CommandInterface {
protected
final
Session
session
;
/**
* The
trace modul
e.
* The
last start tim
e.
*/
protected
final
Trace
trac
e
;
protected
long
startTim
e
;
/**
* The
last start tim
e.
* The
trace modul
e.
*/
pr
otected
long
startTim
e
;
pr
ivate
final
Trace
trac
e
;
/**
* If this query was canceled.
...
...
@@ -46,7 +46,7 @@ public abstract class Command implements CommandInterface {
private
boolean
canReuse
;
public
Command
(
Parser
parser
,
String
sql
)
{
Command
(
Parser
parser
,
String
sql
)
{
this
.
session
=
parser
.
getSession
();
this
.
sql
=
sql
;
trace
=
session
.
getDatabase
().
getTrace
(
Trace
.
COMMAND
);
...
...
@@ -127,7 +127,7 @@ public abstract class Command implements CommandInterface {
*
* @throws SQLException if the statement has been canceled
*/
p
ublic
void
checkCanceled
()
{
p
rotected
void
checkCanceled
()
{
if
(
cancel
)
{
cancel
=
false
;
throw
DbException
.
get
(
ErrorCode
.
STATEMENT_WAS_CANCELED
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/CommandContainer.java
浏览文件 @
16c09993
...
...
@@ -16,7 +16,7 @@ import org.h2.value.Value;
* Represents a single SQL statements.
* It wraps a prepared statement.
*/
public
class
CommandContainer
extends
Command
{
class
CommandContainer
extends
Command
{
private
Prepared
prepared
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/CommandList.java
浏览文件 @
16c09993
...
...
@@ -13,12 +13,12 @@ import org.h2.result.ResultInterface;
/**
* Represents a list of SQL statements.
*/
public
class
CommandList
extends
Command
{
class
CommandList
extends
Command
{
private
final
Command
command
;
private
final
String
remaining
;
public
CommandList
(
Parser
parser
,
String
sql
,
Command
c
,
String
remaining
)
{
CommandList
(
Parser
parser
,
String
sql
,
Command
c
,
String
remaining
)
{
super
(
parser
,
sql
);
this
.
command
=
c
;
this
.
remaining
=
remaining
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Comment.java
浏览文件 @
16c09993
...
...
@@ -94,7 +94,7 @@ public class Comment extends DbObjectBase {
* @param obj the object
* @return the key name
*/
public
static
String
getKey
(
DbObject
obj
)
{
static
String
getKey
(
DbObject
obj
)
{
return
getTypeName
(
obj
.
getType
())
+
" "
+
obj
.
getSQL
();
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
16c09993
...
...
@@ -284,7 +284,7 @@ public class ConnectionInfo implements Cloneable {
* @param defaultValue the default value
* @return the value
*/
public
boolean
getProperty
(
String
key
,
boolean
defaultValue
)
{
boolean
getProperty
(
String
key
,
boolean
defaultValue
)
{
String
x
=
getProperty
(
key
,
null
);
if
(
x
==
null
)
{
return
defaultValue
;
...
...
@@ -403,7 +403,7 @@ public class ConnectionInfo implements Cloneable {
* @param defaultValue the default value
* @return the value as a String
*/
public
int
getProperty
(
String
key
,
int
defaultValue
)
{
int
getProperty
(
String
key
,
int
defaultValue
)
{
if
(
SysProperties
.
CHECK
&&
!
isKnownSetting
(
key
))
{
DbException
.
throwInternalError
(
key
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
16c09993
...
...
@@ -309,7 +309,7 @@ public class Database implements DataHandler {
* @return true if the call was successful,
* false if another connection was faster
*/
synchronized
boolean
reconnectModified
(
boolean
pending
)
{
private
synchronized
boolean
reconnectModified
(
boolean
pending
)
{
if
(
readOnly
||
lock
==
null
||
fileLockMethod
!=
FileLock
.
LOCK_SERIALIZED
)
{
return
true
;
}
...
...
@@ -435,7 +435,7 @@ public class Database implements DataHandler {
* @param name the name of the database (including path)
* @return true if one exists
*/
public
static
boolean
exists
(
String
name
)
{
static
boolean
exists
(
String
name
)
{
return
IOUtils
.
exists
(
name
+
Constants
.
SUFFIX_PAGE_FILE
);
}
...
...
@@ -470,7 +470,7 @@ public class Database implements DataHandler {
* @param testHash the hash code
* @return true if the cipher algorithm and the password match
*/
public
boolean
validateFilePasswordHash
(
String
testCipher
,
byte
[]
testHash
)
{
boolean
validateFilePasswordHash
(
String
testCipher
,
byte
[]
testHash
)
{
if
(!
StringUtils
.
equals
(
testCipher
,
this
.
cipher
))
{
return
false
;
}
...
...
@@ -919,7 +919,7 @@ public class Database implements DataHandler {
* @return the session
* @throws SQLException if the database is in exclusive mode
*/
public
synchronized
Session
createSession
(
User
user
)
{
synchronized
Session
createSession
(
User
user
)
{
if
(
exclusiveSession
!=
null
)
{
throw
DbException
.
get
(
ErrorCode
.
DATABASE_IS_IN_EXCLUSIVE_MODE
);
}
...
...
@@ -1662,7 +1662,7 @@ public class Database implements DataHandler {
* @param session the session
* @param transaction the name of the transaction
*/
public
void
prepareCommit
(
Session
session
,
String
transaction
)
{
void
prepareCommit
(
Session
session
,
String
transaction
)
{
if
(
readOnly
)
{
return
;
}
...
...
@@ -1676,7 +1676,7 @@ public class Database implements DataHandler {
*
* @param session the session
*/
public
void
commit
(
Session
session
)
{
void
commit
(
Session
session
)
{
if
(
readOnly
)
{
return
;
}
...
...
@@ -1921,7 +1921,7 @@ public class Database implements DataHandler {
* Called after the database has been opened and initialized. This method
* notifies the event listener if one has been set.
*/
public
void
opened
()
{
void
opened
()
{
if
(
eventListener
!=
null
)
{
eventListener
.
opened
();
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/DatabaseCloser.java
浏览文件 @
16c09993
...
...
@@ -15,7 +15,7 @@ import org.h2.message.Trace;
* close a connection. A database closer object only exists if there is no user
* connected to the database.
*/
public
class
DatabaseCloser
extends
Thread
{
class
DatabaseCloser
extends
Thread
{
private
final
boolean
shutdownHook
;
private
final
Trace
trace
;
...
...
@@ -34,7 +34,7 @@ public class DatabaseCloser extends Thread {
* Stop and disable the database closer. This method is called after the
* database has been closed, or after a session has been created.
*/
public
void
reset
()
{
void
reset
()
{
synchronized
(
this
)
{
databaseRef
=
null
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Engine.java
浏览文件 @
16c09993
...
...
@@ -229,7 +229,7 @@ public class Engine implements SessionFactory {
*
* @param name the database name
*/
public
void
close
(
String
name
)
{
void
close
(
String
name
)
{
if
(
jmx
)
{
try
{
Utils
.
callStaticMethod
(
"org.h2.jmx.DatabaseInfo.unregisterMBean"
,
name
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
16c09993
...
...
@@ -19,7 +19,7 @@ public class Mode {
/**
* The name of the default mode.
*/
public
static
final
String
REGULAR
=
"REGULAR"
;
static
final
String
REGULAR
=
"REGULAR"
;
private
static
final
HashMap
<
String
,
Mode
>
MODES
=
New
.
hashMap
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/RightOwner.java
浏览文件 @
16c09993
...
...
@@ -100,7 +100,7 @@ public abstract class RightOwner extends DbObjectBase {
*
* @param table the table
*/
public
void
revokeRight
(
Table
table
)
{
void
revokeRight
(
Table
table
)
{
if
(
grantedRights
==
null
)
{
return
;
}
...
...
@@ -129,7 +129,7 @@ public abstract class RightOwner extends DbObjectBase {
* @param role the role to revoke
* @throws SQLException if the right has not been granted
*/
public
void
revokeRole
(
Role
role
)
{
void
revokeRole
(
Role
role
)
{
if
(
grantedRoles
==
null
)
{
return
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Session.java
浏览文件 @
16c09993
...
...
@@ -331,7 +331,7 @@ public class Session extends SessionWithState {
*
* @param constraint the constraint
*/
public
void
removeLocalTempTableConstraint
(
Constraint
constraint
)
{
void
removeLocalTempTableConstraint
(
Constraint
constraint
)
{
if
(
localTempTableConstraints
!=
null
)
{
localTempTableConstraints
.
remove
(
constraint
.
getName
());
synchronized
(
database
)
{
...
...
@@ -653,7 +653,7 @@ public class Session extends SessionWithState {
*
* @param t the table to unlock
*/
public
void
unlock
(
Table
t
)
{
void
unlock
(
Table
t
)
{
locks
.
remove
(
t
);
}
...
...
@@ -746,7 +746,7 @@ public class Session extends SessionWithState {
* This method is called after the transaction log has written the commit
* entry for this session.
*/
public
void
setAllCommitted
()
{
void
setAllCommitted
()
{
firstUncommittedLog
=
Session
.
LOG_WRITTEN
;
firstUncommittedPos
=
Session
.
LOG_WRITTEN
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionFactory.java
浏览文件 @
16c09993
...
...
@@ -11,7 +11,7 @@ import java.sql.SQLException;
/**
* A class that implements this interface can create new database sessions.
*/
public
interface
SessionFactory
{
interface
SessionFactory
{
/**
* Create a new session.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
16c09993
...
...
@@ -424,7 +424,7 @@ public class SessionRemote extends SessionWithState implements DataHandler {
* @param count the retry count index
* @return true if reconnected
*/
p
ublic
boolean
autoReconnect
(
int
count
)
{
p
rivate
boolean
autoReconnect
(
int
count
)
{
if
(!
isClosed
())
{
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionWithState.java
浏览文件 @
16c09993
...
...
@@ -15,7 +15,7 @@ import org.h2.value.Value;
/**
* The base class for both remote and embedded sessions.
*/
public
abstract
class
SessionWithState
implements
SessionInterface
{
abstract
class
SessionWithState
implements
SessionInterface
{
protected
ArrayList
<
String
>
sessionState
;
protected
boolean
sessionStateChanged
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SettingsBase.java
浏览文件 @
16c09993
...
...
@@ -87,7 +87,7 @@ public class SettingsBase {
* @param k the key
* @return true if they do
*/
p
ublic
boolean
containsKey
(
String
k
)
{
p
rotected
boolean
containsKey
(
String
k
)
{
return
settings
.
containsKey
(
k
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/UndoLog.java
浏览文件 @
16c09993
...
...
@@ -35,7 +35,7 @@ public class UndoLog {
*
* @param session the session
*/
public
UndoLog
(
Session
session
)
{
UndoLog
(
Session
session
)
{
this
.
database
=
session
.
getDatabase
();
largeTransactions
=
database
.
getSettings
().
largeTransactions
;
}
...
...
@@ -45,7 +45,7 @@ public class UndoLog {
*
* @return the number of rows
*/
public
int
size
()
{
int
size
()
{
if
(
largeTransactions
)
{
return
storedEntries
+
records
.
size
();
}
...
...
@@ -59,7 +59,7 @@ public class UndoLog {
* Clear the undo log. This method is called after the transaction is
* committed.
*/
public
void
clear
()
{
void
clear
()
{
records
.
clear
();
storedEntries
=
0
;
storedEntriesPos
.
clear
();
...
...
@@ -136,7 +136,7 @@ public class UndoLog {
*
* @param trimToSize if the undo array should shrink to conserve memory
*/
public
void
removeLast
(
boolean
trimToSize
)
{
void
removeLast
(
boolean
trimToSize
)
{
int
i
=
records
.
size
()
-
1
;
UndoLogRecord
r
=
records
.
remove
(
i
);
if
(!
r
.
isStored
())
{
...
...
@@ -152,7 +152,7 @@ public class UndoLog {
*
* @param entry the entry
*/
public
void
add
(
UndoLogRecord
entry
)
{
void
add
(
UndoLogRecord
entry
)
{
records
.
add
(
entry
);
if
(
largeTransactions
)
{
memoryUndo
++;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/UndoLogRecord.java
浏览文件 @
16c09993
...
...
@@ -44,7 +44,7 @@ public class UndoLogRecord {
* @param op the operation type
* @param row the row that was deleted or inserted
*/
public
UndoLogRecord
(
Table
table
,
short
op
,
Row
row
)
{
UndoLogRecord
(
Table
table
,
short
op
,
Row
row
)
{
this
.
table
=
table
;
this
.
row
=
row
;
this
.
operation
=
op
;
...
...
@@ -80,7 +80,7 @@ public class UndoLogRecord {
*
* @param session the session
*/
public
void
undo
(
Session
session
)
{
void
undo
(
Session
session
)
{
Database
db
=
session
.
getDatabase
();
switch
(
operation
)
{
case
INSERT:
...
...
@@ -252,7 +252,7 @@ public class UndoLogRecord {
* This method is called after the operation was committed.
* It commits the change to the indexes.
*/
public
void
commit
()
{
void
commit
()
{
table
.
commit
(
operation
,
row
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/User.java
浏览文件 @
16c09993
...
...
@@ -177,7 +177,7 @@ public class User extends RightOwner {
* @param userPasswordHash the password data (the user password hash)
* @return true if the user password hash is correct
*/
public
boolean
validateUserPasswordHash
(
byte
[]
userPasswordHash
)
{
boolean
validateUserPasswordHash
(
byte
[]
userPasswordHash
)
{
if
(
userPasswordHash
.
length
==
0
&&
passwordHash
.
length
==
0
)
{
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论