Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
3d763b4a
提交
3d763b4a
authored
12月 11, 2017
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove some dead code
found by UCDetector
上级
67aa05ba
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
1 行增加
和
176 行删除
+1
-176
DbSettings.java
h2/src/main/org/h2/engine/DbSettings.java
+0
-6
Mode.java
h2/src/main/org/h2/engine/Mode.java
+0
-9
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+0
-11
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+0
-5
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+0
-17
LobStorageBackend.java
h2/src/main/org/h2/store/LobStorageBackend.java
+0
-22
LobStorageFrontend.java
h2/src/main/org/h2/store/LobStorageFrontend.java
+0
-5
LobStorageInterface.java
h2/src/main/org/h2/store/LobStorageInterface.java
+0
-8
LobStorageMap.java
h2/src/main/org/h2/store/LobStorageMap.java
+0
-13
Column.java
h2/src/main/org/h2/table/Column.java
+0
-4
ColumnNamer.java
h2/src/main/org/h2/util/ColumnNamer.java
+0
-9
Task.java
h2/src/main/org/h2/util/Task.java
+0
-10
TestColumnNamer.java
h2/src/test/org/h2/test/utils/TestColumnNamer.java
+1
-2
XMLParser.java
h2/src/tools/org/h2/build/doc/XMLParser.java
+0
-55
没有找到文件。
h2/src/main/org/h2/engine/DbSettings.java
浏览文件 @
3d763b4a
...
@@ -344,12 +344,6 @@ public class DbSettings extends SettingsBase {
...
@@ -344,12 +344,6 @@ public class DbSettings extends SettingsBase {
*/
*/
public
final
boolean
compressData
=
get
(
"COMPRESS"
,
false
);
public
final
boolean
compressData
=
get
(
"COMPRESS"
,
false
);
/**
* Database setting <code>MULTI_THREADED</code>
* (default: false).<br />
*/
public
final
boolean
multiThreaded
=
get
(
"MULTI_THREADED"
,
false
);
private
DbSettings
(
HashMap
<
String
,
String
>
s
)
{
private
DbSettings
(
HashMap
<
String
,
String
>
s
)
{
super
(
s
);
super
(
s
);
}
}
...
...
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
3d763b4a
...
@@ -22,11 +22,6 @@ public class Mode {
...
@@ -22,11 +22,6 @@ public class Mode {
REGULAR
,
DB2
,
Derby
,
MSSQLServer
,
HSQLDB
,
MySQL
,
Oracle
,
PostgreSQL
,
Ignite
,
REGULAR
,
DB2
,
Derby
,
MSSQLServer
,
HSQLDB
,
MySQL
,
Oracle
,
PostgreSQL
,
Ignite
,
}
}
/**
* The name of the default mode.
*/
static
final
String
REGULAR
=
ModeEnum
.
REGULAR
.
name
();
private
static
final
HashMap
<
String
,
Mode
>
MODES
=
New
.
hashMap
();
private
static
final
HashMap
<
String
,
Mode
>
MODES
=
New
.
hashMap
();
// Modes are also documented in the features section
// Modes are also documented in the features section
...
@@ -317,10 +312,6 @@ public class Mode {
...
@@ -317,10 +312,6 @@ public class Mode {
return
MODES
.
get
(
StringUtils
.
toUpperEnglish
(
name
));
return
MODES
.
get
(
StringUtils
.
toUpperEnglish
(
name
));
}
}
public
static
Mode
getMySQL
()
{
return
getInstance
(
ModeEnum
.
MySQL
.
name
());
}
public
static
Mode
getOracle
()
{
public
static
Mode
getOracle
()
{
return
getInstance
(
ModeEnum
.
Oracle
.
name
());
return
getInstance
(
ModeEnum
.
Oracle
.
name
());
}
}
...
...
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
3d763b4a
...
@@ -85,17 +85,6 @@ public class SysProperties {
...
@@ -85,17 +85,6 @@ public class SysProperties {
public
static
final
String
ALLOWED_CLASSES
=
public
static
final
String
ALLOWED_CLASSES
=
Utils
.
getProperty
(
"h2.allowedClasses"
,
"*"
);
Utils
.
getProperty
(
"h2.allowedClasses"
,
"*"
);
/**
* System property <code>h2.browser</code> (default: null).<br />
* The preferred browser to use. If not set, the default browser is used.
* For Windows, to use the Internet Explorer, set this property to
* 'explorer'. For Mac OS, if the default browser is not Safari and you want
* to use Safari, use:
* <code>java -Dh2.browser="open,-a,Safari,%url" ...</code>.
*/
public
static
final
String
BROWSER
=
Utils
.
getProperty
(
H2_BROWSER
,
null
);
/**
/**
* System property <code>h2.enableAnonymousTLS</code> (default: true).<br />
* System property <code>h2.enableAnonymousTLS</code> (default: true).<br />
* When using TLS connection, the anonymous cipher suites should be enabled.
* When using TLS connection, the anonymous cipher suites should be enabled.
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
3d763b4a
...
@@ -49,11 +49,6 @@ public class PgServer implements Service {
...
@@ -49,11 +49,6 @@ public class PgServer implements Service {
*/
*/
public
static
final
int
PG_TYPE_VARCHAR
=
1043
;
public
static
final
int
PG_TYPE_VARCHAR
=
1043
;
/**
* The integer array type (for the column pg_index.indkey).
*/
public
static
final
int
PG_TYPE_INT2VECTOR
=
22
;
public
static
final
int
PG_TYPE_BOOL
=
16
;
public
static
final
int
PG_TYPE_BOOL
=
16
;
public
static
final
int
PG_TYPE_BYTEA
=
17
;
public
static
final
int
PG_TYPE_BYTEA
=
17
;
public
static
final
int
PG_TYPE_BPCHAR
=
1042
;
public
static
final
int
PG_TYPE_BPCHAR
=
1042
;
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
3d763b4a
...
@@ -24,7 +24,6 @@ import java.util.Map.Entry;
...
@@ -24,7 +24,6 @@ import java.util.Map.Entry;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.TimeZone
;
import
java.util.TimeZone
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
import
org.h2.engine.SysProperties
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
...
@@ -189,22 +188,6 @@ public class WebServer implements Service {
...
@@ -189,22 +188,6 @@ public class WebServer implements Service {
return
data
;
return
data
;
}
}
/**
* Check if this is a simple name (only contains '.', '-', '_', letters, or
* digits).
*
* @param s the string
* @return true if it's a simple name
*/
static
boolean
isSimpleName
(
String
s
)
{
for
(
char
c
:
s
.
toCharArray
())
{
if
(
c
!=
'.'
&&
c
!=
'_'
&&
c
!=
'-'
&&
!
Character
.
isLetterOrDigit
(
c
))
{
return
false
;
}
}
return
true
;
}
/**
/**
* Remove this web thread from the set of running threads.
* Remove this web thread from the set of running threads.
*
*
...
...
h2/src/main/org/h2/store/LobStorageBackend.java
浏览文件 @
3d763b4a
...
@@ -594,28 +594,6 @@ public class LobStorageBackend implements LobStorageInterface {
...
@@ -594,28 +594,6 @@ public class LobStorageBackend implements LobStorageInterface {
return
lob
;
return
lob
;
}
}
@Override
public
void
setTable
(
ValueLobDb
lob
,
int
table
)
{
long
lobId
=
lob
.
getLobId
();
assertNotHolds
(
conn
.
getSession
());
// see locking discussion at the top
synchronized
(
database
)
{
synchronized
(
conn
.
getSession
())
{
try
{
init
();
String
sql
=
"UPDATE "
+
LOBS
+
" SET TABLE = ? WHERE ID = ?"
;
PreparedStatement
prep
=
prepare
(
sql
);
prep
.
setInt
(
1
,
table
);
prep
.
setLong
(
2
,
lobId
);
prep
.
executeUpdate
();
reuse
(
sql
,
prep
);
}
catch
(
SQLException
e
)
{
throw
DbException
.
convert
(
e
);
}
}
}
}
private
static
void
assertNotHolds
(
Object
lock
)
{
private
static
void
assertNotHolds
(
Object
lock
)
{
if
(
Thread
.
holdsLock
(
lock
))
{
if
(
Thread
.
holdsLock
(
lock
))
{
throw
DbException
.
throwInternalError
(
lock
.
toString
());
throw
DbException
.
throwInternalError
(
lock
.
toString
());
...
...
h2/src/main/org/h2/store/LobStorageFrontend.java
浏览文件 @
3d763b4a
...
@@ -72,11 +72,6 @@ public class LobStorageFrontend implements LobStorageInterface {
...
@@ -72,11 +72,6 @@ public class LobStorageFrontend implements LobStorageInterface {
throw
new
UnsupportedOperationException
();
throw
new
UnsupportedOperationException
();
}
}
@Override
public
void
setTable
(
ValueLobDb
lob
,
int
tableIdSessionVariable
)
{
throw
new
UnsupportedOperationException
();
}
@Override
@Override
public
void
removeAllForTable
(
int
tableId
)
{
public
void
removeAllForTable
(
int
tableId
)
{
throw
new
UnsupportedOperationException
();
throw
new
UnsupportedOperationException
();
...
...
h2/src/main/org/h2/store/LobStorageInterface.java
浏览文件 @
3d763b4a
...
@@ -55,14 +55,6 @@ public interface LobStorageInterface {
...
@@ -55,14 +55,6 @@ public interface LobStorageInterface {
InputStream
getInputStream
(
ValueLobDb
lob
,
byte
[]
hmac
,
long
byteCount
)
InputStream
getInputStream
(
ValueLobDb
lob
,
byte
[]
hmac
,
long
byteCount
)
throws
IOException
;
throws
IOException
;
/**
* Set the table reference of this lob.
*
* @param lob the lob
* @param table the table
*/
void
setTable
(
ValueLobDb
lob
,
int
table
);
/**
/**
* Delete a LOB (from the database, if it is stored there).
* Delete a LOB (from the database, if it is stored there).
*
*
...
...
h2/src/main/org/h2/store/LobStorageMap.java
浏览文件 @
3d763b4a
...
@@ -289,19 +289,6 @@ public class LobStorageMap implements LobStorageInterface {
...
@@ -289,19 +289,6 @@ public class LobStorageMap implements LobStorageInterface {
return
streamStore
.
get
(
streamStoreId
);
return
streamStore
.
get
(
streamStoreId
);
}
}
@Override
public
void
setTable
(
ValueLobDb
lob
,
int
tableId
)
{
init
();
long
lobId
=
lob
.
getLobId
();
Object
[]
value
=
lobMap
.
remove
(
lobId
);
if
(
TRACE
)
{
trace
(
"move "
+
lob
.
getTableId
()
+
"/"
+
lob
.
getLobId
()
+
" > "
+
tableId
+
"/"
+
lobId
);
}
value
[
1
]
=
tableId
;
lobMap
.
put
(
lobId
,
value
);
}
@Override
@Override
public
void
removeAllForTable
(
int
tableId
)
{
public
void
removeAllForTable
(
int
tableId
)
{
init
();
init
();
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
3d763b4a
...
@@ -95,10 +95,6 @@ public class Column {
...
@@ -95,10 +95,6 @@ public class Column {
this
(
name
,
type
,
-
1
,
-
1
,
-
1
,
null
);
this
(
name
,
type
,
-
1
,
-
1
,
-
1
,
null
);
}
}
public
Column
(
String
name
,
int
type
,
String
[]
enumerators
)
{
this
(
name
,
type
,
-
1
,
-
1
,
-
1
,
enumerators
);
}
public
Column
(
String
name
,
int
type
,
long
precision
,
int
scale
,
public
Column
(
String
name
,
int
type
,
long
precision
,
int
scale
,
int
displaySize
)
{
int
displaySize
)
{
this
(
name
,
type
,
precision
,
scale
,
displaySize
,
null
);
this
(
name
,
type
,
precision
,
scale
,
displaySize
,
null
);
...
...
h2/src/main/org/h2/util/ColumnNamer.java
浏览文件 @
3d763b4a
...
@@ -35,15 +35,6 @@ public class ColumnNamer {
...
@@ -35,15 +35,6 @@ public class ColumnNamer {
}
}
}
}
/**
* Create a standardized column name that isn't null and doesn't have a CR/LF in it.
* @param expr the column expression
* @param indexOfColumn index of column in below array
*/
public
String
getColumnName
(
Expression
expr
,
int
indexOfColumn
)
{
return
getColumnName
(
expr
,
indexOfColumn
,
(
String
)
null
);
}
/**
/**
* Create a standardized column name that isn't null and doesn't have a CR/LF in it.
* Create a standardized column name that isn't null and doesn't have a CR/LF in it.
* @param columnExp the column expression
* @param columnExp the column expression
...
...
h2/src/main/org/h2/util/Task.java
浏览文件 @
3d763b4a
...
@@ -94,16 +94,6 @@ public abstract class Task implements Runnable {
...
@@ -94,16 +94,6 @@ public abstract class Task implements Runnable {
return
finished
;
return
finished
;
}
}
/**
* Interrupt the thread.
*/
public
void
interruptThread
()
{
if
(
thread
==
null
)
{
throw
new
IllegalStateException
(
"Thread not started"
);
}
thread
.
interrupt
();
}
/**
/**
* Get the exception that was thrown in the call (if any).
* Get the exception that was thrown in the call (if any).
*
*
...
...
h2/src/test/org/h2/test/utils/TestColumnNamer.java
浏览文件 @
3d763b4a
...
@@ -26,13 +26,12 @@ public class TestColumnNamer extends TestBase {
...
@@ -26,13 +26,12 @@ public class TestColumnNamer extends TestBase {
/**
/**
* Run just this test.
* Run just this test.
*
* @param a ignored
*/
*/
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
new
TestColumnNamer
().
test
();
new
TestColumnNamer
().
test
();
}
}
@Override
public
void
test
()
{
public
void
test
()
{
ColumnNamer
columnNamer
=
new
ColumnNamer
(
null
);
ColumnNamer
columnNamer
=
new
ColumnNamer
(
null
);
columnNamer
.
getConfiguration
().
configure
(
"MAX_IDENTIFIER_LENGTH = 30"
);
columnNamer
.
getConfiguration
().
configure
(
"MAX_IDENTIFIER_LENGTH = 30"
);
...
...
h2/src/tools/org/h2/build/doc/XMLParser.java
浏览文件 @
3d763b4a
...
@@ -394,21 +394,6 @@ public class XMLParser {
...
@@ -394,21 +394,6 @@ public class XMLParser {
return
eventType
;
return
eventType
;
}
}
/**
* Read the next start, end, or character tag. This method skips comments,
* DTDs, and processing instructions.
*
* @return the event type of the next tag
*/
public
int
nextTag
()
{
while
(
true
)
{
int
type
=
next
();
if
(
type
!=
COMMENT
&&
type
!=
DTD
&&
type
!=
PROCESSING_INSTRUCTION
)
{
return
type
;
}
}
}
/**
/**
* Get the event type of the current token.
* Get the event type of the current token.
*
*
...
@@ -465,46 +450,6 @@ public class XMLParser {
...
@@ -465,46 +450,6 @@ public class XMLParser {
return
attributeValues
[
index
*
3
+
1
];
return
attributeValues
[
index
*
3
+
1
];
}
}
/**
* Get the full name of the attribute. If there is no prefix, only the local
* name is returned, otherwise the prefix, ':', and the local name.
*
* @param index the index of the attribute (starting with 0)
* @return the full name
*/
public
String
getAttributeName
(
int
index
)
{
String
pre
=
getAttributePrefix
(
index
);
String
name
=
getAttributeLocalName
(
index
);
return
pre
==
null
||
pre
.
length
()
==
0
?
name
:
pre
+
":"
+
name
;
}
/**
* Get the value of this attribute.
*
* @param index the index of the attribute (starting with 0)
* @return the value
*/
public
String
getAttributeValue
(
int
index
)
{
return
attributeValues
[
index
*
3
+
2
];
}
/**
* Get the value of this attribute.
*
* @param namespaceURI the namespace URI (currently ignored)
* @param name the local name of the attribute
* @return the value or null
*/
public
String
getAttributeValue
(
@SuppressWarnings
(
"unused"
)
String
namespaceURI
,
String
name
)
{
int
len
=
getAttributeCount
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
getAttributeLocalName
(
i
).
equals
(
name
))
{
return
getAttributeValue
(
i
);
}
}
return
null
;
}
/**
/**
* Get the full name of the current start or end element. If there is no
* Get the full name of the current start or end element. If there is no
* prefix, only the local name is returned, otherwise the prefix, ':', and
* prefix, only the local name is returned, otherwise the prefix, ':', and
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论