Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
76bb966b
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76bb966b
编写于
1月 15, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed Commons Lang references
上级
8da9e546
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
40 deletion
+24
-40
spring-core/src/main/java/org/springframework/util/ClassUtils.java
...re/src/main/java/org/springframework/util/ClassUtils.java
+2
-4
spring-core/src/main/java/org/springframework/util/ObjectUtils.java
...e/src/main/java/org/springframework/util/ObjectUtils.java
+22
-36
未找到文件。
spring-core/src/main/java/org/springframework/util/ClassUtils.java
浏览文件 @
76bb966b
...
...
@@ -34,10 +34,8 @@ import java.util.Map;
import
java.util.Set
;
/**
* Miscellaneous class utility methods. Mainly for internal use within the
* framework; consider
* <a href="http://commons.apache.org/lang/" target="_blank">Apache Commons Lang</a>
* for a more comprehensive suite of class utilities.
* Miscellaneous class utility methods.
* Mainly for internal use within the framework.
*
* @author Juergen Hoeller
* @author Keith Donald
...
...
spring-core/src/main/java/org/springframework/util/ObjectUtils.java
浏览文件 @
76bb966b
...
...
@@ -21,10 +21,7 @@ import java.util.Arrays;
/**
* Miscellaneous object utility methods.
*
* <p>Mainly for internal use within the framework; consider
* <a href="http://jakarta.apache.org/commons/lang/">Jakarta's Commons Lang</a>
* for a more comprehensive suite of object utilities.
* Mainly for internal use within the framework.
*
* <p>Thanks to Alex Ruiz for contributing several enhancements to this class!
*
...
...
@@ -34,7 +31,6 @@ import java.util.Arrays;
* @author Rob Harrop
* @author Chris Beams
* @since 19.03.2004
* @see org.apache.commons.lang.ObjectUtils
*/
public
abstract
class
ObjectUtils
{
...
...
@@ -177,7 +173,7 @@ public abstract class ObjectUtils {
* @param obj the object to append
* @return the new array (of the same component type; never {@code null})
*/
public
static
<
A
,
O
extends
A
>
A
[]
addObjectToArray
(
A
[]
array
,
O
obj
)
{
public
static
<
A
,
O
extends
A
>
A
[]
addObjectToArray
(
A
[]
array
,
O
obj
)
{
Class
<?>
compType
=
Object
.
class
;
if
(
array
!=
null
)
{
compType
=
array
.
getClass
().
getComponentType
();
...
...
@@ -345,9 +341,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
nullSafeHashCode
(
array
[
i
]);
for
(
Object
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
nullSafeHashCode
(
element
);
}
return
hash
;
}
...
...
@@ -361,9 +356,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
array
[
i
]);
for
(
boolean
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
element
);
}
return
hash
;
}
...
...
@@ -377,9 +371,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
array
[
i
];
for
(
byte
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
element
;
}
return
hash
;
}
...
...
@@ -393,9 +386,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
array
[
i
];
for
(
char
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
element
;
}
return
hash
;
}
...
...
@@ -409,9 +401,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
array
[
i
]);
for
(
double
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
element
);
}
return
hash
;
}
...
...
@@ -425,9 +416,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
array
[
i
]);
for
(
float
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
element
);
}
return
hash
;
}
...
...
@@ -441,9 +431,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
array
[
i
];
for
(
int
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
element
;
}
return
hash
;
}
...
...
@@ -457,9 +446,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
array
[
i
]);
for
(
long
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
hashCode
(
element
);
}
return
hash
;
}
...
...
@@ -473,9 +461,8 @@ public abstract class ObjectUtils {
return
0
;
}
int
hash
=
INITIAL_HASH
;
int
arraySize
=
array
.
length
;
for
(
int
i
=
0
;
i
<
arraySize
;
i
++)
{
hash
=
MULTIPLIER
*
hash
+
array
[
i
];
for
(
short
element
:
array
)
{
hash
=
MULTIPLIER
*
hash
+
element
;
}
return
hash
;
}
...
...
@@ -485,7 +472,7 @@ public abstract class ObjectUtils {
* @see Boolean#hashCode()
*/
public
static
int
hashCode
(
boolean
bool
)
{
return
bool
?
1231
:
1237
;
return
(
bool
?
1231
:
1237
)
;
}
/**
...
...
@@ -493,8 +480,7 @@ public abstract class ObjectUtils {
* @see Double#hashCode()
*/
public
static
int
hashCode
(
double
dbl
)
{
long
bits
=
Double
.
doubleToLongBits
(
dbl
);
return
hashCode
(
bits
);
return
hashCode
(
Double
.
doubleToLongBits
(
dbl
));
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录