Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7a9cbbb0
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7a9cbbb0
编写于
6月 15, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7041252: Use j.u.Objects.equals in security classes
Reviewed-by: weijun
上级
385f0890
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
27 deletion
+9
-27
src/share/classes/sun/security/tools/KeyTool.java
src/share/classes/sun/security/tools/KeyTool.java
+2
-6
src/share/classes/sun/security/x509/DistributionPoint.java
src/share/classes/sun/security/x509/DistributionPoint.java
+4
-11
src/share/classes/sun/security/x509/DistributionPointName.java
...hare/classes/sun/security/x509/DistributionPointName.java
+3
-10
未找到文件。
src/share/classes/sun/security/tools/KeyTool.java
浏览文件 @
7a9cbbb0
...
@@ -4193,15 +4193,11 @@ class Pair<A, B> {
...
@@ -4193,15 +4193,11 @@ class Pair<A, B> {
return
"Pair["
+
fst
+
","
+
snd
+
"]"
;
return
"Pair["
+
fst
+
","
+
snd
+
"]"
;
}
}
private
static
boolean
equals
(
Object
x
,
Object
y
)
{
return
(
x
==
null
&&
y
==
null
)
||
(
x
!=
null
&&
x
.
equals
(
y
));
}
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
other
)
{
return
return
other
instanceof
Pair
&&
other
instanceof
Pair
&&
equals
(
fst
,
((
Pair
)
other
).
fst
)
&&
Objects
.
equals
(
fst
,
((
Pair
)
other
).
fst
)
&&
equals
(
snd
,
((
Pair
)
other
).
snd
);
Objects
.
equals
(
snd
,
((
Pair
)
other
).
snd
);
}
}
public
int
hashCode
()
{
public
int
hashCode
()
{
...
...
src/share/classes/sun/security/x509/DistributionPoint.java
浏览文件 @
7a9cbbb0
/*
/*
* Copyright (c) 2002, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -318,13 +318,6 @@ public class DistributionPoint {
...
@@ -318,13 +318,6 @@ public class DistributionPoint {
out
.
write
(
DerValue
.
tag_Sequence
,
tagged
);
out
.
write
(
DerValue
.
tag_Sequence
,
tagged
);
}
}
/**
* Utility function for a.equals(b) where both a and b may be null.
*/
private
static
boolean
equals
(
Object
a
,
Object
b
)
{
return
(
a
==
null
)
?
(
b
==
null
)
:
a
.
equals
(
b
);
}
/**
/**
* Compare an object to this DistributionPoint for equality.
* Compare an object to this DistributionPoint for equality.
*
*
...
@@ -340,9 +333,9 @@ public class DistributionPoint {
...
@@ -340,9 +333,9 @@ public class DistributionPoint {
}
}
DistributionPoint
other
=
(
DistributionPoint
)
obj
;
DistributionPoint
other
=
(
DistributionPoint
)
obj
;
boolean
equal
=
equals
(
this
.
fullName
,
other
.
fullName
)
boolean
equal
=
Objects
.
equals
(
this
.
fullName
,
other
.
fullName
)
&&
equals
(
this
.
relativeName
,
other
.
relativeName
)
&&
Objects
.
equals
(
this
.
relativeName
,
other
.
relativeName
)
&&
equals
(
this
.
crlIssuer
,
other
.
crlIssuer
)
&&
Objects
.
equals
(
this
.
crlIssuer
,
other
.
crlIssuer
)
&&
Arrays
.
equals
(
this
.
reasonFlags
,
other
.
reasonFlags
);
&&
Arrays
.
equals
(
this
.
reasonFlags
,
other
.
reasonFlags
);
return
equal
;
return
equal
;
}
}
...
...
src/share/classes/sun/security/x509/DistributionPointName.java
浏览文件 @
7a9cbbb0
/*
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -201,8 +201,8 @@ public class DistributionPointName {
...
@@ -201,8 +201,8 @@ public class DistributionPointName {
}
}
DistributionPointName
other
=
(
DistributionPointName
)
obj
;
DistributionPointName
other
=
(
DistributionPointName
)
obj
;
return
equals
(
this
.
fullName
,
other
.
fullName
)
&&
return
Objects
.
equals
(
this
.
fullName
,
other
.
fullName
)
&&
equals
(
this
.
relativeName
,
other
.
relativeName
);
Objects
.
equals
(
this
.
relativeName
,
other
.
relativeName
);
}
}
/**
/**
...
@@ -239,11 +239,4 @@ public class DistributionPointName {
...
@@ -239,11 +239,4 @@ public class DistributionPointName {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
/*
* Utility function for a.equals(b) where both a and b may be null.
*/
private
static
boolean
equals
(
Object
a
,
Object
b
)
{
return
(
a
==
null
)
?
(
b
==
null
)
:
a
.
equals
(
b
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录