Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
30dbb194
提交
30dbb194
authored
5月 20, 2016
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting and Javadocs
上级
11c11898
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
810 行增加
和
832 行删除
+810
-832
help.csv
h2/src/main/org/h2/res/help.csv
+4
-0
TestAllJunit.java
h2/src/test/org/h2/test/TestAllJunit.java
+4
-1
TestConnection.java
h2/src/test/org/h2/test/jdbc/TestConnection.java
+7
-5
CalculateHashConstantLong.java
h2/src/test/org/h2/test/store/CalculateHashConstantLong.java
+1
-1
testScript.sql
h2/src/test/org/h2/test/testScript.sql
+6
-6
TestMode.java
h2/src/test/org/h2/test/unit/TestMode.java
+21
-13
TestNetUtils.java
h2/src/test/org/h2/test/unit/TestNetUtils.java
+14
-4
TestSecurity.java
h2/src/test/org/h2/test/unit/TestSecurity.java
+4
-4
TestTimeStampWithTimeZone.java
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
+1
-1
TestValueMemory.java
h2/src/test/org/h2/test/unit/TestValueMemory.java
+1
-1
H2Platform.java.txt
.../toplink/essentials/platform/database/H2Platform.java.txt
+1
-1
Build.java
h2/src/tools/org/h2/build/Build.java
+2
-1
CheckJavadoc.java
h2/src/tools/org/h2/build/code/CheckJavadoc.java
+11
-8
SpellChecker.java
h2/src/tools/org/h2/build/doc/SpellChecker.java
+12
-4
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+721
-782
没有找到文件。
h2/src/main/org/h2/res/help.csv
浏览文件 @
30dbb194
...
@@ -92,6 +92,10 @@ Adds a new column to a table."
...
@@ -92,6 +92,10 @@ Adds a new column to a table."
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
","
","
Adds a constraint to a table."
Adds a constraint to a table."
"Commands (DDL)","ALTER TABLE RENAME CONSTRAINT","
ALTER TABLE tableName RENAME oldConstraintName TO newConstraintName
","
Renames a constraint."
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName
ALTER TABLE tableName ALTER COLUMN columnName
{ { dataType [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
{ { dataType [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
...
...
h2/src/test/org/h2/test/TestAllJunit.java
浏览文件 @
30dbb194
...
@@ -13,6 +13,9 @@ import org.junit.Test;
...
@@ -13,6 +13,9 @@ import org.junit.Test;
*/
*/
public
class
TestAllJunit
{
public
class
TestAllJunit
{
/**
* Run all the fast tests.
*/
@Test
@Test
public
void
testFast
()
throws
Exception
{
public
void
testFast
()
throws
Exception
{
TestAll
.
main
(
"fast"
);
TestAll
.
main
(
"fast"
);
...
...
h2/src/test/org/h2/test/jdbc/TestConnection.java
浏览文件 @
30dbb194
...
@@ -37,7 +37,8 @@ public class TestConnection extends TestBase {
...
@@ -37,7 +37,8 @@ public class TestConnection extends TestBase {
}
}
private
void
testSetInternalProperty
()
throws
SQLException
{
private
void
testSetInternalProperty
()
throws
SQLException
{
// Use MySQL-mode since this allows all property names (apart from h2 internal names).
// Use MySQL-mode since this allows all property names
// (apart from h2 internal names).
Connection
conn
=
getConnection
(
"clientInfoMySQL;MODE=MySQL"
);
Connection
conn
=
getConnection
(
"clientInfoMySQL;MODE=MySQL"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"numServers"
,
"SomeValue"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"numServers"
,
"SomeValue"
);
...
@@ -48,7 +49,7 @@ public class TestConnection extends TestBase {
...
@@ -48,7 +49,7 @@ public class TestConnection extends TestBase {
Connection
conn
=
getConnection
(
"clientInfo"
);
Connection
conn
=
getConnection
(
"clientInfo"
);
Properties
properties
=
new
Properties
();
Properties
properties
=
new
Properties
();
properties
.
put
(
"ClientUser"
,
"some
u
ser"
);
properties
.
put
(
"ClientUser"
,
"some
U
ser"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
properties
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
properties
);
}
}
...
@@ -58,12 +59,12 @@ public class TestConnection extends TestBase {
...
@@ -58,12 +59,12 @@ public class TestConnection extends TestBase {
conn
.
setClientInfo
(
"ApplicationName"
,
"Connection Test"
);
conn
.
setClientInfo
(
"ApplicationName"
,
"Connection Test"
);
Properties
properties
=
new
Properties
();
Properties
properties
=
new
Properties
();
properties
.
put
(
"ClientUser"
,
"some
u
ser"
);
properties
.
put
(
"ClientUser"
,
"some
U
ser"
);
conn
.
setClientInfo
(
properties
);
conn
.
setClientInfo
(
properties
);
// old property should have been removed
// old property should have been removed
assertNull
(
conn
.
getClientInfo
(
"ApplicationName"
));
assertNull
(
conn
.
getClientInfo
(
"ApplicationName"
));
// new property has been set
// new property has been set
assertEquals
(
conn
.
getClientInfo
(
"ClientUser"
),
"some
u
ser"
);
assertEquals
(
conn
.
getClientInfo
(
"ClientUser"
),
"some
U
ser"
);
}
}
private
void
testSetSupportedClientInfo
()
throws
SQLException
{
private
void
testSetSupportedClientInfo
()
throws
SQLException
{
...
@@ -75,7 +76,8 @@ public class TestConnection extends TestBase {
...
@@ -75,7 +76,8 @@ public class TestConnection extends TestBase {
private
void
testSetUnsupportedClientInfo
()
throws
SQLException
{
private
void
testSetUnsupportedClientInfo
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"clientInfoDB2;MODE=DB2"
);
Connection
conn
=
getConnection
(
"clientInfoDB2;MODE=DB2"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"UnsupportedName"
,
"SomeValue"
);
assertThrows
(
SQLClientInfoException
.
class
,
conn
).
setClientInfo
(
"UnsupportedName"
,
"SomeValue"
);
}
}
private
void
testGetUnsupportedClientInfo
()
throws
SQLException
{
private
void
testGetUnsupportedClientInfo
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/store/CalculateHashConstantLong.java
浏览文件 @
30dbb194
...
@@ -132,7 +132,7 @@ public class CalculateHashConstantLong implements Runnable {
...
@@ -132,7 +132,7 @@ public class CalculateHashConstantLong implements Runnable {
System
.
out
.
println
(
"Collisions: "
+
collisions
);
System
.
out
.
println
(
"Collisions: "
+
collisions
);
}
}
static
void
printQuality
(
CalculateHashConstantLong
test
,
long
[]
randomValues
)
{
private
static
void
printQuality
(
CalculateHashConstantLong
test
,
long
[]
randomValues
)
{
int
finalCount
=
randomValues
.
length
*
10
;
int
finalCount
=
randomValues
.
length
*
10
;
System
.
out
.
println
(
"Quality of "
+
test
);
System
.
out
.
println
(
"Quality of "
+
test
);
int
[]
minMax
;
int
[]
minMax
;
...
...
h2/src/test/org/h2/test/testScript.sql
浏览文件 @
30dbb194
h2/src/test/org/h2/test/unit/TestMode.java
浏览文件 @
30dbb194
...
@@ -36,12 +36,17 @@ public class TestMode extends TestBase {
...
@@ -36,12 +36,17 @@ public class TestMode extends TestBase {
private
void
testDb2ClientInfo
()
{
private
void
testDb2ClientInfo
()
{
Mode
db2Mode
=
Mode
.
getInstance
(
"DB2"
);
Mode
db2Mode
=
Mode
.
getInstance
(
"DB2"
);
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientAccountingInformation"
).
matches
());
"ApplicationName"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientUser"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientCorrelationToken"
).
matches
());
"ClientAccountingInformation"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertFalse
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
"ClientUser"
).
matches
());
assertTrue
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ClientCorrelationToken"
).
matches
());
assertFalse
(
db2Mode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
}
}
private
void
testDerbyClientInfo
()
{
private
void
testDerbyClientInfo
()
{
...
@@ -61,22 +66,25 @@ public class TestMode extends TestBase {
...
@@ -61,22 +66,25 @@ public class TestMode extends TestBase {
private
void
testMySqlClientInfo
()
{
private
void
testMySqlClientInfo
()
{
Mode
mySqlMode
=
Mode
.
getInstance
(
"MySQL"
);
Mode
mySqlMode
=
Mode
.
getInstance
(
"MySQL"
);
assertTrue
(
mySqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyString"
).
matches
());
assertTrue
(
mySqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyString"
).
matches
());
}
}
private
void
testOracleClientInfo
()
{
private
void
testOracleClientInfo
()
{
Mode
oracleMode
=
Mode
.
getInstance
(
"Oracle"
);
Mode
oracleMode
=
Mode
.
getInstance
(
"Oracle"
);
assertTrue
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContaining.aDot"
).
matches
());
assertTrue
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertFalse
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContainingNoDot"
).
matches
());
"anythingContaining.aDot"
).
matches
());
assertFalse
(
oracleMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"anythingContainingNoDot"
).
matches
());
}
}
private
void
testPostgresqlClientInfo
()
{
private
void
testPostgresqlClientInfo
()
{
Mode
postgresqlMode
=
Mode
.
getInstance
(
"PostgreSQL"
);
Mode
postgresqlMode
=
Mode
.
getInstance
(
"PostgreSQL"
);
assertTrue
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertTrue
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"ApplicationName"
).
matches
());
"ApplicationName"
).
matches
());
assertFalse
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
assertFalse
(
postgresqlMode
.
supportedClientInfoPropertiesRegEx
.
matcher
(
"AnyOtherValue"
).
matches
());
"AnyOtherValue"
).
matches
());
}
}
}
}
h2/src/test/org/h2/test/unit/TestNetUtils.java
浏览文件 @
30dbb194
...
@@ -155,7 +155,12 @@ public class TestNetUtils extends TestBase {
...
@@ -155,7 +155,12 @@ public class TestNetUtils extends TestBase {
return
task
;
return
task
;
}
}
private
void
closeSilently
(
Socket
socket
)
{
/**
* Close a socket, ignoring errors
*
* @param socket the socket
*/
void
closeSilently
(
Socket
socket
)
{
try
{
try
{
socket
.
close
();
socket
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -163,7 +168,12 @@ public class TestNetUtils extends TestBase {
...
@@ -163,7 +168,12 @@ public class TestNetUtils extends TestBase {
}
}
}
}
private
void
closeSilently
(
ServerSocket
socket
)
{
/**
* Close a server socket, ignoring errors
*
* @param socket the server socket
*/
void
closeSilently
(
ServerSocket
socket
)
{
try
{
try
{
socket
.
close
();
socket
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
h2/src/test/org/h2/test/unit/TestSecurity.java
浏览文件 @
30dbb194
...
@@ -36,7 +36,7 @@ public class TestSecurity extends TestBase {
...
@@ -36,7 +36,7 @@ public class TestSecurity extends TestBase {
testSHA
();
testSHA
();
testAES
();
testAES
();
testBlockCiphers
();
testBlockCiphers
();
testRemoveAnonFromLegacyAlgos
();
testRemoveAnonFromLegacyAlgo
rithm
s
();
//testResetLegacyAlgos();
//testResetLegacyAlgos();
}
}
...
@@ -254,7 +254,7 @@ public class TestSecurity extends TestBase {
...
@@ -254,7 +254,7 @@ public class TestSecurity extends TestBase {
return
len
*
r
<
len
*
120
;
return
len
*
r
<
len
*
120
;
}
}
private
void
testRemoveAnonFromLegacyAlgos
()
{
private
void
testRemoveAnonFromLegacyAlgo
rithm
s
()
{
String
legacyAlgos
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
String
legacyAlgos
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT"
+
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT"
+
", DH_anon, ECDH_anon, RC4_128, RC4_40, DES_CBC, DES40_CBC"
;
", DH_anon, ECDH_anon, RC4_128, RC4_40, DES_CBC, DES40_CBC"
;
...
@@ -282,13 +282,13 @@ public class TestSecurity extends TestBase {
...
@@ -282,13 +282,13 @@ public class TestSecurity extends TestBase {
*/
*/
@SuppressWarnings
(
"unused"
)
@SuppressWarnings
(
"unused"
)
private
void
testResetLegacyAlgos
()
{
private
void
testResetLegacyAlgos
()
{
String
legacyAlgorithmsBefore
=
CipherFactory
.
getLegacyAlgoritmsSilently
();
String
legacyAlgorithmsBefore
=
CipherFactory
.
getLegacyAlgorit
h
msSilently
();
assertEquals
(
"Failed assumption: jdk.tls.legacyAlgorithms"
+
assertEquals
(
"Failed assumption: jdk.tls.legacyAlgorithms"
+
" has been modified from its initial setting"
,
" has been modified from its initial setting"
,
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsBefore
);
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsBefore
);
CipherFactory
.
removeAnonFromLegacyAlgorithms
();
CipherFactory
.
removeAnonFromLegacyAlgorithms
();
CipherFactory
.
resetDefaultLegacyAlgorithms
();
CipherFactory
.
resetDefaultLegacyAlgorithms
();
String
legacyAlgorithmsAfter
=
CipherFactory
.
getLegacyAlgoritmsSilently
();
String
legacyAlgorithmsAfter
=
CipherFactory
.
getLegacyAlgorit
h
msSilently
();
assertEquals
(
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsAfter
);
assertEquals
(
CipherFactory
.
DEFAULT_LEGACY_ALGORITHMS
,
legacyAlgorithmsAfter
);
}
}
...
...
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
浏览文件 @
30dbb194
...
@@ -39,7 +39,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
...
@@ -39,7 +39,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
stat
.
execute
(
"insert into test(t1) values('1970-01-01 12:00:00.00+00:15')"
);
stat
.
execute
(
"insert into test(t1) values('1970-01-01 12:00:00.00+00:15')"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select t1 from test"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select t1 from test"
);
rs
.
next
();
rs
.
next
();
assertTrue
(
new
TimestampWithTimeZone
(
36000000
,
00
,
(
short
)
15
).
equals
(
rs
.
getTimestamp
(
1
)));
assertTrue
(
new
TimestampWithTimeZone
(
36000000
,
00
,
(
short
)
15
).
equals
(
rs
.
getTimestamp
(
1
)));
conn
.
close
();
conn
.
close
();
}
}
...
...
h2/src/test/org/h2/test/unit/TestValueMemory.java
浏览文件 @
30dbb194
...
@@ -167,7 +167,7 @@ public class TestValueMemory extends TestBase implements DataHandler {
...
@@ -167,7 +167,7 @@ public class TestValueMemory extends TestBase implements DataHandler {
case
Value
.
TIMESTAMP_UTC
:
case
Value
.
TIMESTAMP_UTC
:
return
ValueTimestampUtc
.
fromMillis
(
random
.
nextLong
());
return
ValueTimestampUtc
.
fromMillis
(
random
.
nextLong
());
case
Value
.
TIMESTAMP_TZ
:
case
Value
.
TIMESTAMP_TZ
:
return
ValueTimestampTimeZone
.
fromMillis
(
random
.
nextLong
(),
(
short
)
0
);
return
ValueTimestampTimeZone
.
fromMillis
(
random
.
nextLong
(),
(
short
)
0
);
case
Value
.
BYTES
:
case
Value
.
BYTES
:
return
ValueBytes
.
get
(
randomBytes
(
random
.
nextInt
(
1000
)));
return
ValueBytes
.
get
(
randomBytes
(
random
.
nextInt
(
1000
)));
case
Value
.
STRING
:
case
Value
.
STRING
:
...
...
h2/src/tools/oracle/toplink/essentials/platform/database/H2Platform.java.txt
浏览文件 @
30dbb194
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* You can obtain a copy of the license at
* You can obtain a copy of the license at
* glassfish/bootstrap/legal/CDDLv1.0.txt or
* glassfish/bootstrap/legal/CDDLv1.0.txt or
* https://glassfish.dev.java.net/public/CDDLv1.0.html.
* https://glassfish.dev.java.net/public/CDDLv1.0.html
.
* See the License for the specific language governing
* See the License for the specific language governing
* permissions and limitations under the License.
* permissions and limitations under the License.
*
*
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
30dbb194
...
@@ -238,7 +238,8 @@ public class Build extends BuildBase {
...
@@ -238,7 +238,8 @@ public class Build extends BuildBase {
if
(!
clientOnly
)
{
if
(!
clientOnly
)
{
files
=
files
(
"src/test"
);
files
=
files
(
"src/test"
);
files
.
addAll
(
files
(
"src/tools"
));
files
.
addAll
(
files
(
"src/tools"
));
files
=
files
.
exclude
(
"src/test/org/h2/test/TestAllJunit.java"
);
//we don't use Junit for this test framework
//we don't use Junit for this test framework
files
=
files
.
exclude
(
"src/test/org/h2/test/TestAllJunit.java"
);
args
=
args
(
"-Xlint:unchecked"
,
"-Xlint:deprecation"
,
args
=
args
(
"-Xlint:unchecked"
,
"-Xlint:deprecation"
,
"-d"
,
"temp"
,
"-sourcepath"
,
"src/test"
+
File
.
pathSeparator
+
"src/tools"
,
"-d"
,
"temp"
,
"-sourcepath"
,
"src/test"
+
File
.
pathSeparator
+
"src/tools"
,
"-classpath"
,
classpath
);
"-classpath"
,
classpath
);
...
...
h2/src/tools/org/h2/build/code/CheckJavadoc.java
浏览文件 @
30dbb194
...
@@ -99,8 +99,9 @@ public class CheckJavadoc {
...
@@ -99,8 +99,9 @@ public class CheckJavadoc {
}
}
if
(
inComment
)
{
if
(
inComment
)
{
if
(
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
if
(
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
&&
!
line
.
trim
().
startsWith
(
"* http://"
))
{
&&
!
line
.
trim
().
startsWith
(
"* http://"
)
System
.
out
.
println
(
"Long line : "
+
file
.
getAbsolutePath
()
&&
!
line
.
trim
().
startsWith
(
"* https://"
))
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
errorCount
++;
errorCount
++;
}
}
...
@@ -108,12 +109,14 @@ public class CheckJavadoc {
...
@@ -108,12 +109,14 @@ public class CheckJavadoc {
inComment
=
false
;
inComment
=
false
;
}
}
}
}
if
(!
inComment
&&
line
.
startsWith
(
"//"
)
if
(!
inComment
&&
line
.
startsWith
(
"//"
))
{
&&
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
if
(
rawLine
.
length
()
>
MAX_COMMENT_LINE_SIZE
&&
!
line
.
trim
().
startsWith
(
"// http://"
))
{
&&
!
line
.
trim
().
startsWith
(
"// http://"
)
&&
!
line
.
trim
().
startsWith
(
"// https://"
))
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
errorCount
++;
errorCount
++;
}
}
else
if
(!
inComment
&&
rawLine
.
length
()
>
MAX_SOURCE_LINE_SIZE
)
{
}
else
if
(!
inComment
&&
rawLine
.
length
()
>
MAX_SOURCE_LINE_SIZE
)
{
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
System
.
out
.
println
(
"Long line: "
+
file
.
getAbsolutePath
()
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
+
" ("
+
file
.
getName
()
+
":"
+
lineNumber
+
")"
);
...
...
h2/src/tools/org/h2/build/doc/SpellChecker.java
浏览文件 @
30dbb194
...
@@ -11,6 +11,8 @@ import java.util.Arrays;
...
@@ -11,6 +11,8 @@ import java.util.Arrays;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.StringTokenizer
;
import
java.util.StringTokenizer
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.h2.build.BuildBase
;
import
org.h2.build.BuildBase
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
...
@@ -72,6 +74,11 @@ public class SpellChecker {
...
@@ -72,6 +74,11 @@ public class SpellChecker {
private
void
run
(
String
dictionaryFileName
,
String
dir
)
throws
IOException
{
private
void
run
(
String
dictionaryFileName
,
String
dir
)
throws
IOException
{
process
(
new
File
(
dictionaryFileName
));
process
(
new
File
(
dictionaryFileName
));
process
(
new
File
(
dir
));
process
(
new
File
(
dir
));
HashSet
<
String
>
unused
=
new
HashSet
<
String
>();
unused
.
addAll
(
dictionary
);
unused
.
removeAll
(
used
);
// System.out.println("UNUSED WORDS");
// System.out.println(unused);
if
(
printDictionary
)
{
if
(
printDictionary
)
{
System
.
out
.
println
(
"USED WORDS"
);
System
.
out
.
println
(
"USED WORDS"
);
String
[]
list
=
new
String
[
used
.
size
()];
String
[]
list
=
new
String
[
used
.
size
()];
...
@@ -190,19 +197,20 @@ public class SpellChecker {
...
@@ -190,19 +197,20 @@ public class SpellChecker {
}
}
private
String
removeLinks
(
String
fileName
,
String
text
)
{
private
String
removeLinks
(
String
fileName
,
String
text
)
{
Pattern
linkPattern
=
Pattern
.
compile
(
"http[s]?://"
);
StringBuilder
buff
=
new
StringBuilder
(
text
.
length
());
StringBuilder
buff
=
new
StringBuilder
(
text
.
length
());
int
pos
=
0
,
last
=
0
;
int
pos
=
0
,
last
=
0
;
if
(
fileName
.
endsWith
(
".properties"
))
{
if
(
fileName
.
endsWith
(
".properties"
))
{
text
=
StringUtils
.
replaceAll
(
text
,
"\\:"
,
":"
);
text
=
StringUtils
.
replaceAll
(
text
,
"\\:"
,
":"
);
}
}
while
(
true
)
{
while
(
true
)
{
pos
=
text
.
indexOf
(
"http://"
,
pos
);
Matcher
m
=
linkPattern
.
matcher
(
text
.
substring
(
pos
)
);
if
(
pos
<
0
)
{
if
(
!
m
.
find
()
)
{
break
;
break
;
}
}
int
start
=
pos
;
int
start
=
m
.
start
()
+
pos
;
pos
=
m
.
end
()
+
pos
;
buff
.
append
(
text
.
substring
(
last
,
start
));
buff
.
append
(
text
.
substring
(
last
,
start
));
pos
+=
"http://"
.
length
();
while
(
true
)
{
while
(
true
)
{
char
c
=
text
.
charAt
(
pos
);
char
c
=
text
.
charAt
(
pos
);
if
(!
Character
.
isJavaIdentifierPart
(
c
)
&&
if
(!
Character
.
isJavaIdentifierPart
(
c
)
&&
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
30dbb194
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论