Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
12bf35d7
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看板
提交
12bf35d7
编写于
2月 04, 2013
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8007113: Upgrade AnnotatedElement.isAnnotionPresent to be a default method
Reviewed-by: chegar, jfranck
上级
2f47435a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
7 addition
and
47 deletion
+7
-47
src/share/classes/java/lang/Class.java
src/share/classes/java/lang/Class.java
+0
-10
src/share/classes/java/lang/Package.java
src/share/classes/java/lang/Package.java
+1
-10
src/share/classes/java/lang/reflect/AccessibleObject.java
src/share/classes/java/lang/reflect/AccessibleObject.java
+0
-8
src/share/classes/java/lang/reflect/AnnotatedElement.java
src/share/classes/java/lang/reflect/AnnotatedElement.java
+6
-1
src/share/classes/java/lang/reflect/Parameter.java
src/share/classes/java/lang/reflect/Parameter.java
+0
-8
src/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java
.../classes/sun/reflect/annotation/AnnotatedTypeFactory.java
+0
-5
src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
.../reflect/generics/reflectiveObjects/TypeVariableImpl.java
+0
-5
未找到文件。
src/share/classes/java/lang/Class.java
浏览文件 @
12bf35d7
...
@@ -3083,16 +3083,6 @@ public final
...
@@ -3083,16 +3083,6 @@ public final
return
(
A
)
annotations
.
get
(
annotationClass
);
return
(
A
)
annotations
.
get
(
annotationClass
);
}
}
/**
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
public
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
Objects
.
requireNonNull
(
annotationClass
);
return
getAnnotation
(
annotationClass
)
!=
null
;
}
/**
/**
* @throws NullPointerException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
* @since 1.8
* @since 1.8
...
...
src/share/classes/java/lang/Package.java
浏览文件 @
12bf35d7
/*
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
@@ -385,15 +385,6 @@ public class Package implements java.lang.reflect.AnnotatedElement {
...
@@ -385,15 +385,6 @@ public class Package implements java.lang.reflect.AnnotatedElement {
return
getPackageInfo
().
getAnnotation
(
annotationClass
);
return
getPackageInfo
().
getAnnotation
(
annotationClass
);
}
}
/**
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
public
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getPackageInfo
().
isAnnotationPresent
(
annotationClass
);
}
/**
/**
* @throws NullPointerException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
* @since 1.8
* @since 1.8
...
...
src/share/classes/java/lang/reflect/AccessibleObject.java
浏览文件 @
12bf35d7
...
@@ -180,14 +180,6 @@ public class AccessibleObject implements AnnotatedElement {
...
@@ -180,14 +180,6 @@ public class AccessibleObject implements AnnotatedElement {
throw
new
AssertionError
(
"All subclasses should override this method"
);
throw
new
AssertionError
(
"All subclasses should override this method"
);
}
}
/**
* @throws NullPointerException {@inheritDoc}
* @since 1.5
*/
public
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getAnnotation
(
annotationClass
)
!=
null
;
}
/**
/**
* @throws NullPointerException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
* @since 1.8
* @since 1.8
...
...
src/share/classes/java/lang/reflect/AnnotatedElement.java
浏览文件 @
12bf35d7
...
@@ -91,6 +91,9 @@ public interface AnnotatedElement {
...
@@ -91,6 +91,9 @@ public interface AnnotatedElement {
* <p>The truth value returned by this method is equivalent to:
* <p>The truth value returned by this method is equivalent to:
* {@code getAnnotation(annotationClass) != null}
* {@code getAnnotation(annotationClass) != null}
*
*
* <p>The body of the default method is specified to be the code
* above.
*
* @param annotationClass the Class object corresponding to the
* @param annotationClass the Class object corresponding to the
* annotation type
* annotation type
* @return true if an annotation for the specified annotation
* @return true if an annotation for the specified annotation
...
@@ -98,7 +101,9 @@ public interface AnnotatedElement {
...
@@ -98,7 +101,9 @@ public interface AnnotatedElement {
* @throws NullPointerException if the given annotation class is null
* @throws NullPointerException if the given annotation class is null
* @since 1.5
* @since 1.5
*/
*/
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
);
default
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getAnnotation
(
annotationClass
)
!=
null
;
}
/**
/**
* Returns this element's annotation for the specified type if
* Returns this element's annotation for the specified type if
...
...
src/share/classes/java/lang/reflect/Parameter.java
浏览文件 @
12bf35d7
...
@@ -280,14 +280,6 @@ public final class Parameter implements AnnotatedElement {
...
@@ -280,14 +280,6 @@ public final class Parameter implements AnnotatedElement {
return
getDeclaredAnnotations
();
return
getDeclaredAnnotations
();
}
}
/**
* @throws NullPointerException {@inheritDoc}
*/
public
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getAnnotation
(
annotationClass
)
!=
null
;
}
private
transient
Map
<
Class
<?
extends
Annotation
>,
Annotation
>
declaredAnnotations
;
private
transient
Map
<
Class
<?
extends
Annotation
>,
Annotation
>
declaredAnnotations
;
private
synchronized
Map
<
Class
<?
extends
Annotation
>,
Annotation
>
declaredAnnotations
()
{
private
synchronized
Map
<
Class
<?
extends
Annotation
>,
Annotation
>
declaredAnnotations
()
{
...
...
src/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java
浏览文件 @
12bf35d7
...
@@ -137,11 +137,6 @@ public class AnnotatedTypeFactory {
...
@@ -137,11 +137,6 @@ public class AnnotatedTypeFactory {
}
}
// AnnotatedElement
// AnnotatedElement
@Override
public
final
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotation
)
{
return
annotations
.
get
(
annotation
)
!=
null
;
}
@Override
@Override
public
final
Annotation
[]
getAnnotations
()
{
public
final
Annotation
[]
getAnnotations
()
{
return
getDeclaredAnnotations
();
return
getDeclaredAnnotations
();
...
...
src/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java
浏览文件 @
12bf35d7
...
@@ -188,11 +188,6 @@ public class TypeVariableImpl<D extends GenericDeclaration>
...
@@ -188,11 +188,6 @@ public class TypeVariableImpl<D extends GenericDeclaration>
}
}
// Implementations of AnnotatedElement methods.
// Implementations of AnnotatedElement methods.
public
boolean
isAnnotationPresent
(
Class
<?
extends
Annotation
>
annotationClass
)
{
Objects
.
requireNonNull
(
annotationClass
);
return
false
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
<
T
extends
Annotation
>
T
getAnnotation
(
Class
<
T
>
annotationClass
)
{
public
<
T
extends
Annotation
>
T
getAnnotation
(
Class
<
T
>
annotationClass
)
{
Objects
.
requireNonNull
(
annotationClass
);
Objects
.
requireNonNull
(
annotationClass
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录