Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b74bb9c1
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看板
提交
b74bb9c1
编写于
3月 12, 2014
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8029893: Remove reflection from DataTransferer.getInstance
Reviewed-by: anthony, serb
上级
d245e832
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
61 addition
and
137 deletion
+61
-137
src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java
src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java
+1
-1
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+7
-3
src/share/classes/java/awt/datatransfer/DataFlavor.java
src/share/classes/java/awt/datatransfer/DataFlavor.java
+4
-5
src/share/classes/sun/awt/HToolkit.java
src/share/classes/sun/awt/HToolkit.java
+8
-1
src/share/classes/sun/awt/SunToolkit.java
src/share/classes/sun/awt/SunToolkit.java
+4
-14
src/share/classes/sun/awt/datatransfer/DataTransferer.java
src/share/classes/sun/awt/datatransfer/DataTransferer.java
+15
-90
src/solaris/classes/sun/awt/X11/XDataTransferer.java
src/solaris/classes/sun/awt/X11/XDataTransferer.java
+5
-7
src/solaris/classes/sun/awt/X11/XToolkit.java
src/solaris/classes/sun/awt/X11/XToolkit.java
+7
-4
src/windows/classes/sun/awt/windows/WDataTransferer.java
src/windows/classes/sun/awt/windows/WDataTransferer.java
+3
-7
src/windows/classes/sun/awt/windows/WToolkit.java
src/windows/classes/sun/awt/windows/WToolkit.java
+7
-5
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CDataTransferer.java
浏览文件 @
b74bb9c1
...
@@ -89,7 +89,7 @@ public class CDataTransferer extends DataTransferer {
...
@@ -89,7 +89,7 @@ public class CDataTransferer extends DataTransferer {
private
static
CDataTransferer
fTransferer
;
private
static
CDataTransferer
fTransferer
;
public
static
synchronized
CDataTransferer
getInstanceImpl
()
{
static
synchronized
CDataTransferer
getInstanceImpl
()
{
if
(
fTransferer
==
null
)
{
if
(
fTransferer
==
null
)
{
fTransferer
=
new
CDataTransferer
();
fTransferer
=
new
CDataTransferer
();
}
}
...
...
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2011, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
4
, 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
...
@@ -42,6 +42,7 @@ import java.util.concurrent.Callable;
...
@@ -42,6 +42,7 @@ import java.util.concurrent.Callable;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
sun.awt.*
;
import
sun.awt.*
;
import
sun.awt.datatransfer.DataTransferer
;
import
sun.lwawt.*
;
import
sun.lwawt.*
;
import
sun.lwawt.LWWindowPeer.PeerType
;
import
sun.lwawt.LWWindowPeer.PeerType
;
import
sun.security.action.GetBooleanAction
;
import
sun.security.action.GetBooleanAction
;
...
@@ -112,8 +113,6 @@ public final class LWCToolkit extends LWToolkit {
...
@@ -112,8 +113,6 @@ public final class LWCToolkit extends LWToolkit {
private
static
final
boolean
inAWT
;
private
static
final
boolean
inAWT
;
public
LWCToolkit
()
{
public
LWCToolkit
()
{
SunToolkit
.
setDataTransfererClassName
(
"sun.lwawt.macosx.CDataTransferer"
);
areExtraMouseButtonsEnabled
=
Boolean
.
parseBoolean
(
System
.
getProperty
(
"sun.awt.enableExtraMouseButtons"
,
"true"
));
areExtraMouseButtonsEnabled
=
Boolean
.
parseBoolean
(
System
.
getProperty
(
"sun.awt.enableExtraMouseButtons"
,
"true"
));
//set system property if not yet assigned
//set system property if not yet assigned
System
.
setProperty
(
"sun.awt.enableExtraMouseButtons"
,
""
+
areExtraMouseButtonsEnabled
);
System
.
setProperty
(
"sun.awt.enableExtraMouseButtons"
,
""
+
areExtraMouseButtonsEnabled
);
...
@@ -441,6 +440,11 @@ public final class LWCToolkit extends LWToolkit {
...
@@ -441,6 +440,11 @@ public final class LWCToolkit extends LWToolkit {
return
true
;
return
true
;
}
}
@Override
public
DataTransferer
getDataTransferer
()
{
return
CDataTransferer
.
getInstanceImpl
();
}
@Override
@Override
public
boolean
isAlwaysOnTopSupported
()
{
public
boolean
isAlwaysOnTopSupported
()
{
return
true
;
return
true
;
...
...
src/share/classes/java/awt/datatransfer/DataFlavor.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
4
, 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
...
@@ -570,7 +570,7 @@ public class DataFlavor implements Externalizable, Cloneable {
...
@@ -570,7 +570,7 @@ public class DataFlavor implements Externalizable, Cloneable {
if
(
DataTransferer
.
isFlavorCharsetTextType
(
this
)
&&
if
(
DataTransferer
.
isFlavorCharsetTextType
(
this
)
&&
(
isRepresentationClassInputStream
()
||
(
isRepresentationClassInputStream
()
||
isRepresentationClassByteBuffer
()
||
isRepresentationClassByteBuffer
()
||
DataTransferer
.
byteArrayC
lass
.
equals
(
representationClass
)))
byte
[].
c
lass
.
equals
(
representationClass
)))
{
{
params
+=
";charset="
+
DataTransferer
.
getTextCharset
(
this
);
params
+=
";charset="
+
DataTransferer
.
getTextCharset
(
this
);
}
}
...
@@ -1015,7 +1015,7 @@ public class DataFlavor implements Externalizable, Cloneable {
...
@@ -1015,7 +1015,7 @@ public class DataFlavor implements Externalizable, Cloneable {
!(
isRepresentationClassReader
()
||
!(
isRepresentationClassReader
()
||
String
.
class
.
equals
(
representationClass
)
||
String
.
class
.
equals
(
representationClass
)
||
isRepresentationClassCharBuffer
()
||
isRepresentationClassCharBuffer
()
||
DataTransferer
.
charArrayC
lass
.
equals
(
representationClass
)))
char
[].
c
lass
.
equals
(
representationClass
)))
{
{
String
thisCharset
=
String
thisCharset
=
DataTransferer
.
canonicalName
(
getParameter
(
"charset"
));
DataTransferer
.
canonicalName
(
getParameter
(
"charset"
));
...
@@ -1100,8 +1100,7 @@ public class DataFlavor implements Externalizable, Cloneable {
...
@@ -1100,8 +1100,7 @@ public class DataFlavor implements Externalizable, Cloneable {
!(
isRepresentationClassReader
()
||
!(
isRepresentationClassReader
()
||
String
.
class
.
equals
(
representationClass
)
||
String
.
class
.
equals
(
representationClass
)
||
isRepresentationClassCharBuffer
()
||
isRepresentationClassCharBuffer
()
||
DataTransferer
.
charArrayClass
.
equals
char
[].
class
.
equals
(
representationClass
)))
(
representationClass
)))
{
{
String
charset
=
String
charset
=
DataTransferer
.
canonicalName
(
getParameter
(
"charset"
));
DataTransferer
.
canonicalName
(
getParameter
(
"charset"
));
...
...
src/share/classes/sun/awt/HToolkit.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2011, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
4
, 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
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
package
sun.awt
;
package
sun.awt
;
import
sun.awt.datatransfer.DataTransferer
;
import
java.awt.*
;
import
java.awt.*
;
import
java.awt.dnd.*
;
import
java.awt.dnd.*
;
import
java.awt.dnd.peer.DragSourceContextPeer
;
import
java.awt.dnd.peer.DragSourceContextPeer
;
...
@@ -184,6 +186,11 @@ public class HToolkit extends SunToolkit
...
@@ -184,6 +186,11 @@ public class HToolkit extends SunToolkit
return
false
;
return
false
;
}
}
@Override
public
DataTransferer
getDataTransferer
()
{
return
null
;
}
public
GlobalCursorManager
getGlobalCursorManager
()
public
GlobalCursorManager
getGlobalCursorManager
()
throws
HeadlessException
{
throws
HeadlessException
{
throw
new
HeadlessException
();
throw
new
HeadlessException
();
...
...
src/share/classes/sun/awt/SunToolkit.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, 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
...
@@ -46,6 +46,7 @@ import java.util.concurrent.locks.Condition;
...
@@ -46,6 +46,7 @@ import java.util.concurrent.locks.Condition;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
import
java.util.concurrent.locks.ReentrantLock
;
import
sun.awt.datatransfer.DataTransferer
;
import
sun.security.util.SecurityConstants
;
import
sun.security.util.SecurityConstants
;
import
sun.util.logging.PlatformLogger
;
import
sun.util.logging.PlatformLogger
;
import
sun.misc.SoftCache
;
import
sun.misc.SoftCache
;
...
@@ -203,6 +204,8 @@ public abstract class SunToolkit extends Toolkit
...
@@ -203,6 +204,8 @@ public abstract class SunToolkit extends Toolkit
public
abstract
boolean
isTraySupported
();
public
abstract
boolean
isTraySupported
();
public
abstract
DataTransferer
getDataTransferer
();
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
abstract
FontPeer
getFontPeer
(
String
name
,
int
style
);
public
abstract
FontPeer
getFontPeer
(
String
name
,
int
style
);
...
@@ -1191,19 +1194,6 @@ public abstract class SunToolkit extends Toolkit
...
@@ -1191,19 +1194,6 @@ public abstract class SunToolkit extends Toolkit
return
getStartupLocale
();
return
getStartupLocale
();
}
}
private
static
String
dataTransfererClassName
=
null
;
protected
static
void
setDataTransfererClassName
(
String
className
)
{
dataTransfererClassName
=
className
;
}
public
static
String
getDataTransfererClassName
()
{
if
(
dataTransfererClassName
==
null
)
{
Toolkit
.
getDefaultToolkit
();
// transferer set during toolkit init
}
return
dataTransfererClassName
;
}
// Support for window closing event notifications
// Support for window closing event notifications
private
transient
WindowClosingListener
windowClosingListener
=
null
;
private
transient
WindowClosingListener
windowClosingListener
=
null
;
/**
/**
...
...
src/share/classes/sun/awt/datatransfer/DataTransferer.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2000, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
4
, 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
...
@@ -25,10 +25,10 @@
...
@@ -25,10 +25,10 @@
package
sun.awt.datatransfer
;
package
sun.awt.datatransfer
;
import
java.awt.AWTError
;
import
java.awt.EventQueue
;
import
java.awt.EventQueue
;
import
java.awt.Image
;
import
java.awt.Graphics
;
import
java.awt.Graphics
;
import
java.awt.Image
;
import
java.awt.Toolkit
;
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.datatransfer.FlavorMap
;
import
java.awt.datatransfer.FlavorMap
;
...
@@ -137,16 +137,6 @@ import java.io.FilePermission;
...
@@ -137,16 +137,6 @@ import java.io.FilePermission;
*/
*/
public
abstract
class
DataTransferer
{
public
abstract
class
DataTransferer
{
/**
* Cached value of Class.forName("[C");
*/
public
static
final
Class
charArrayClass
;
/**
* Cached value of Class.forName("[B");
*/
public
static
final
Class
byteArrayClass
;
/**
/**
* The <code>DataFlavor</code> representing plain text with Unicode
* The <code>DataFlavor</code> representing plain text with Unicode
* encoding, where:
* encoding, where:
...
@@ -241,15 +231,6 @@ public abstract class DataTransferer {
...
@@ -241,15 +231,6 @@ public abstract class DataTransferer {
private
static
final
PlatformLogger
dtLog
=
PlatformLogger
.
getLogger
(
"sun.awt.datatransfer.DataTransfer"
);
private
static
final
PlatformLogger
dtLog
=
PlatformLogger
.
getLogger
(
"sun.awt.datatransfer.DataTransfer"
);
static
{
static
{
Class
tCharArrayClass
=
null
,
tByteArrayClass
=
null
;
try
{
tCharArrayClass
=
Class
.
forName
(
"[C"
);
tByteArrayClass
=
Class
.
forName
(
"[B"
);
}
catch
(
ClassNotFoundException
cannotHappen
)
{
}
charArrayClass
=
tCharArrayClass
;
byteArrayClass
=
tByteArrayClass
;
DataFlavor
tPlainTextStringFlavor
=
null
;
DataFlavor
tPlainTextStringFlavor
=
null
;
try
{
try
{
tPlainTextStringFlavor
=
new
DataFlavor
tPlainTextStringFlavor
=
new
DataFlavor
...
@@ -290,63 +271,8 @@ public abstract class DataTransferer {
...
@@ -290,63 +271,8 @@ public abstract class DataTransferer {
* that in a headless environment, there may be no DataTransferer instance;
* that in a headless environment, there may be no DataTransferer instance;
* instead, null will be returned.
* instead, null will be returned.
*/
*/
public
static
DataTransferer
getInstance
()
{
public
static
synchronized
DataTransferer
getInstance
()
{
synchronized
(
DataTransferer
.
class
)
{
return
((
SunToolkit
)
Toolkit
.
getDefaultToolkit
()).
getDataTransferer
();
if
(
transferer
==
null
)
{
final
String
name
=
SunToolkit
.
getDataTransfererClassName
();
if
(
name
!=
null
)
{
PrivilegedAction
<
DataTransferer
>
action
=
new
PrivilegedAction
<
DataTransferer
>()
{
public
DataTransferer
run
()
{
Class
cls
=
null
;
Method
method
=
null
;
DataTransferer
ret
=
null
;
try
{
cls
=
Class
.
forName
(
name
);
}
catch
(
ClassNotFoundException
e
)
{
ClassLoader
cl
=
ClassLoader
.
getSystemClassLoader
();
if
(
cl
!=
null
)
{
try
{
cls
=
cl
.
loadClass
(
name
);
}
catch
(
ClassNotFoundException
ee
)
{
ee
.
printStackTrace
();
throw
new
AWTError
(
"DataTransferer not found: "
+
name
);
}
}
}
if
(
cls
!=
null
)
{
try
{
method
=
cls
.
getDeclaredMethod
(
"getInstanceImpl"
);
method
.
setAccessible
(
true
);
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
throw
new
AWTError
(
"Cannot instantiate DataTransferer: "
+
name
);
}
catch
(
SecurityException
e
)
{
e
.
printStackTrace
();
throw
new
AWTError
(
"Access is denied for DataTransferer: "
+
name
);
}
}
if
(
method
!=
null
)
{
try
{
ret
=
(
DataTransferer
)
method
.
invoke
(
null
);
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
throw
new
AWTError
(
"Cannot instantiate DataTransferer: "
+
name
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
throw
new
AWTError
(
"Cannot access DataTransferer: "
+
name
);
}
}
return
ret
;
}
};
transferer
=
AccessController
.
doPrivileged
(
action
);
}
}
}
return
transferer
;
}
}
/**
/**
...
@@ -459,14 +385,14 @@ public abstract class DataTransferer {
...
@@ -459,14 +385,14 @@ public abstract class DataTransferer {
if
(
flavor
.
isRepresentationClassReader
()
||
if
(
flavor
.
isRepresentationClassReader
()
||
String
.
class
.
equals
(
rep_class
)
||
String
.
class
.
equals
(
rep_class
)
||
flavor
.
isRepresentationClassCharBuffer
()
||
flavor
.
isRepresentationClassCharBuffer
()
||
DataTransferer
.
charArrayC
lass
.
equals
(
rep_class
))
char
[].
c
lass
.
equals
(
rep_class
))
{
{
return
true
;
return
true
;
}
}
if
(!(
flavor
.
isRepresentationClassInputStream
()
||
if
(!(
flavor
.
isRepresentationClassInputStream
()
||
flavor
.
isRepresentationClassByteBuffer
()
||
flavor
.
isRepresentationClassByteBuffer
()
||
DataTransferer
.
byteArrayC
lass
.
equals
(
rep_class
)))
{
byte
[].
c
lass
.
equals
(
rep_class
)))
{
return
false
;
return
false
;
}
}
...
@@ -490,8 +416,7 @@ public abstract class DataTransferer {
...
@@ -490,8 +416,7 @@ public abstract class DataTransferer {
return
(
flavor
.
isRepresentationClassInputStream
()
||
return
(
flavor
.
isRepresentationClassInputStream
()
||
flavor
.
isRepresentationClassByteBuffer
()
||
flavor
.
isRepresentationClassByteBuffer
()
||
DataTransferer
.
byteArrayClass
.
byte
[].
class
.
equals
(
flavor
.
getRepresentationClass
()));
equals
(
flavor
.
getRepresentationClass
()));
}
}
/**
/**
...
@@ -1243,7 +1168,7 @@ search:
...
@@ -1243,7 +1168,7 @@ search:
format
);
format
);
// Source data is a char array. Convert to a String and recur.
// Source data is a char array. Convert to a String and recur.
}
else
if
(
char
ArrayC
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
}
else
if
(
char
[].
c
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
if
(!(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
)))
{
if
(!(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
)))
{
throw
new
IOException
throw
new
IOException
(
"cannot transfer non-text data as char array"
);
(
"cannot transfer non-text data as char array"
);
...
@@ -1274,7 +1199,7 @@ search:
...
@@ -1274,7 +1199,7 @@ search:
// Source data is a byte array. For arbitrary flavors, simply return
// Source data is a byte array. For arbitrary flavors, simply return
// the array. For text flavors, decode back to a String and recur to
// the array. For text flavors, decode back to a String and recur to
// reencode according to the requested format.
// reencode according to the requested format.
}
else
if
(
byte
ArrayC
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
}
else
if
(
byte
[].
c
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
byte
[]
bytes
=
(
byte
[])
obj
;
byte
[]
bytes
=
(
byte
[])
obj
;
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
...
@@ -1651,7 +1576,7 @@ search:
...
@@ -1651,7 +1576,7 @@ search:
// Target data is a char array. Recur to obtain String and convert to
// Target data is a char array. Recur to obtain String and convert to
// char array.
// char array.
}
else
if
(
char
ArrayC
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
}
else
if
(
char
[].
c
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
if
(!(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
)))
{
if
(!(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
)))
{
throw
new
IOException
throw
new
IOException
(
"cannot transfer non-text data as char array"
);
(
"cannot transfer non-text data as char array"
);
...
@@ -1679,7 +1604,7 @@ search:
...
@@ -1679,7 +1604,7 @@ search:
// the raw bytes. For text flavors, convert to a String to strip
// the raw bytes. For text flavors, convert to a String to strip
// terminators and search-and-replace EOLN, then reencode according to
// terminators and search-and-replace EOLN, then reencode according to
// the requested flavor.
// the requested flavor.
}
else
if
(
byte
ArrayC
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
}
else
if
(
byte
[].
c
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
theObject
=
translateBytesToString
(
theObject
=
translateBytesToString
(
bytes
,
format
,
localeTransferable
bytes
,
format
,
localeTransferable
...
@@ -1807,7 +1732,7 @@ search:
...
@@ -1807,7 +1732,7 @@ search:
theObject
=
constructFlavoredObject
(
reader
,
flavor
,
Reader
.
class
);
theObject
=
constructFlavoredObject
(
reader
,
flavor
,
Reader
.
class
);
// Target data is a byte array
// Target data is a byte array
}
else
if
(
byte
ArrayC
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
}
else
if
(
byte
[].
c
lass
.
equals
(
flavor
.
getRepresentationClass
()))
{
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
if
(
isFlavorCharsetTextType
(
flavor
)
&&
isTextFormat
(
format
))
{
theObject
=
translateBytesToString
(
inputStreamToByteArray
(
str
),
format
,
localeTransferable
)
theObject
=
translateBytesToString
(
inputStreamToByteArray
(
str
),
format
,
localeTransferable
)
.
getBytes
(
DataTransferer
.
getTextCharset
(
flavor
));
.
getBytes
(
DataTransferer
.
getTextCharset
(
flavor
));
...
@@ -2857,7 +2782,7 @@ search:
...
@@ -2857,7 +2782,7 @@ search:
HashMap
decodedTextRepresentationsMap
=
new
HashMap
(
4
,
1.0f
);
HashMap
decodedTextRepresentationsMap
=
new
HashMap
(
4
,
1.0f
);
decodedTextRepresentationsMap
.
put
decodedTextRepresentationsMap
.
put
(
DataTransferer
.
charArrayC
lass
,
Integer
.
valueOf
(
0
));
(
char
[].
c
lass
,
Integer
.
valueOf
(
0
));
decodedTextRepresentationsMap
.
put
decodedTextRepresentationsMap
.
put
(
java
.
nio
.
CharBuffer
.
class
,
Integer
.
valueOf
(
1
));
(
java
.
nio
.
CharBuffer
.
class
,
Integer
.
valueOf
(
1
));
decodedTextRepresentationsMap
.
put
decodedTextRepresentationsMap
.
put
...
@@ -2873,7 +2798,7 @@ search:
...
@@ -2873,7 +2798,7 @@ search:
HashMap
encodedTextRepresentationsMap
=
new
HashMap
(
3
,
1.0f
);
HashMap
encodedTextRepresentationsMap
=
new
HashMap
(
3
,
1.0f
);
encodedTextRepresentationsMap
.
put
encodedTextRepresentationsMap
.
put
(
DataTransferer
.
byteArrayC
lass
,
Integer
.
valueOf
(
0
));
(
byte
[].
c
lass
,
Integer
.
valueOf
(
0
));
encodedTextRepresentationsMap
.
put
encodedTextRepresentationsMap
.
put
(
java
.
nio
.
ByteBuffer
.
class
,
Integer
.
valueOf
(
1
));
(
java
.
nio
.
ByteBuffer
.
class
,
Integer
.
valueOf
(
1
));
encodedTextRepresentationsMap
.
put
encodedTextRepresentationsMap
.
put
...
...
src/solaris/classes/sun/awt/X11/XDataTransferer.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
4
, 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
...
@@ -77,12 +77,10 @@ public class XDataTransferer extends DataTransferer {
...
@@ -77,12 +77,10 @@ public class XDataTransferer extends DataTransferer {
private
static
XDataTransferer
transferer
;
private
static
XDataTransferer
transferer
;
static
XDataTransferer
getInstanceImpl
()
{
static
synchronized
XDataTransferer
getInstanceImpl
()
{
synchronized
(
XDataTransferer
.
class
)
{
if
(
transferer
==
null
)
{
if
(
transferer
==
null
)
{
transferer
=
new
XDataTransferer
();
transferer
=
new
XDataTransferer
();
}
}
}
return
transferer
;
return
transferer
;
}
}
...
@@ -411,7 +409,7 @@ public class XDataTransferer extends DataTransferer {
...
@@ -411,7 +409,7 @@ public class XDataTransferer extends DataTransferer {
if
(
df
.
getRepresentationClass
()
!=
null
&&
if
(
df
.
getRepresentationClass
()
!=
null
&&
(
df
.
isRepresentationClassInputStream
()
||
(
df
.
isRepresentationClassInputStream
()
||
df
.
isRepresentationClassByteBuffer
()
||
df
.
isRepresentationClassByteBuffer
()
||
byte
ArrayC
lass
.
equals
(
df
.
getRepresentationClass
())))
{
byte
[].
c
lass
.
equals
(
df
.
getRepresentationClass
())))
{
natives
.
add
(
mimeType
);
natives
.
add
(
mimeType
);
}
}
...
...
src/solaris/classes/sun/awt/X11/XToolkit.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2002, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
4
, 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
...
@@ -47,6 +47,7 @@ import java.util.*;
...
@@ -47,6 +47,7 @@ import java.util.*;
import
javax.swing.LookAndFeel
;
import
javax.swing.LookAndFeel
;
import
javax.swing.UIDefaults
;
import
javax.swing.UIDefaults
;
import
sun.awt.*
;
import
sun.awt.*
;
import
sun.awt.datatransfer.DataTransferer
;
import
sun.font.FontConfigManager
;
import
sun.font.FontConfigManager
;
import
sun.java2d.SunGraphicsEnvironment
;
import
sun.java2d.SunGraphicsEnvironment
;
import
sun.misc.PerformanceLogger
;
import
sun.misc.PerformanceLogger
;
...
@@ -300,8 +301,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
...
@@ -300,8 +301,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
return
awtAppClassName
;
return
awtAppClassName
;
}
}
static
final
String
DATA_TRANSFERER_CLASS_NAME
=
"sun.awt.X11.XDataTransferer"
;
public
XToolkit
()
{
public
XToolkit
()
{
super
();
super
();
if
(
PerformanceLogger
.
loggingEnabled
())
{
if
(
PerformanceLogger
.
loggingEnabled
())
{
...
@@ -323,7 +322,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
...
@@ -323,7 +322,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
init
();
init
();
XWM
.
init
();
XWM
.
init
();
SunToolkit
.
setDataTransfererClassName
(
DATA_TRANSFERER_CLASS_NAME
);
PrivilegedAction
<
Thread
>
action
=
new
PrivilegedAction
()
{
PrivilegedAction
<
Thread
>
action
=
new
PrivilegedAction
()
{
public
Thread
run
()
{
public
Thread
run
()
{
...
@@ -1125,6 +1123,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
...
@@ -1125,6 +1123,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
return
false
;
return
false
;
}
}
@Override
public
DataTransferer
getDataTransferer
()
{
return
XDataTransferer
.
getInstanceImpl
();
}
/**
/**
* Returns the supported cursor size
* Returns the supported cursor size
*/
*/
...
...
src/windows/classes/sun/awt/windows/WDataTransferer.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 2000, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
4
, 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
...
@@ -159,14 +159,10 @@ public class WDataTransferer extends DataTransferer {
...
@@ -159,14 +159,10 @@ public class WDataTransferer extends DataTransferer {
private
static
WDataTransferer
transferer
;
private
static
WDataTransferer
transferer
;
public
static
WDataTransferer
getInstanceImpl
()
{
static
synchronized
WDataTransferer
getInstanceImpl
()
{
if
(
transferer
==
null
)
{
synchronized
(
WDataTransferer
.
class
)
{
if
(
transferer
==
null
)
{
if
(
transferer
==
null
)
{
transferer
=
new
WDataTransferer
();
transferer
=
new
WDataTransferer
();
}
}
}
}
return
transferer
;
return
transferer
;
}
}
...
...
src/windows/classes/sun/awt/windows/WToolkit.java
浏览文件 @
b74bb9c1
/*
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
4
, 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
...
@@ -41,6 +41,7 @@ import sun.awt.LightweightFrame;
...
@@ -41,6 +41,7 @@ import sun.awt.LightweightFrame;
import
sun.awt.SunToolkit
;
import
sun.awt.SunToolkit
;
import
sun.awt.Win32GraphicsDevice
;
import
sun.awt.Win32GraphicsDevice
;
import
sun.awt.Win32GraphicsEnvironment
;
import
sun.awt.Win32GraphicsEnvironment
;
import
sun.awt.datatransfer.DataTransferer
;
import
sun.java2d.d3d.D3DRenderQueue
;
import
sun.java2d.d3d.D3DRenderQueue
;
import
sun.java2d.opengl.OGLRenderQueue
;
import
sun.java2d.opengl.OGLRenderQueue
;
...
@@ -210,8 +211,6 @@ public class WToolkit extends SunToolkit implements Runnable {
...
@@ -210,8 +211,6 @@ public class WToolkit extends SunToolkit implements Runnable {
*/
*/
public
native
void
embeddedEventLoopIdleProcessing
();
public
native
void
embeddedEventLoopIdleProcessing
();
public
static
final
String
DATA_TRANSFERER_CLASS_NAME
=
"sun.awt.windows.WDataTransferer"
;
static
class
ToolkitDisposer
implements
sun
.
java2d
.
DisposerRecord
{
static
class
ToolkitDisposer
implements
sun
.
java2d
.
DisposerRecord
{
public
void
dispose
()
{
public
void
dispose
()
{
WToolkit
.
postDispose
();
WToolkit
.
postDispose
();
...
@@ -255,8 +254,6 @@ public class WToolkit extends SunToolkit implements Runnable {
...
@@ -255,8 +254,6 @@ public class WToolkit extends SunToolkit implements Runnable {
// swallow the exception
// swallow the exception
}
}
SunToolkit
.
setDataTransfererClassName
(
DATA_TRANSFERER_CLASS_NAME
);
// Enabled "live resizing" by default. It remains controlled
// Enabled "live resizing" by default. It remains controlled
// by the native system though.
// by the native system though.
setDynamicLayout
(
true
);
setDynamicLayout
(
true
);
...
@@ -514,6 +511,11 @@ public class WToolkit extends SunToolkit implements Runnable {
...
@@ -514,6 +511,11 @@ public class WToolkit extends SunToolkit implements Runnable {
return
true
;
return
true
;
}
}
@Override
public
DataTransferer
getDataTransferer
()
{
return
WDataTransferer
.
getInstanceImpl
();
}
public
KeyboardFocusManagerPeer
getKeyboardFocusManagerPeer
()
public
KeyboardFocusManagerPeer
getKeyboardFocusManagerPeer
()
throws
HeadlessException
throws
HeadlessException
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录