Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2f520223
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看板
提交
2f520223
编写于
2月 11, 2013
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8007405: Update java.lang.reflect API to replace SYNTHESIZED with MANDATED
Reviewed-by: darcy
上级
c2372510
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
20 deletion
+42
-20
src/share/classes/java/lang/reflect/Executable.java
src/share/classes/java/lang/reflect/Executable.java
+4
-0
src/share/classes/java/lang/reflect/Modifier.java
src/share/classes/java/lang/reflect/Modifier.java
+3
-3
src/share/classes/java/lang/reflect/Parameter.java
src/share/classes/java/lang/reflect/Parameter.java
+35
-17
未找到文件。
src/share/classes/java/lang/reflect/Executable.java
浏览文件 @
2f520223
...
...
@@ -278,6 +278,10 @@ public abstract class Executable extends AccessibleObject
* this object. Returns an array of length 0 if the executable
* has no parameters.
*
* The parameters of the underlying executable do not necessarily
* have unique names, or names that are legal identifiers in the
* Java programming language (JLS 3.8).
*
* @return an array of {@code Parameter} objects representing all
* the parameters to the executable this object represents
*/
...
...
src/share/classes/java/lang/reflect/Modifier.java
浏览文件 @
2f520223
...
...
@@ -342,13 +342,13 @@ class Modifier {
static
final
int
SYNTHETIC
=
0x00001000
;
static
final
int
ANNOTATION
=
0x00002000
;
static
final
int
ENUM
=
0x00004000
;
static
final
int
SYNTHESIZED
=
0x00010
000
;
static
final
int
MANDATED
=
0x00008
000
;
static
boolean
isSynthetic
(
int
mod
)
{
return
(
mod
&
SYNTHETIC
)
!=
0
;
}
static
boolean
is
Synthesiz
ed
(
int
mod
)
{
return
(
mod
&
SYNTHESIZ
ED
)
!=
0
;
static
boolean
is
Mandat
ed
(
int
mod
)
{
return
(
mod
&
MANDAT
ED
)
!=
0
;
}
/**
...
...
src/share/classes/java/lang/reflect/Parameter.java
浏览文件 @
2f520223
...
...
@@ -44,7 +44,7 @@ public final class Parameter implements AnnotatedElement {
private
final
String
name
;
private
final
int
modifiers
;
private
final
Executable
executable
;
private
int
index
;
private
final
int
index
;
/**
* Package-private constructor for {@code Parameter}.
...
...
@@ -95,9 +95,14 @@ public final class Parameter implements AnnotatedElement {
}
/**
* Returns a string representation of the parameter's modifiers,
* its attributes, its type, its name, and a trailing ... if it is
* a variadic parameter.
* Returns a string describing this parameter. The format is the
* modifiers for the parameter, if any, in canonical order as
* recommended by <cite>The Java™ Language
* Specification</cite>, followed by the fully- qualified type of
* the parameter (excluding the last [] if the parameter is
* variable arity), followed by "..." if the parameter is variable
* arity, followed by a space, followed by the name of the
* parameter.
*
* @return A string representation of the parameter and associated
* information.
...
...
@@ -118,7 +123,7 @@ public final class Parameter implements AnnotatedElement {
sb
.
append
(
typename
);
sb
.
append
(
" "
);
sb
.
append
(
name
);
sb
.
append
(
getName
()
);
return
sb
.
toString
();
}
...
...
@@ -143,11 +148,23 @@ public final class Parameter implements AnnotatedElement {
}
/**
* Returns the name of the parameter represented by this
* {@code Parameter} object.
* Returns the name of the parameter. The names of the parameters
* of a single executable must all the be distinct. When names
* from the originating source are available, they are returned.
* Otherwise, an implementation of this method is free to create a
* name of this parameter, subject to the unquiness requirments.
*/
public
String
getName
()
{
return
name
;
// As per the spec, if a parameter has no name, return argX,
// where x is the index.
//
// Note: spec updates now outlaw empty strings as parameter
// names. The .equals("") is for compatibility with current
// JVM behavior. It may be removed at some point.
if
(
name
==
null
||
name
.
equals
(
""
))
return
"arg"
+
index
;
else
return
name
;
}
/**
...
...
@@ -190,20 +207,21 @@ public final class Parameter implements AnnotatedElement {
private
transient
volatile
Class
<?>
parameterClassCache
=
null
;
/**
* Returns {@code true} if this parameter is
a synthesiz
ed
*
construct
; returns {@code false} otherwise.
* Returns {@code true} if this parameter is
implicitly declar
ed
*
in source code
; returns {@code false} otherwise.
*
* @return true if and only if this parameter is
a synthesized
*
construct as defined by
*
<cite>The Java™ Language
Specification</cite>.
* @return true if and only if this parameter is
implicitly
*
declared as defined by <cite>The Java™ Language
* Specification</cite>.
*/
public
boolean
is
Synthesized
()
{
return
Modifier
.
is
Synthesiz
ed
(
getModifiers
());
public
boolean
is
Implicit
()
{
return
Modifier
.
is
Mandat
ed
(
getModifiers
());
}
/**
* Returns {@code true} if this parameter is a synthetic
* construct; returns {@code false} otherwise.
* Returns {@code true} if this parameter is neither implicitly
* nor explicitly declared in source code; returns {@code false}
* otherwise.
*
* @jls 13.1 The Form of a Binary
* @return true if and only if this parameter is a synthetic
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录