Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d0ad57b0
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看板
提交
d0ad57b0
编写于
2月 25, 2015
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8043393: NullPointerException and no event received when clipboard data flavor changes
Reviewed-by: ant, azvegint
上级
964e5eb6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
16 deletion
+13
-16
src/share/classes/sun/awt/datatransfer/SunClipboard.java
src/share/classes/sun/awt/datatransfer/SunClipboard.java
+13
-16
未找到文件。
src/share/classes/sun/awt/datatransfer/SunClipboard.java
浏览文件 @
d0ad57b0
/*
* Copyright (c) 1999, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
15
, 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
...
...
@@ -39,7 +39,7 @@ import java.awt.datatransfer.UnsupportedFlavorException;
import
java.beans.PropertyChangeEvent
;
import
java.beans.PropertyChangeListener
;
import
java.util.Arrays
;
import
java.util.Iterator
;
import
java.util.Set
;
import
java.util.HashSet
;
...
...
@@ -75,12 +75,11 @@ public abstract class SunClipboard extends Clipboard
private
volatile
int
numberOfFlavorListeners
=
0
;
/**
* A set of
<code>DataFlavor</code>s that is available on
*
this clipboard. It is used for tracking change
s
*
of <code>DataFlavor</code>s available on this clipboard
.
* A set of
{@code DataFlavor}s that is available on this clipboard. It is
*
used for tracking changes of {@code DataFlavor}s available on thi
s
*
clipboard. Can be {@code null}
.
*/
private
volatile
Set
currentDataFlavors
;
private
volatile
long
[]
currentFormats
;
public
SunClipboard
(
String
name
)
{
super
(
name
);
...
...
@@ -367,11 +366,11 @@ public abstract class SunClipboard extends Clipboard
try
{
openClipboard
(
null
);
currentFormats
=
getClipboardFormats
();
}
catch
(
IllegalStateException
exc
)
{
}
catch
(
final
IllegalStateException
ignored
)
{
}
finally
{
closeClipboard
();
}
currentDataFlavors
=
formatArrayAsDataFlavorSet
(
currentFormats
)
;
this
.
currentFormats
=
currentFormats
;
registerClipboardViewerChecked
();
}
...
...
@@ -391,7 +390,7 @@ public abstract class SunClipboard extends Clipboard
if
(
contextFlavorListeners
.
remove
(
listener
)
&&
--
numberOfFlavorListeners
==
0
)
{
unregisterClipboardViewerChecked
();
current
DataFlavor
s
=
null
;
current
Format
s
=
null
;
}
}
...
...
@@ -420,17 +419,15 @@ public abstract class SunClipboard extends Clipboard
* @param formats data formats that have just been retrieved from
* this clipboard
*/
public
void
checkChange
(
long
[]
formats
)
{
Set
prevDataFlavors
=
currentDataFlavors
;
currentDataFlavors
=
formatArrayAsDataFlavorSet
(
formats
);
if
((
prevDataFlavors
!=
null
)
&&
(
currentDataFlavors
!=
null
)
&&
prevDataFlavors
.
equals
(
currentDataFlavors
))
{
public
final
void
checkChange
(
final
long
[]
formats
)
{
if
(
Arrays
.
equals
(
formats
,
currentFormats
))
{
// we've been able to successfully get available on the clipboard
// DataFlavors this and previous time and they are coincident;
// don't notify
return
;
}
currentFormats
=
formats
;
class
SunFlavorChangeNotifier
implements
Runnable
{
private
final
FlavorListener
flavorListener
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录