Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1de3ffb3
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看板
提交
1de3ffb3
编写于
8月 04, 2011
作者:
M
mduigou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7073296: Executable.equalParamTypes() incorrectly returns true when the number of params differs.
Reviewed-by: alanb, darcy
上级
9f36164a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
66 addition
and
8 deletion
+66
-8
src/share/classes/java/lang/Class.java
src/share/classes/java/lang/Class.java
+2
-6
src/share/classes/java/lang/reflect/Executable.java
src/share/classes/java/lang/reflect/Executable.java
+4
-2
test/java/lang/reflect/Constructor/Equals.java
test/java/lang/reflect/Constructor/Equals.java
+60
-0
未找到文件。
src/share/classes/java/lang/Class.java
浏览文件 @
1de3ffb3
...
@@ -31,7 +31,6 @@ import java.lang.reflect.Member;
...
@@ -31,7 +31,6 @@ import java.lang.reflect.Member;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.GenericDeclaration
;
import
java.lang.reflect.Modifier
;
import
java.lang.reflect.Modifier
;
import
java.lang.reflect.Type
;
import
java.lang.reflect.Type
;
import
java.lang.reflect.TypeVariable
;
import
java.lang.reflect.TypeVariable
;
...
@@ -45,10 +44,7 @@ import java.util.ArrayList;
...
@@ -45,10 +44,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.LinkedList
;
import
java.util.LinkedHashSet
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -56,7 +52,6 @@ import sun.misc.Unsafe;
...
@@ -56,7 +52,6 @@ import sun.misc.Unsafe;
import
sun.reflect.ConstantPool
;
import
sun.reflect.ConstantPool
;
import
sun.reflect.Reflection
;
import
sun.reflect.Reflection
;
import
sun.reflect.ReflectionFactory
;
import
sun.reflect.ReflectionFactory
;
import
sun.reflect.SignatureIterator
;
import
sun.reflect.generics.factory.CoreReflectionFactory
;
import
sun.reflect.generics.factory.CoreReflectionFactory
;
import
sun.reflect.generics.factory.GenericsFactory
;
import
sun.reflect.generics.factory.GenericsFactory
;
import
sun.reflect.generics.repository.ClassRepository
;
import
sun.reflect.generics.repository.ClassRepository
;
...
@@ -2559,7 +2554,7 @@ public final
...
@@ -2559,7 +2554,7 @@ public final
// Start by fetching public declared methods
// Start by fetching public declared methods
MethodArray
methods
=
new
MethodArray
();
MethodArray
methods
=
new
MethodArray
();
{
{
Method
[]
tmp
=
privateGetDeclaredMethods
(
true
);
Method
[]
tmp
=
privateGetDeclaredMethods
(
true
);
methods
.
addAll
(
tmp
);
methods
.
addAll
(
tmp
);
}
}
// Now recur over superclass and direct superinterfaces.
// Now recur over superclass and direct superinterfaces.
...
@@ -2909,6 +2904,7 @@ public final
...
@@ -2909,6 +2904,7 @@ public final
return
null
;
return
null
;
}
}
// Doesn't use Boolean.getBoolean to avoid class init.
String
val
=
String
val
=
System
.
getProperty
(
"sun.reflect.noCaches"
);
System
.
getProperty
(
"sun.reflect.noCaches"
);
if
(
val
!=
null
&&
val
.
equals
(
"true"
))
{
if
(
val
!=
null
&&
val
.
equals
(
"true"
))
{
...
...
src/share/classes/java/lang/reflect/Executable.java
浏览文件 @
1de3ffb3
...
@@ -65,8 +65,9 @@ public abstract class Executable extends AccessibleObject
...
@@ -65,8 +65,9 @@ public abstract class Executable extends AccessibleObject
if
(
params1
[
i
]
!=
params2
[
i
])
if
(
params1
[
i
]
!=
params2
[
i
])
return
false
;
return
false
;
}
}
return
true
;
}
}
return
tru
e
;
return
fals
e
;
}
}
Annotation
[][]
parseParameterAnnotations
(
byte
[]
parameterAnnotations
)
{
Annotation
[][]
parseParameterAnnotations
(
byte
[]
parameterAnnotations
)
{
...
@@ -365,7 +366,8 @@ public abstract class Executable extends AccessibleObject
...
@@ -365,7 +366,8 @@ public abstract class Executable extends AccessibleObject
* {@inheritDoc}
* {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
*/
public
<
T
extends
Annotation
>
T
getAnnotation
(
Class
<
T
>
annotationClass
)
{
@SuppressWarnings
(
"unchecked"
)
public
<
T
extends
Annotation
>
T
getAnnotation
(
Class
<
T
>
annotationClass
)
{
if
(
annotationClass
==
null
)
if
(
annotationClass
==
null
)
throw
new
NullPointerException
();
throw
new
NullPointerException
();
...
...
test/java/lang/reflect/Constructor/Equals.java
0 → 100644
浏览文件 @
1de3ffb3
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7073296
* @summary Generic framework to test Constructor.equals.
*
* @compile Equals.java
* @run main Equals
*/
import
java.lang.reflect.*
;
public
class
Equals
{
public
Equals
(){}
public
Equals
(
Object
o
)
{
/* only for testing*/
}
public
Equals
(
int
i
)
{
/* only for testing */
}
public
Equals
m
()
{
return
this
;
}
public
static
void
main
(
String
[]
args
)
{
Equals
e
=
new
Equals
();
e
.
equalConstructors
();
}
public
void
equalConstructors
()
{
Constructor
<?>[]
constructors
=
Equals
.
class
.
getDeclaredConstructors
();
for
(
Constructor
<?>
ctor1
:
constructors
)
{
for
(
Constructor
<?>
ctor2
:
constructors
)
{
boolean
expected
=
(
ctor1
==
ctor2
);
if
(
ctor1
.
equals
(
ctor2
)
!=
expected
)
throw
new
RuntimeException
(
"Constructors '"
+
ctor1
+
"'("
+
System
.
identityHashCode
(
ctor1
)
+
") "
+
(
expected
?
"!="
:
"=="
)
+
" '"
+
ctor2
+
"'("
+
System
.
identityHashCode
(
ctor2
)
+
")"
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录