Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b79c3ab0
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看板
提交
b79c3ab0
编写于
12月 02, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7117357: Warnings in sun.instrument, tools and other sun.* classes
Reviewed-by: lancea, chegar
上级
109708ab
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
63 addition
and
64 deletion
+63
-64
src/share/classes/sun/instrument/InstrumentationImpl.java
src/share/classes/sun/instrument/InstrumentationImpl.java
+7
-7
src/share/classes/sun/instrument/TransformerManager.java
src/share/classes/sun/instrument/TransformerManager.java
+1
-1
src/share/classes/sun/launcher/LauncherHelper.java
src/share/classes/sun/launcher/LauncherHelper.java
+1
-1
src/share/classes/sun/management/counter/perf/PerfInstrumentation.java
...sses/sun/management/counter/perf/PerfInstrumentation.java
+3
-5
src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java
.../classes/sun/management/jmxremote/ConnectorBootstrap.java
+4
-6
src/share/classes/sun/net/RegisteredDomain.java
src/share/classes/sun/net/RegisteredDomain.java
+4
-4
src/share/classes/sun/net/www/protocol/jar/Handler.java
src/share/classes/sun/net/www/protocol/jar/Handler.java
+1
-0
src/share/classes/sun/tools/attach/HotSpotAttachProvider.java
...share/classes/sun/tools/attach/HotSpotAttachProvider.java
+23
-25
src/share/classes/sun/tools/jinfo/JInfo.java
src/share/classes/sun/tools/jinfo/JInfo.java
+2
-2
src/share/classes/sun/tools/jmap/JMap.java
src/share/classes/sun/tools/jmap/JMap.java
+2
-2
src/share/classes/sun/tools/jps/Jps.java
src/share/classes/sun/tools/jps/Jps.java
+3
-3
src/share/classes/sun/tools/jstack/JStack.java
src/share/classes/sun/tools/jstack/JStack.java
+1
-1
src/share/classes/sun/tools/serialver/SerialVer.java
src/share/classes/sun/tools/serialver/SerialVer.java
+11
-7
未找到文件。
src/share/classes/sun/instrument/InstrumentationImpl.java
浏览文件 @
b79c3ab0
...
...
@@ -136,7 +136,7 @@ public class InstrumentationImpl implements Instrumentation {
}
public
void
retransformClasses
(
Class
<?>
[]
classes
)
{
retransformClasses
(
Class
<?>
...
classes
)
{
if
(!
isRetransformClassesSupported
())
{
throw
new
UnsupportedOperationException
(
"retransformClasses is not supported in this environment"
);
...
...
@@ -150,7 +150,7 @@ public class InstrumentationImpl implements Instrumentation {
}
public
void
redefineClasses
(
ClassDefinition
[]
definitions
)
redefineClasses
(
ClassDefinition
...
definitions
)
throws
ClassNotFoundException
{
if
(!
isRedefineClassesSupported
())
{
throw
new
UnsupportedOperationException
(
"redefineClasses is not supported in this environment"
);
...
...
@@ -321,7 +321,7 @@ public class InstrumentationImpl implements Instrumentation {
try
{
m
=
javaAgentClass
.
getDeclaredMethod
(
methodname
,
new
Class
[]
{
new
Class
<?>
[]
{
String
.
class
,
java
.
lang
.
instrument
.
Instrumentation
.
class
}
...
...
@@ -336,7 +336,7 @@ public class InstrumentationImpl implements Instrumentation {
// now try the declared 1-arg method
try
{
m
=
javaAgentClass
.
getDeclaredMethod
(
methodname
,
new
Class
[]
{
String
.
class
});
new
Class
<?>
[]
{
String
.
class
});
}
catch
(
NoSuchMethodException
x
)
{
// ignore this exception because we'll try
// two arg inheritance next
...
...
@@ -347,7 +347,7 @@ public class InstrumentationImpl implements Instrumentation {
// now try the inherited 2-arg method
try
{
m
=
javaAgentClass
.
getMethod
(
methodname
,
new
Class
[]
{
new
Class
<?>
[]
{
String
.
class
,
java
.
lang
.
instrument
.
Instrumentation
.
class
}
...
...
@@ -363,7 +363,7 @@ public class InstrumentationImpl implements Instrumentation {
// finally try the inherited 1-arg method
try
{
m
=
javaAgentClass
.
getMethod
(
methodname
,
new
Class
[]
{
String
.
class
});
new
Class
<?>
[]
{
String
.
class
});
}
catch
(
NoSuchMethodException
x
)
{
// none of the methods exists so we throw the
// first NoSuchMethodException as per 5.0
...
...
@@ -411,7 +411,7 @@ public class InstrumentationImpl implements Instrumentation {
private
byte
[]
transform
(
ClassLoader
loader
,
String
classname
,
Class
classBeingRedefined
,
Class
<?>
classBeingRedefined
,
ProtectionDomain
protectionDomain
,
byte
[]
classfileBuffer
,
boolean
isRetransformer
)
{
...
...
src/share/classes/sun/instrument/TransformerManager.java
浏览文件 @
b79c3ab0
...
...
@@ -169,7 +169,7 @@ public class TransformerManager
public
byte
[]
transform
(
ClassLoader
loader
,
String
classname
,
Class
classBeingRedefined
,
Class
<?>
classBeingRedefined
,
ProtectionDomain
protectionDomain
,
byte
[]
classfileBuffer
)
{
boolean
someoneTouchedTheBytecode
=
false
;
...
...
src/share/classes/sun/launcher/LauncherHelper.java
浏览文件 @
b79c3ab0
...
...
@@ -428,7 +428,7 @@ public enum LauncherHelper {
if
(
t
!=
null
)
{
t
.
printStackTrace
();
}
else
{
Thread
.
currentThread
().
dumpStack
();
Thread
.
dumpStack
();
}
}
System
.
exit
(
1
);
...
...
src/share/classes/sun/management/counter/perf/PerfInstrumentation.java
浏览文件 @
b79c3ab0
...
...
@@ -169,17 +169,15 @@ public class PerfInstrumentation {
Matcher
matcher
=
pattern
.
matcher
(
""
);
List
<
Counter
>
matches
=
new
ArrayList
<
Counter
>();
Iterator
iter
=
map
.
entrySet
().
iterator
();
while
(
iter
.
hasNext
())
{
Map
.
Entry
me
=
(
Map
.
Entry
)
iter
.
next
();
String
name
=
(
String
)
me
.
getKey
();
for
(
Map
.
Entry
<
String
,
Counter
>
me:
map
.
entrySet
())
{
String
name
=
me
.
getKey
();
// apply pattern to counter name
matcher
.
reset
(
name
);
// if the pattern matches, then add Counter to list
if
(
matcher
.
lookingAt
())
{
matches
.
add
(
(
Counter
)
me
.
getValue
());
matches
.
add
(
me
.
getValue
());
}
}
return
matches
;
...
...
src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java
浏览文件 @
b79c3ab0
...
...
@@ -233,16 +233,14 @@ public final class ConnectorBootstrap {
"the access file ["
+
accessFile
+
"] as the "
+
"authenticated Subject is null"
);
}
final
Set
principals
=
subject
.
getPrincipals
();
for
(
Iterator
i
=
principals
.
iterator
();
i
.
hasNext
();)
{
final
Principal
p
=
(
Principal
)
i
.
next
();
final
Set
<
Principal
>
principals
=
subject
.
getPrincipals
();
for
(
Principal
p:
principals
)
{
if
(
properties
.
containsKey
(
p
.
getName
()))
{
return
;
}
}
final
Set
<
String
>
principalsStr
=
new
HashSet
<
String
>();
for
(
Iterator
i
=
principals
.
iterator
();
i
.
hasNext
();)
{
final
Principal
p
=
(
Principal
)
i
.
next
();
for
(
Principal
p:
principals
)
{
principalsStr
.
add
(
p
.
getName
());
}
throw
new
SecurityException
(
...
...
@@ -653,7 +651,7 @@ public final class ConnectorBootstrap {
}
TrustManagerFactory
tmf
=
TrustManagerFactory
.
getInstance
(
TrustManagerFactory
.
getDefaultAlgorithm
());
tmf
.
init
(
(
KeyStore
)
ts
);
tmf
.
init
(
ts
);
SSLContext
ctx
=
SSLContext
.
getInstance
(
"SSL"
);
ctx
.
init
(
kmf
.
getKeyManagers
(),
tmf
.
getTrustManagers
(),
null
);
...
...
src/share/classes/sun/net/RegisteredDomain.java
浏览文件 @
b79c3ab0
...
...
@@ -118,8 +118,8 @@ private static Set<String> usStateSet = new HashSet<String>(Arrays.asList("ak",
private
static
Set
<
String
>
usSubStateSet
=
new
HashSet
<
String
>(
Arrays
.
asList
(
"state"
,
"lib"
,
"k12"
,
"cc"
,
"tec"
,
"gen"
,
"cog"
,
"mus"
,
"dst"
));
private
static
Map
<
String
,
Set
>
topMap
=
new
HashMap
<
String
,
Set
>();
private
static
Map
<
String
,
Set
>
top3Map
=
new
HashMap
<
String
,
Set
>();
private
static
Map
<
String
,
Set
<
String
>>
topMap
=
new
HashMap
<
>();
private
static
Map
<
String
,
Set
<
String
>>
top3Map
=
new
HashMap
<
>();
static
{
/*
...
...
@@ -764,7 +764,7 @@ static {
*/
String
str
=
cname
.
substring
(
third
+
1
);
if
(
third
!=
-
1
)
{
Set
set
=
top3Map
.
get
(
s
);
Set
<
String
>
set
=
top3Map
.
get
(
s
);
if
(
set
!=
null
)
{
if
(
set
.
contains
(
str
))
{
return
cname
.
substring
(
fourth
+
1
);
...
...
@@ -801,7 +801,7 @@ static {
/*
* XX.MA.US.
*/
Set
topSet
=
topMap
.
get
(
s
);
Set
<
String
>
topSet
=
topMap
.
get
(
s
);
if
(
topSet
!=
null
)
{
if
(
topSet
.
contains
(
s2
))
{
return
cname
.
substring
(
third
+
1
);
...
...
src/share/classes/sun/net/www/protocol/jar/Handler.java
浏览文件 @
b79c3ab0
...
...
@@ -123,6 +123,7 @@ public class Handler extends java.net.URLStreamHandler {
@Override
@SuppressWarnings
(
"deprecation"
)
protected
void
parseURL
(
URL
url
,
String
spec
,
int
start
,
int
limit
)
{
String
file
=
null
;
...
...
src/share/classes/sun/tools/attach/HotSpotAttachProvider.java
浏览文件 @
b79c3ab0
...
...
@@ -75,7 +75,7 @@ public abstract class HotSpotAttachProvider extends AttachProvider {
new
ArrayList
<
VirtualMachineDescriptor
>();
MonitoredHost
host
;
Set
vms
;
Set
<
Integer
>
vms
;
try
{
host
=
MonitoredHost
.
getMonitoredHost
(
new
HostIdentifier
((
String
)
null
));
vms
=
host
.
activeVms
();
...
...
@@ -92,31 +92,29 @@ public abstract class HotSpotAttachProvider extends AttachProvider {
throw
new
InternalError
(
t
);
// shouldn't happen
}
for
(
Object
vmid:
vms
)
{
if
(
vmid
instanceof
Integer
)
{
String
pid
=
vmid
.
toString
();
String
name
=
pid
;
// default to pid if name not available
boolean
isAttachable
=
false
;
MonitoredVm
mvm
=
null
;
for
(
Integer
vmid:
vms
)
{
String
pid
=
vmid
.
toString
();
String
name
=
pid
;
// default to pid if name not available
boolean
isAttachable
=
false
;
MonitoredVm
mvm
=
null
;
try
{
mvm
=
host
.
getMonitoredVm
(
new
VmIdentifier
(
pid
));
try
{
mvm
=
host
.
getMonitoredVm
(
new
VmIdentifier
(
pid
));
try
{
isAttachable
=
MonitoredVmUtil
.
isAttachable
(
mvm
);
// use the command line as the display name
name
=
MonitoredVmUtil
.
commandLine
(
mvm
);
}
catch
(
Exception
e
)
{
}
if
(
isAttachable
)
{
result
.
add
(
new
HotSpotVirtualMachineDescriptor
(
this
,
pid
,
name
));
}
}
catch
(
Throwable
t
)
{
if
(
t
instanceof
ThreadDeath
)
{
throw
(
ThreadDeath
)
t
;
}
}
finally
{
if
(
mvm
!=
null
)
{
mvm
.
detach
();
}
isAttachable
=
MonitoredVmUtil
.
isAttachable
(
mvm
);
// use the command line as the display name
name
=
MonitoredVmUtil
.
commandLine
(
mvm
);
}
catch
(
Exception
e
)
{
}
if
(
isAttachable
)
{
result
.
add
(
new
HotSpotVirtualMachineDescriptor
(
this
,
pid
,
name
));
}
}
catch
(
Throwable
t
)
{
if
(
t
instanceof
ThreadDeath
)
{
throw
(
ThreadDeath
)
t
;
}
}
finally
{
if
(
mvm
!=
null
)
{
mvm
.
detach
();
}
}
}
...
...
src/share/classes/sun/tools/jinfo/JInfo.java
浏览文件 @
b79c3ab0
...
...
@@ -98,7 +98,7 @@ public class JInfo {
}
// loads the given class using the system class loader
private
static
Class
loadClass
(
String
name
)
{
private
static
Class
<?>
loadClass
(
String
name
)
{
//
// We specify the system clas loader so as to cater for development
// environments where this class is on the boot class path but sa-jdi.jar
...
...
@@ -178,7 +178,7 @@ public class JInfo {
// print usage message
private
static
void
usage
()
{
Class
c
=
loadClass
(
"sun.jvm.hotspot.tools.JInfo"
);
Class
<?>
c
=
loadClass
(
"sun.jvm.hotspot.tools.JInfo"
);
boolean
usageSA
=
(
c
!=
null
);
System
.
out
.
println
(
"Usage:"
);
...
...
src/share/classes/sun/tools/jmap/JMap.java
浏览文件 @
b79c3ab0
...
...
@@ -198,7 +198,7 @@ public class JMap {
}
// loads the given class using the system class loader
private
static
Class
loadClass
(
String
name
)
{
private
static
Class
<?>
loadClass
(
String
name
)
{
//
// We specify the system clas loader so as to cater for development
// environments where this class is on the boot class path but sa-jdi.jar
...
...
@@ -336,7 +336,7 @@ public class JMap {
// returns true if SA is available
private
static
boolean
haveSA
()
{
Class
c
=
loadClass
(
"sun.jvm.hotspot.tools.HeapSummary"
);
Class
<?>
c
=
loadClass
(
"sun.jvm.hotspot.tools.HeapSummary"
);
return
(
c
!=
null
);
}
...
...
src/share/classes/sun/tools/jps/Jps.java
浏览文件 @
b79c3ab0
...
...
@@ -59,13 +59,13 @@ public class Jps {
MonitoredHost
.
getMonitoredHost
(
hostId
);
// get the set active JVMs on the specified host.
Set
jvms
=
monitoredHost
.
activeVms
();
Set
<
Integer
>
jvms
=
monitoredHost
.
activeVms
();
for
(
I
terator
j
=
jvms
.
iterator
();
j
.
hasNext
();
/* empty */
)
{
for
(
I
nteger
jvm:
jvms
)
{
StringBuilder
output
=
new
StringBuilder
();
Throwable
lastError
=
null
;
int
lvmid
=
((
Integer
)
j
.
next
()).
intValue
()
;
int
lvmid
=
jvm
;
output
.
append
(
String
.
valueOf
(
lvmid
));
...
...
src/share/classes/sun/tools/jstack/JStack.java
浏览文件 @
b79c3ab0
...
...
@@ -137,7 +137,7 @@ public class JStack {
}
// Returns sun.jvm.hotspot.tools.JStack if available, otherwise null.
private
static
Class
loadSAClass
()
{
private
static
Class
<?>
loadSAClass
()
{
//
// Attempt to load JStack class - we specify the system class
// loader so as to cater for development environments where
...
...
src/share/classes/sun/tools/serialver/SerialVer.java
浏览文件 @
b79c3ab0
...
...
@@ -98,6 +98,7 @@ public class SerialVer extends Applet {
classname_t
.
requestFocus
();
}
@SuppressWarnings
(
"deprecation"
)
public
boolean
action
(
Event
ev
,
Object
obj
)
{
if
(
ev
.
target
==
classname_t
)
{
show
((
String
)
ev
.
arg
);
...
...
@@ -110,6 +111,7 @@ public class SerialVer extends Applet {
}
@SuppressWarnings
(
"deprecation"
)
public
boolean
handleEvent
(
Event
ev
)
{
boolean
rc
=
super
.
handleEvent
(
ev
);
return
rc
;
...
...
@@ -206,7 +208,7 @@ public class SerialVer extends Applet {
}
static
String
resolveClass
(
String
classname
)
throws
ClassNotFoundException
{
Class
cl
=
Class
.
forName
(
classname
,
false
,
loader
);
Class
<?>
cl
=
Class
.
forName
(
classname
,
false
,
loader
);
ObjectStreamClass
desc
=
ObjectStreamClass
.
lookup
(
cl
);
if
(
desc
!=
null
)
{
return
" static final long serialVersionUID = "
+
...
...
@@ -216,6 +218,10 @@ public class SerialVer extends Applet {
}
}
@SuppressWarnings
(
"deprecation"
)
private
static
void
showWindow
(
Window
w
)
{
w
.
show
();
}
public
static
void
main
(
String
[]
args
)
{
boolean
show
=
false
;
...
...
@@ -316,7 +322,7 @@ public class SerialVer extends Applet {
f
.
add
(
"Center"
,
sv
);
f
.
pack
();
f
.
show
(
);
showWindow
(
f
);
}
}
...
...
@@ -362,6 +368,7 @@ class SerialVerFrame extends Frame {
/*
* Handle a window destroy event by exiting.
*/
@SuppressWarnings
(
"deprecation"
)
public
boolean
handleEvent
(
Event
e
)
{
if
(
e
.
id
==
Event
.
WINDOW_DESTROY
)
{
exit
(
0
);
...
...
@@ -371,6 +378,7 @@ class SerialVerFrame extends Frame {
/*
* Handle an Exit event by exiting.
*/
@SuppressWarnings
(
"deprecation"
)
public
boolean
action
(
Event
ev
,
Object
obj
)
{
if
(
ev
.
target
==
exit_i
)
{
exit
(
0
);
...
...
@@ -455,11 +463,7 @@ class Res {
}
try
{
String
message
=
messageRB
.
getString
(
key
);
String
[]
args
=
new
String
[
3
];
args
[
0
]
=
a1
;
args
[
1
]
=
a2
;
args
[
2
]
=
a3
;
return
MessageFormat
.
format
(
message
,
args
);
return
MessageFormat
.
format
(
message
,
a1
,
a2
,
a3
);
}
catch
(
MissingResourceException
e
)
{
throw
new
Error
(
"Fatal: Resource for serialver is broken. There is no "
+
key
+
" key in resource."
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录