Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
85d035f6
Unverified
提交
85d035f6
authored
7 年前
作者:
Noel Grandin
提交者:
GitHub
7 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #814 from katzyn/java_specification
Method.isVarArgs() is available on all supported platforms
上级
4a8faf7b
d694061e
master
version-1.4.198
version-1.4.197
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
3 行增加
和
26 行删除
+3
-26
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+1
-24
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+2
-2
没有找到文件。
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
85d035f6
...
...
@@ -301,29 +301,6 @@ public class FunctionAlias extends SchemaObjectBase {
return
source
;
}
/**
* Checks if the given method takes a variable number of arguments. For Java
* 1.4 and older, false is returned. Example:
* <pre>
* public static double mean(double... values)
* </pre>
*
* @param m the method to test
* @return true if the method takes a variable number of arguments.
*/
static
boolean
isVarArgs
(
Method
m
)
{
if
(
"1.5"
.
compareTo
(
SysProperties
.
JAVA_SPECIFICATION_VERSION
)
>
0
)
{
return
false
;
}
try
{
Method
isVarArgs
=
m
.
getClass
().
getMethod
(
"isVarArgs"
);
Boolean
result
=
(
Boolean
)
isVarArgs
.
invoke
(
m
);
return
result
.
booleanValue
();
}
catch
(
Exception
e
)
{
return
false
;
}
}
/**
* Should the return value ResultSet be buffered in a local temporary file?
*
...
...
@@ -361,7 +338,7 @@ public class FunctionAlias extends SchemaObjectBase {
}
if
(
paramCount
>
0
)
{
Class
<?>
lastArg
=
paramClasses
[
paramClasses
.
length
-
1
];
if
(
lastArg
.
isArray
()
&&
FunctionAlias
.
isVarArgs
(
method
))
{
if
(
lastArg
.
isArray
()
&&
method
.
isVarArgs
(
))
{
varArgs
=
true
;
varArgClass
=
lastArg
.
getComponentType
();
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
85d035f6
...
...
@@ -58,10 +58,10 @@ public class SysProperties {
/**
* System property <code>java.specification.version</code>.<br />
* It is set by the system. Examples:
1.4, 1.5, 1.6
.
* It is set by the system. Examples:
0.9 (on Android), 1.7, 1.8, 9, 10
.
*/
public
static
final
String
JAVA_SPECIFICATION_VERSION
=
Utils
.
getProperty
(
"java.specification.version"
,
"1.
4
"
);
Utils
.
getProperty
(
"java.specification.version"
,
"1.
7
"
);
/**
* System property <code>line.separator</code> (default: \n).<br />
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论