Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7bb451c3
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看板
提交
7bb451c3
编写于
7月 20, 2011
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7068617: Core libraries don't build with javac -Xlint:all -Werror
Reviewed-by: darcy Contributed-by: alexandre.boulgakov@oracle.com
上级
ea8ffd55
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
37 deletion
+37
-37
make/java/java/Makefile
make/java/java/Makefile
+2
-0
src/share/classes/sun/reflect/generics/reflectiveObjects/NotImplementedException.java
...t/generics/reflectiveObjects/NotImplementedException.java
+4
-2
src/share/classes/sun/reflect/misc/ConstructorUtil.java
src/share/classes/sun/reflect/misc/ConstructorUtil.java
+3
-3
src/share/classes/sun/reflect/misc/FieldUtil.java
src/share/classes/sun/reflect/misc/FieldUtil.java
+4
-4
src/share/classes/sun/reflect/misc/MethodUtil.java
src/share/classes/sun/reflect/misc/MethodUtil.java
+15
-19
src/share/classes/sun/reflect/misc/ReflectUtil.java
src/share/classes/sun/reflect/misc/ReflectUtil.java
+9
-9
未找到文件。
make/java/java/Makefile
浏览文件 @
7bb451c3
...
...
@@ -32,6 +32,8 @@ BUILDDIR = ../..
PACKAGE
=
java.lang
LIBRARY
=
java
PRODUCT
=
java
SUBDIRS_MAKEFLAGS
+=
JAVAC_MAX_WARNINGS
=
true
SUBDIRS_MAKEFLAGS
+=
JAVAC_WARNINGS_FATAL
=
true
include
$(BUILDDIR)/common/Defs.gmk
# windows compiler flags
...
...
src/share/classes/sun/reflect/generics/reflectiveObjects/NotImplementedException.java
浏览文件 @
7bb451c3
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003,
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
...
...
@@ -26,4 +26,6 @@
package
sun.reflect.generics.reflectiveObjects
;
/** Temporary class used to indicate missing functionality */
public
class
NotImplementedException
extends
RuntimeException
{}
public
class
NotImplementedException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
9177857708926624790L
;
}
src/share/classes/sun/reflect/misc/ConstructorUtil.java
浏览文件 @
7bb451c3
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -32,13 +32,13 @@ public final class ConstructorUtil {
private
ConstructorUtil
()
{
}
public
static
Constructor
getConstructor
(
Class
cls
,
Class
[]
params
)
public
static
Constructor
<?>
getConstructor
(
Class
<?>
cls
,
Class
<?>
[]
params
)
throws
NoSuchMethodException
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getConstructor
(
params
);
}
public
static
Constructor
[]
getConstructors
(
Class
cls
)
{
public
static
Constructor
<?>[]
getConstructors
(
Class
<?>
cls
)
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getConstructors
();
}
...
...
src/share/classes/sun/reflect/misc/FieldUtil.java
浏览文件 @
7bb451c3
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -35,18 +35,18 @@ public final class FieldUtil {
private
FieldUtil
()
{
}
public
static
Field
getField
(
Class
cls
,
String
name
)
public
static
Field
getField
(
Class
<?>
cls
,
String
name
)
throws
NoSuchFieldException
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getField
(
name
);
}
public
static
Field
[]
getFields
(
Class
cls
)
{
public
static
Field
[]
getFields
(
Class
<?>
cls
)
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getFields
();
}
public
static
Field
[]
getDeclaredFields
(
Class
cls
)
{
public
static
Field
[]
getDeclaredFields
(
Class
<?>
cls
)
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getDeclaredFields
();
}
...
...
src/share/classes/sun/reflect/misc/MethodUtil.java
浏览文件 @
7bb451c3
/*
* Copyright (c) 2005, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, 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
...
...
@@ -36,17 +36,13 @@ import java.io.BufferedInputStream;
import
java.io.IOException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.net.HttpURLConnection
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.AccessibleObject
;
import
java.lang.reflect.Modifier
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map
;
import
sun.misc.IOUtils
;
import
sun.net.www.ParseUtil
;
import
sun.security.util.SecurityConstants
;
class
Trampoline
{
...
...
@@ -68,13 +64,13 @@ public final class MethodUtil extends SecureClassLoader {
super
();
}
public
static
Method
getMethod
(
Class
<?>
cls
,
String
name
,
Class
[]
args
)
public
static
Method
getMethod
(
Class
<?>
cls
,
String
name
,
Class
<?>
[]
args
)
throws
NoSuchMethodException
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getMethod
(
name
,
args
);
}
public
static
Method
[]
getMethods
(
Class
cls
)
{
public
static
Method
[]
getMethods
(
Class
<?>
cls
)
{
ReflectUtil
.
checkPackageAccess
(
cls
);
return
cls
.
getMethods
();
}
...
...
@@ -85,7 +81,7 @@ public final class MethodUtil extends SecureClassLoader {
* Class.getMethods() and walking towards Object until
* we're done.
*/
public
static
Method
[]
getPublicMethods
(
Class
cls
)
{
public
static
Method
[]
getPublicMethods
(
Class
<?>
cls
)
{
// compatibility for update release
if
(
System
.
getSecurityManager
()
==
null
)
{
return
cls
.
getMethods
();
...
...
@@ -105,11 +101,11 @@ public final class MethodUtil extends SecureClassLoader {
/*
* Process the immediate interfaces of this class or interface.
*/
private
static
void
getInterfaceMethods
(
Class
cls
,
private
static
void
getInterfaceMethods
(
Class
<?>
cls
,
Map
<
Signature
,
Method
>
sigs
)
{
Class
[]
intfs
=
cls
.
getInterfaces
();
Class
<?>
[]
intfs
=
cls
.
getInterfaces
();
for
(
int
i
=
0
;
i
<
intfs
.
length
;
i
++)
{
Class
intf
=
intfs
[
i
];
Class
<?>
intf
=
intfs
[
i
];
boolean
done
=
getInternalPublicMethods
(
intf
,
sigs
);
if
(!
done
)
{
getInterfaceMethods
(
intf
,
sigs
);
...
...
@@ -121,7 +117,7 @@ public final class MethodUtil extends SecureClassLoader {
*
* Process the methods in this class or interface
*/
private
static
boolean
getInternalPublicMethods
(
Class
cls
,
private
static
boolean
getInternalPublicMethods
(
Class
<?>
cls
,
Map
<
Signature
,
Method
>
sigs
)
{
Method
[]
methods
=
null
;
try
{
...
...
@@ -150,7 +146,7 @@ public final class MethodUtil extends SecureClassLoader {
*/
boolean
done
=
true
;
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
Class
dc
=
methods
[
i
].
getDeclaringClass
();
Class
<?>
dc
=
methods
[
i
].
getDeclaringClass
();
if
(!
Modifier
.
isPublic
(
dc
.
getModifiers
()))
{
done
=
false
;
break
;
...
...
@@ -171,7 +167,7 @@ public final class MethodUtil extends SecureClassLoader {
* stripping away inherited methods.
*/
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
Class
dc
=
methods
[
i
].
getDeclaringClass
();
Class
<?>
dc
=
methods
[
i
].
getDeclaringClass
();
if
(
cls
.
equals
(
dc
))
{
addMethod
(
sigs
,
methods
[
i
]);
}
...
...
@@ -301,12 +297,12 @@ public final class MethodUtil extends SecureClassLoader {
}
protected
synchronized
Class
loadClass
(
String
name
,
boolean
resolve
)
protected
synchronized
Class
<?>
loadClass
(
String
name
,
boolean
resolve
)
throws
ClassNotFoundException
{
// First, check if the class has already been loaded
ReflectUtil
.
checkPackageAccess
(
name
);
Class
c
=
findLoadedClass
(
name
);
Class
<?>
c
=
findLoadedClass
(
name
);
if
(
c
==
null
)
{
try
{
c
=
findClass
(
name
);
...
...
@@ -324,7 +320,7 @@ public final class MethodUtil extends SecureClassLoader {
}
protected
Class
findClass
(
final
String
name
)
protected
Class
<?>
findClass
(
final
String
name
)
throws
ClassNotFoundException
{
if
(!
name
.
startsWith
(
MISC_PKG
))
{
...
...
@@ -347,7 +343,7 @@ public final class MethodUtil extends SecureClassLoader {
/*
* Define the proxy classes
*/
private
Class
defineClass
(
String
name
,
URL
url
)
throws
IOException
{
private
Class
<?>
defineClass
(
String
name
,
URL
url
)
throws
IOException
{
byte
[]
b
=
getBytes
(
url
);
CodeSource
cs
=
new
CodeSource
(
null
,
(
java
.
security
.
cert
.
Certificate
[])
null
);
if
(!
name
.
equals
(
TRAMPOLINE
))
{
...
...
@@ -389,7 +385,7 @@ public final class MethodUtil extends SecureClassLoader {
return
perms
;
}
private
static
Class
getTrampolineClass
()
{
private
static
Class
<?>
getTrampolineClass
()
{
try
{
return
Class
.
forName
(
TRAMPOLINE
,
true
,
new
MethodUtil
());
}
catch
(
ClassNotFoundException
e
)
{
...
...
src/share/classes/sun/reflect/misc/ReflectUtil.java
浏览文件 @
7bb451c3
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -34,13 +34,13 @@ public final class ReflectUtil {
private
ReflectUtil
()
{
}
public
static
Class
forName
(
String
name
)
public
static
Class
<?>
forName
(
String
name
)
throws
ClassNotFoundException
{
checkPackageAccess
(
name
);
return
Class
.
forName
(
name
);
}
public
static
Object
newInstance
(
Class
cls
)
public
static
Object
newInstance
(
Class
<?>
cls
)
throws
InstantiationException
,
IllegalAccessException
{
checkPackageAccess
(
cls
);
return
cls
.
newInstance
();
...
...
@@ -50,8 +50,8 @@ public final class ReflectUtil {
* Reflection.ensureMemberAccess is overly-restrictive
* due to a bug. We awkwardly work around it for now.
*/
public
static
void
ensureMemberAccess
(
Class
currentClass
,
Class
memberClass
,
public
static
void
ensureMemberAccess
(
Class
<?>
currentClass
,
Class
<?>
memberClass
,
Object
target
,
int
modifiers
)
throws
IllegalAccessException
...
...
@@ -102,8 +102,8 @@ public final class ReflectUtil {
}
}
private
static
boolean
isSubclassOf
(
Class
queryClass
,
Class
ofClass
)
private
static
boolean
isSubclassOf
(
Class
<?>
queryClass
,
Class
<?>
ofClass
)
{
while
(
queryClass
!=
null
)
{
if
(
queryClass
==
ofClass
)
{
...
...
@@ -115,7 +115,7 @@ public final class ReflectUtil {
}
public
static
void
checkPackageAccess
(
Class
clazz
)
{
public
static
void
checkPackageAccess
(
Class
<?>
clazz
)
{
checkPackageAccess
(
clazz
.
getName
());
}
...
...
@@ -136,7 +136,7 @@ public final class ReflectUtil {
}
}
public
static
boolean
isPackageAccessible
(
Class
clazz
)
{
public
static
boolean
isPackageAccessible
(
Class
<?>
clazz
)
{
try
{
checkPackageAccess
(
clazz
);
}
catch
(
SecurityException
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录