Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
93792750
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93792750
编写于
1月 16, 2013
作者:
M
mcherkas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005492: Reduce number of warnings in sun/awt/* classes
Reviewed-by: art, anthony
上级
47aaa327
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
51 addition
and
46 deletion
+51
-46
src/share/classes/java/awt/Button.java
src/share/classes/java/awt/Button.java
+1
-1
src/share/classes/java/awt/Checkbox.java
src/share/classes/java/awt/Checkbox.java
+1
-1
src/share/classes/java/awt/Choice.java
src/share/classes/java/awt/Choice.java
+4
-4
src/share/classes/java/awt/Component.java
src/share/classes/java/awt/Component.java
+1
-0
src/share/classes/java/awt/Container.java
src/share/classes/java/awt/Container.java
+11
-11
src/share/classes/java/awt/Dialog.java
src/share/classes/java/awt/Dialog.java
+6
-6
src/share/classes/java/awt/Frame.java
src/share/classes/java/awt/Frame.java
+2
-2
src/share/classes/java/awt/KeyboardFocusManager.java
src/share/classes/java/awt/KeyboardFocusManager.java
+1
-1
src/share/classes/java/awt/Scrollbar.java
src/share/classes/java/awt/Scrollbar.java
+1
-1
src/share/classes/java/awt/TextArea.java
src/share/classes/java/awt/TextArea.java
+3
-3
src/share/classes/java/awt/TextComponent.java
src/share/classes/java/awt/TextComponent.java
+1
-1
src/share/classes/java/awt/TextField.java
src/share/classes/java/awt/TextField.java
+1
-1
src/share/classes/java/awt/Toolkit.java
src/share/classes/java/awt/Toolkit.java
+1
-1
src/share/classes/java/awt/Window.java
src/share/classes/java/awt/Window.java
+14
-10
src/share/classes/sun/awt/image/SurfaceManager.java
src/share/classes/sun/awt/image/SurfaceManager.java
+3
-3
未找到文件。
src/share/classes/java/awt/Button.java
浏览文件 @
93792750
...
...
@@ -300,7 +300,7 @@ public class Button extends Component implements Accessible {
* @since 1.4
*/
public
synchronized
ActionListener
[]
getActionListeners
()
{
return
(
ActionListener
[])
(
getListeners
(
ActionListener
.
class
)
);
return
getListeners
(
ActionListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/Checkbox.java
浏览文件 @
93792750
...
...
@@ -470,7 +470,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public
synchronized
ItemListener
[]
getItemListeners
()
{
return
(
ItemListener
[])
(
getListeners
(
ItemListener
.
class
)
);
return
getListeners
(
ItemListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/Choice.java
浏览文件 @
93792750
...
...
@@ -85,7 +85,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* @see #insert(String, int)
* @see #remove(String)
*/
Vector
pItems
;
Vector
<
String
>
pItems
;
/**
* The index of the current choice for this <code>Choice</code>
...
...
@@ -129,7 +129,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
*/
public
Choice
()
throws
HeadlessException
{
GraphicsEnvironment
.
checkHeadless
();
pItems
=
new
Vector
();
pItems
=
new
Vector
<>
();
}
/**
...
...
@@ -191,7 +191,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* be called on the toolkit thread.
*/
final
String
getItemImpl
(
int
index
)
{
return
(
String
)
pItems
.
elementAt
(
index
);
return
pItems
.
elementAt
(
index
);
}
/**
...
...
@@ -524,7 +524,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public
synchronized
ItemListener
[]
getItemListeners
()
{
return
(
ItemListener
[])(
getListeners
(
ItemListener
.
class
)
);
return
getListeners
(
ItemListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/Component.java
浏览文件 @
93792750
...
...
@@ -7287,6 +7287,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
final
Set
<
AWTKeyStroke
>
getFocusTraversalKeys_NoIDCheck
(
int
id
)
{
// Okay to return Set directly because it is an unmodifiable view
@SuppressWarnings
(
"unchecked"
)
Set
<
AWTKeyStroke
>
keystrokes
=
(
focusTraversalKeys
!=
null
)
?
focusTraversalKeys
[
id
]
:
null
;
...
...
src/share/classes/java/awt/Container.java
浏览文件 @
93792750
...
...
@@ -161,7 +161,7 @@ public class Container extends Component {
private
boolean
focusTraversalPolicyProvider
;
// keeps track of the threads that are printing this component
private
transient
Set
printingThreads
;
private
transient
Set
<
Thread
>
printingThreads
;
// True if there is at least one thread that's printing this component
private
transient
boolean
printing
=
false
;
...
...
@@ -275,7 +275,7 @@ public class Container extends Component {
*/
public
Container
()
{
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
void
initializeFocusTraversalKeys
()
{
focusTraversalKeys
=
new
Set
[
4
];
}
...
...
@@ -2006,7 +2006,7 @@ public class Container extends Component {
try
{
synchronized
(
getObjectLock
())
{
if
(
printingThreads
==
null
)
{
printingThreads
=
new
HashSet
();
printingThreads
=
new
HashSet
<>
();
}
printingThreads
.
add
(
t
);
printing
=
true
;
...
...
@@ -2148,7 +2148,7 @@ public class Container extends Component {
* @since 1.4
*/
public
synchronized
ContainerListener
[]
getContainerListeners
()
{
return
(
ContainerListener
[])
(
getListeners
(
ContainerListener
.
class
)
);
return
getListeners
(
ContainerListener
.
class
);
}
/**
...
...
@@ -2599,9 +2599,9 @@ public class Container extends Component {
if
(
GraphicsEnvironment
.
isHeadless
())
{
throw
new
HeadlessException
();
}
PointerInfo
pi
=
(
PointerInfo
)
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
()
{
public
Object
run
()
{
PointerInfo
pi
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
PointerInfo
>
()
{
public
PointerInfo
run
()
{
return
MouseInfo
.
getPointerInfo
();
}
}
...
...
@@ -2682,7 +2682,7 @@ public class Container extends Component {
y
-
comp
.
y
,
ignoreEnabled
);
}
else
{
comp
=
comp
.
locate
(
x
-
comp
.
x
,
y
-
comp
.
y
);
comp
=
comp
.
getComponentAt
(
x
-
comp
.
x
,
y
-
comp
.
y
);
}
if
(
comp
!=
null
&&
comp
.
visible
&&
(
ignoreEnabled
||
comp
.
enabled
))
...
...
@@ -2700,7 +2700,7 @@ public class Container extends Component {
y
-
comp
.
y
,
ignoreEnabled
);
}
else
{
comp
=
comp
.
locate
(
x
-
comp
.
x
,
y
-
comp
.
y
);
comp
=
comp
.
getComponentAt
(
x
-
comp
.
x
,
y
-
comp
.
y
);
}
if
(
comp
!=
null
&&
comp
.
visible
&&
(
ignoreEnabled
||
comp
.
enabled
))
...
...
@@ -4637,7 +4637,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
private
void
startListeningForOtherDrags
()
{
//System.out.println("Adding AWTEventListener");
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
()
{
new
java
.
security
.
PrivilegedAction
<
Object
>
()
{
public
Object
run
()
{
nativeContainer
.
getToolkit
().
addAWTEventListener
(
LightweightDispatcher
.
this
,
...
...
@@ -4652,7 +4652,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
private
void
stopListeningForOtherDrags
()
{
//System.out.println("Removing AWTEventListener");
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
()
{
new
java
.
security
.
PrivilegedAction
<
Object
>
()
{
public
Object
run
()
{
nativeContainer
.
getToolkit
().
removeAWTEventListener
(
LightweightDispatcher
.
this
);
return
null
;
...
...
src/share/classes/java/awt/Dialog.java
浏览文件 @
93792750
...
...
@@ -1047,9 +1047,9 @@ public class Dialog extends Window {
// if this dialog is toolkit-modal, the filter should be added
// to all EDTs (for all AppContexts)
if
(
modalityType
==
ModalityType
.
TOOLKIT_MODAL
)
{
Iterator
it
=
AppContext
.
getAppContexts
().
iterator
();
Iterator
<
AppContext
>
it
=
AppContext
.
getAppContexts
().
iterator
();
while
(
it
.
hasNext
())
{
AppContext
appContext
=
(
AppContext
)
it
.
next
();
AppContext
appContext
=
it
.
next
();
if
(
appContext
==
showAppContext
)
{
continue
;
}
...
...
@@ -1084,9 +1084,9 @@ public class Dialog extends Window {
// if this dialog is toolkit-modal, its filter must be removed
// from all EDTs (for all AppContexts)
if
(
modalityType
==
ModalityType
.
TOOLKIT_MODAL
)
{
Iterator
it
=
AppContext
.
getAppContexts
().
iterator
();
Iterator
<
AppContext
>
it
=
AppContext
.
getAppContexts
().
iterator
();
while
(
it
.
hasNext
())
{
AppContext
appContext
=
(
AppContext
)
it
.
next
();
AppContext
appContext
=
it
.
next
();
if
(
appContext
==
showAppContext
)
{
continue
;
}
...
...
@@ -1396,7 +1396,7 @@ public class Dialog extends Window {
if
(
d
.
shouldBlock
(
this
))
{
Window
w
=
d
;
while
((
w
!=
null
)
&&
(
w
!=
this
))
{
w
=
(
Window
)(
w
.
getOwner_NoClientCode
()
);
w
=
w
.
getOwner_NoClientCode
(
);
}
if
((
w
==
this
)
||
!
shouldBlock
(
d
)
||
(
modalityType
.
compareTo
(
d
.
getModalityType
())
<
0
))
{
blockers
.
add
(
d
);
...
...
@@ -1611,7 +1611,7 @@ public class Dialog extends Window {
setModal
(
modal
);
}
blockedWindows
=
new
IdentityArrayList
();
blockedWindows
=
new
IdentityArrayList
<>
();
}
/*
...
...
src/share/classes/java/awt/Frame.java
浏览文件 @
93792750
...
...
@@ -353,7 +353,7 @@ public class Frame extends Window implements MenuContainer {
* @serial
* @see java.awt.Window#ownedWindowList
*/
Vector
ownedWindows
;
Vector
<
Window
>
ownedWindows
;
private
static
final
String
base
=
"frame"
;
private
static
int
nameCounter
=
0
;
...
...
@@ -1242,7 +1242,7 @@ public class Frame extends Window implements MenuContainer {
//
if
(
ownedWindows
!=
null
)
{
for
(
int
i
=
0
;
i
<
ownedWindows
.
size
();
i
++)
{
connectOwnedWindow
(
(
Window
)
ownedWindows
.
elementAt
(
i
));
connectOwnedWindow
(
ownedWindows
.
elementAt
(
i
));
}
ownedWindows
=
null
;
}
...
...
src/share/classes/java/awt/KeyboardFocusManager.java
浏览文件 @
93792750
...
...
@@ -416,7 +416,7 @@ public abstract class KeyboardFocusManager
}
}
static
Set
initFocusTraversalKeysSet
(
String
value
,
Set
targetSet
)
{
static
Set
<
AWTKeyStroke
>
initFocusTraversalKeysSet
(
String
value
,
Set
<
AWTKeyStroke
>
targetSet
)
{
StringTokenizer
tokens
=
new
StringTokenizer
(
value
,
","
);
while
(
tokens
.
hasMoreTokens
())
{
targetSet
.
add
(
AWTKeyStroke
.
getAWTKeyStroke
(
tokens
.
nextToken
()));
...
...
src/share/classes/java/awt/Scrollbar.java
浏览文件 @
93792750
...
...
@@ -1012,7 +1012,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible {
* @since 1.4
*/
public
synchronized
AdjustmentListener
[]
getAdjustmentListeners
()
{
return
(
AdjustmentListener
[])(
getListeners
(
AdjustmentListener
.
class
)
);
return
getListeners
(
AdjustmentListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/TextArea.java
浏览文件 @
93792750
...
...
@@ -123,7 +123,7 @@ public class TextArea extends TextComponent {
* Cache the Sets of forward and backward traversal keys so we need not
* look them up each time.
*/
private
static
Set
forwardTraversalKeys
,
backwardTraversalKeys
;
private
static
Set
<
AWTKeyStroke
>
forwardTraversalKeys
,
backwardTraversalKeys
;
/*
* JDK 1.1 serialVersionUID
...
...
@@ -143,10 +143,10 @@ public class TextArea extends TextComponent {
}
forwardTraversalKeys
=
KeyboardFocusManager
.
initFocusTraversalKeysSet
(
"ctrl TAB"
,
new
HashSet
());
new
HashSet
<
AWTKeyStroke
>
());
backwardTraversalKeys
=
KeyboardFocusManager
.
initFocusTraversalKeysSet
(
"ctrl shift TAB"
,
new
HashSet
());
new
HashSet
<
AWTKeyStroke
>
());
}
/**
...
...
src/share/classes/java/awt/TextComponent.java
浏览文件 @
93792750
...
...
@@ -606,7 +606,7 @@ public class TextComponent extends Component implements Accessible {
* @since 1.4
*/
public
synchronized
TextListener
[]
getTextListeners
()
{
return
(
TextListener
[])(
getListeners
(
TextListener
.
class
)
);
return
getListeners
(
TextListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/TextField.java
浏览文件 @
93792750
...
...
@@ -507,7 +507,7 @@ public class TextField extends TextComponent {
* @since 1.4
*/
public
synchronized
ActionListener
[]
getActionListeners
()
{
return
(
ActionListener
[])(
getListeners
(
ActionListener
.
class
)
);
return
getListeners
(
ActionListener
.
class
);
}
/**
...
...
src/share/classes/java/awt/Toolkit.java
浏览文件 @
93792750
...
...
@@ -863,7 +863,7 @@ public abstract class Toolkit {
new
java
.
security
.
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
String
nm
=
null
;
Class
cls
=
null
;
Class
<?>
cls
=
null
;
try
{
nm
=
System
.
getProperty
(
"awt.toolkit"
);
try
{
...
...
src/share/classes/java/awt/Window.java
浏览文件 @
93792750
...
...
@@ -441,7 +441,7 @@ public class Window extends Container implements Accessible {
transient
Object
anchor
=
new
Object
();
static
class
WindowDisposerRecord
implements
sun
.
java2d
.
DisposerRecord
{
final
WeakReference
<
Window
>
owner
;
final
WeakReference
weakThis
;
final
WeakReference
<
Window
>
weakThis
;
final
WeakReference
<
AppContext
>
context
;
WindowDisposerRecord
(
AppContext
context
,
Window
victim
)
{
owner
=
new
WeakReference
<
Window
>(
victim
.
getOwner
());
...
...
@@ -1542,6 +1542,7 @@ public class Window extends Container implements Accessible {
private
static
Window
[]
getWindows
(
AppContext
appContext
)
{
synchronized
(
Window
.
class
)
{
Window
realCopy
[];
@SuppressWarnings
(
"unchecked"
)
Vector
<
WeakReference
<
Window
>>
windowList
=
(
Vector
<
WeakReference
<
Window
>>)
appContext
.
get
(
Window
.
class
);
if
(
windowList
!=
null
)
{
...
...
@@ -1866,7 +1867,7 @@ public class Window extends Container implements Accessible {
* @since 1.4
*/
public
synchronized
WindowListener
[]
getWindowListeners
()
{
return
(
WindowListener
[])(
getListeners
(
WindowListener
.
class
)
);
return
getListeners
(
WindowListener
.
class
);
}
/**
...
...
@@ -1882,7 +1883,7 @@ public class Window extends Container implements Accessible {
* @since 1.4
*/
public
synchronized
WindowFocusListener
[]
getWindowFocusListeners
()
{
return
(
WindowFocusListener
[])(
getListeners
(
WindowFocusListener
.
class
)
);
return
getListeners
(
WindowFocusListener
.
class
);
}
/**
...
...
@@ -1898,7 +1899,7 @@ public class Window extends Container implements Accessible {
* @since 1.4
*/
public
synchronized
WindowStateListener
[]
getWindowStateListeners
()
{
return
(
WindowStateListener
[])(
getListeners
(
WindowStateListener
.
class
)
);
return
getListeners
(
WindowStateListener
.
class
);
}
...
...
@@ -2014,7 +2015,6 @@ public class Window extends Container implements Accessible {
break
;
case
WindowEvent
.
WINDOW_STATE_CHANGED
:
processWindowStateEvent
((
WindowEvent
)
e
);
default
:
break
;
}
return
;
...
...
@@ -2382,12 +2382,14 @@ public class Window extends Container implements Accessible {
* KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
* @since 1.4
*/
@SuppressWarnings
(
"unchecked"
)
public
Set
<
AWTKeyStroke
>
getFocusTraversalKeys
(
int
id
)
{
if
(
id
<
0
||
id
>=
KeyboardFocusManager
.
TRAVERSAL_KEY_LENGTH
)
{
throw
new
IllegalArgumentException
(
"invalid focus traversal key identifier"
);
}
// Okay to return Set directly because it is an unmodifiable view
@SuppressWarnings
(
"rawtypes"
)
Set
keystrokes
=
(
focusTraversalKeys
!=
null
)
?
focusTraversalKeys
[
id
]
:
null
;
...
...
@@ -2765,7 +2767,7 @@ public class Window extends Container implements Accessible {
/*
* Support for tracking all windows owned by this window
*/
void
addOwnedWindow
(
WeakReference
weakWindow
)
{
void
addOwnedWindow
(
WeakReference
<
Window
>
weakWindow
)
{
if
(
weakWindow
!=
null
)
{
synchronized
(
ownedWindowList
)
{
// this if statement should really be an assert, but we don't
...
...
@@ -2777,7 +2779,7 @@ public class Window extends Container implements Accessible {
}
}
void
removeOwnedWindow
(
WeakReference
weakWindow
)
{
void
removeOwnedWindow
(
WeakReference
<
Window
>
weakWindow
)
{
if
(
weakWindow
!=
null
)
{
// synchronized block not required since removeElement is
// already synchronized
...
...
@@ -2792,6 +2794,7 @@ public class Window extends Container implements Accessible {
private
void
addToWindowList
()
{
synchronized
(
Window
.
class
)
{
@SuppressWarnings
(
"unchecked"
)
Vector
<
WeakReference
<
Window
>>
windowList
=
(
Vector
<
WeakReference
<
Window
>>)
appContext
.
get
(
Window
.
class
);
if
(
windowList
==
null
)
{
windowList
=
new
Vector
<
WeakReference
<
Window
>>();
...
...
@@ -2801,8 +2804,9 @@ public class Window extends Container implements Accessible {
}
}
private
static
void
removeFromWindowList
(
AppContext
context
,
WeakReference
weakThis
)
{
private
static
void
removeFromWindowList
(
AppContext
context
,
WeakReference
<
Window
>
weakThis
)
{
synchronized
(
Window
.
class
)
{
@SuppressWarnings
(
"unchecked"
)
Vector
<
WeakReference
<
Window
>>
windowList
=
(
Vector
<
WeakReference
<
Window
>>)
context
.
get
(
Window
.
class
);
if
(
windowList
!=
null
)
{
windowList
.
remove
(
weakThis
);
...
...
@@ -2945,7 +2949,7 @@ public class Window extends Container implements Accessible {
// Deserialized Windows are not yet visible.
visible
=
false
;
weakThis
=
new
WeakReference
(
this
);
weakThis
=
new
WeakReference
<>
(
this
);
anchor
=
new
Object
();
sun
.
java2d
.
Disposer
.
addRecord
(
anchor
,
new
WindowDisposerRecord
(
appContext
,
this
));
...
...
@@ -2956,7 +2960,7 @@ public class Window extends Container implements Accessible {
private
void
deserializeResources
(
ObjectInputStream
s
)
throws
ClassNotFoundException
,
IOException
,
HeadlessException
{
ownedWindowList
=
new
Vector
();
ownedWindowList
=
new
Vector
<>
();
if
(
windowSerializedDataVersion
<
2
)
{
// Translate old-style focus tracking to new model. For 1.4 and
...
...
src/share/classes/sun/awt/image/SurfaceManager.java
浏览文件 @
93792750
...
...
@@ -88,7 +88,7 @@ public abstract class SurfaceManager {
imgaccessor
.
setSurfaceManager
(
img
,
mgr
);
}
private
ConcurrentHashMap
cacheMap
;
private
ConcurrentHashMap
<
Object
,
Object
>
cacheMap
;
/**
* Return an arbitrary cached object for an arbitrary cache key.
...
...
@@ -123,7 +123,7 @@ public abstract class SurfaceManager {
if
(
cacheMap
==
null
)
{
synchronized
(
this
)
{
if
(
cacheMap
==
null
)
{
cacheMap
=
new
ConcurrentHashMap
(
2
);
cacheMap
=
new
ConcurrentHashMap
<>
(
2
);
}
}
}
...
...
@@ -245,7 +245,7 @@ public abstract class SurfaceManager {
synchronized
void
flush
(
boolean
deaccelerate
)
{
if
(
cacheMap
!=
null
)
{
Iterator
i
=
cacheMap
.
values
().
iterator
();
Iterator
<
Object
>
i
=
cacheMap
.
values
().
iterator
();
while
(
i
.
hasNext
())
{
Object
o
=
i
.
next
();
if
(
o
instanceof
FlushableCacheData
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录