Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8d1fe65a
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,发现更多精彩内容 >>
提交
8d1fe65a
编写于
4月 18, 2014
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8038962: KSS: javax.swing.text.html[.parser].ResourceLoader
Reviewed-by: alexsch, serb
上级
a9993d6f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
151 deletion
+28
-151
src/share/classes/javax/swing/text/html/HTMLEditorKit.java
src/share/classes/javax/swing/text/html/HTMLEditorKit.java
+9
-10
src/share/classes/javax/swing/text/html/ResourceLoader.java
src/share/classes/javax/swing/text/html/ResourceLoader.java
+0
-60
src/share/classes/javax/swing/text/html/parser/ParserDelegator.java
...classes/javax/swing/text/html/parser/ParserDelegator.java
+9
-9
src/share/classes/javax/swing/text/html/parser/ResourceLoader.java
.../classes/javax/swing/text/html/parser/ResourceLoader.java
+0
-60
src/share/classes/javax/swing/text/rtf/RTFReader.java
src/share/classes/javax/swing/text/rtf/RTFReader.java
+10
-12
未找到文件。
src/share/classes/javax/swing/text/html/HTMLEditorKit.java
浏览文件 @
8d1fe65a
...
...
@@ -26,7 +26,6 @@ package javax.swing.text.html;
import
sun.awt.AppContext
;
import
java.lang.reflect.Method
;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.io.*
;
...
...
@@ -34,12 +33,13 @@ import java.net.MalformedURLException;
import
java.net.URL
;
import
javax.swing.text.*
;
import
javax.swing.*
;
import
javax.swing.border.*
;
import
javax.swing.event.*
;
import
javax.swing.plaf.TextUI
;
import
java.util.*
;
import
javax.accessibility.*
;
import
java.lang.ref.*
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
/**
* The Swing JEditorPane text component supports different kinds
...
...
@@ -414,14 +414,13 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
* HTMLEditorKit class
* @return a stream representing the resource
*/
static
InputStream
getResourceAsStream
(
String
name
)
{
try
{
return
ResourceLoader
.
getResourceAsStream
(
name
);
}
catch
(
Throwable
e
)
{
// If the class doesn't exist or we have some other
// problem we just try to call getResourceAsStream directly.
return
HTMLEditorKit
.
class
.
getResourceAsStream
(
name
);
}
static
InputStream
getResourceAsStream
(
final
String
name
)
{
return
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
InputStream
>()
{
public
InputStream
run
()
{
return
HTMLEditorKit
.
class
.
getResourceAsStream
(
name
);
}
});
}
/**
...
...
src/share/classes/javax/swing/text/html/ResourceLoader.java
已删除
100644 → 0
浏览文件 @
a9993d6f
/*
* Copyright (c) 1999, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
javax.swing.text.html
;
import
java.io.InputStream
;
/**
* Simple class to load resources using the 1.2
* security model. Since the html support is loaded
* lazily, it's resources are potentially fetched with
* applet code in the call stack. By providing this
* functionality in a class that is only built on 1.2,
* reflection can be used from the code that is also
* built on 1.1 to call this functionality (and avoid
* the evils of preprocessing). This functionality
* is called from HTMLEditorKit.getResourceAsStream.
*
* @author Timothy Prinzing
*/
class
ResourceLoader
implements
java
.
security
.
PrivilegedAction
{
ResourceLoader
(
String
name
)
{
this
.
name
=
name
;
}
public
Object
run
()
{
Object
o
=
HTMLEditorKit
.
class
.
getResourceAsStream
(
name
);
return
o
;
}
public
static
InputStream
getResourceAsStream
(
String
name
)
{
java
.
security
.
PrivilegedAction
a
=
new
ResourceLoader
(
name
);
return
(
InputStream
)
java
.
security
.
AccessController
.
doPrivileged
(
a
);
}
private
String
name
;
}
src/share/classes/javax/swing/text/html/parser/ParserDelegator.java
浏览文件 @
8d1fe65a
...
...
@@ -22,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
javax.swing.text.html.parser
;
import
sun.awt.AppContext
;
...
...
@@ -35,6 +34,8 @@ import java.io.DataInputStream;
import
java.io.ObjectInputStream
;
import
java.io.Reader
;
import
java.io.Serializable
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
/**
* Responsible for starting up a new DocumentParser
...
...
@@ -111,14 +112,13 @@ public class ParserDelegator extends HTMLEditorKit.Parser implements Serializabl
* ParserDelegator class.
* @returns a stream representing the resource
*/
static
InputStream
getResourceAsStream
(
String
name
)
{
try
{
return
ResourceLoader
.
getResourceAsStream
(
name
);
}
catch
(
Throwable
e
)
{
// If the class doesn't exist or we have some other
// problem we just try to call getResourceAsStream directly.
return
ParserDelegator
.
class
.
getResourceAsStream
(
name
);
}
static
InputStream
getResourceAsStream
(
final
String
name
)
{
return
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
InputStream
>()
{
public
InputStream
run
()
{
return
ParserDelegator
.
class
.
getResourceAsStream
(
name
);
}
});
}
private
void
readObject
(
ObjectInputStream
s
)
...
...
src/share/classes/javax/swing/text/html/parser/ResourceLoader.java
已删除
100644 → 0
浏览文件 @
a9993d6f
/*
* Copyright (c) 1999, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
javax.swing.text.html.parser
;
import
java.io.InputStream
;
/**
* Simple class to load resources using the 1.2
* security model. Since the html support is loaded
* lazily, it's resources are potentially fetched with
* applet code in the call stack. By providing this
* functionality in a class that is only built on 1.2,
* reflection can be used from the code that is also
* built on 1.1 to call this functionality (and avoid
* the evils of preprocessing). This functionality
* is called from ParserDelegator.getResourceAsStream.
*
* @author Timothy Prinzing
*/
class
ResourceLoader
implements
java
.
security
.
PrivilegedAction
{
ResourceLoader
(
String
name
)
{
this
.
name
=
name
;
}
public
Object
run
()
{
Object
o
=
ParserDelegator
.
class
.
getResourceAsStream
(
name
);
return
o
;
}
public
static
InputStream
getResourceAsStream
(
String
name
)
{
java
.
security
.
PrivilegedAction
a
=
new
ResourceLoader
(
name
);
return
(
InputStream
)
java
.
security
.
AccessController
.
doPrivileged
(
a
);
}
private
String
name
;
}
src/share/classes/javax/swing/text/rtf/RTFReader.java
浏览文件 @
8d1fe65a
...
...
@@ -27,9 +27,9 @@ package javax.swing.text.rtf;
import
java.lang.*
;
import
java.util.*
;
import
java.io.*
;
import
java.awt.Font
;
import
java.awt.Color
;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
javax.swing.text.*
;
/**
...
...
@@ -558,16 +558,14 @@ getCharacterSet(final String name)
{
char
[]
set
=
characterSets
.
get
(
name
);
if
(
set
==
null
)
{
InputStream
charsetStream
;
charsetStream
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
InputStream
>()
{
public
InputStream
run
()
{
return
RTFReader
.
class
.
getResourceAsStream
(
"charsets/"
+
name
+
".txt"
);
}
});
set
=
readCharset
(
charsetStream
);
defineCharacterSet
(
name
,
set
);
InputStream
charsetStream
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
InputStream
>()
{
public
InputStream
run
()
{
return
RTFReader
.
class
.
getResourceAsStream
(
"charsets/"
+
name
+
".txt"
);
}
});
set
=
readCharset
(
charsetStream
);
defineCharacterSet
(
name
,
set
);
}
return
set
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录