Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ad5d7da0
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看板
提交
ad5d7da0
编写于
2月 25, 2011
作者:
M
mchung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7016707: Remove the BootClassLoaderHook for jkernel support
Reviewed-by: alanb, ohair
上级
e9ce96bb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
2 addition
and
289 deletion
+2
-289
make/java/java/FILES_java.gmk
make/java/java/FILES_java.gmk
+0
-1
src/share/classes/java/awt/color/ICC_Profile.java
src/share/classes/java/awt/color/ICC_Profile.java
+1
-3
src/share/classes/java/lang/ClassLoader.java
src/share/classes/java/lang/ClassLoader.java
+0
-3
src/share/classes/java/util/zip/ZipEntry.java
src/share/classes/java/util/zip/ZipEntry.java
+0
-1
src/share/classes/sun/misc/BootClassLoaderHook.java
src/share/classes/sun/misc/BootClassLoaderHook.java
+0
-141
src/share/classes/sun/misc/Launcher.java
src/share/classes/sun/misc/Launcher.java
+1
-28
test/sun/misc/BootClassLoaderHook/TestHook.java
test/sun/misc/BootClassLoaderHook/TestHook.java
+0
-112
未找到文件。
make/java/java/FILES_java.gmk
浏览文件 @
ad5d7da0
...
...
@@ -466,7 +466,6 @@ JAVA_JAVA_java = \
java/security/ProtectionDomain.java \
java/net/URLClassLoader.java \
java/net/URLConnection.java \
sun/misc/BootClassLoaderHook.java \
sun/misc/Launcher.java \
sun/misc/MetaIndex.java \
sun/misc/URLClassPath.java \
...
...
src/share/classes/java/awt/color/ICC_Profile.java
浏览文件 @
ad5d7da0
...
...
@@ -58,7 +58,6 @@ import java.util.StringTokenizer;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
sun.misc.BootClassLoaderHook
;
/**
* A representation of color profile data for device independent and
...
...
@@ -865,8 +864,7 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_PYCC
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
PYCCprofile
==
null
)
{
if
(
BootClassLoaderHook
.
getHook
()
!=
null
||
standardProfileExists
(
"PYCC.pf"
))
if
(
standardProfileExists
(
"PYCC.pf"
))
{
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"PYCC.pf"
,
...
...
src/share/classes/java/lang/ClassLoader.java
浏览文件 @
ad5d7da0
...
...
@@ -51,7 +51,6 @@ import java.util.Vector;
import
java.util.Hashtable
;
import
java.util.WeakHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
sun.misc.BootClassLoaderHook
;
import
sun.misc.ClassFileTransformer
;
import
sun.misc.CompoundEnumeration
;
import
sun.misc.Resource
;
...
...
@@ -1300,7 +1299,6 @@ public abstract class ClassLoader {
* Find resources from the VM's built-in classloader.
*/
private
static
URL
getBootstrapResource
(
String
name
)
{
BootClassLoaderHook
.
preLoadResource
(
name
);
URLClassPath
ucp
=
getBootstrapClassPath
();
Resource
res
=
ucp
.
getResource
(
name
);
return
res
!=
null
?
res
.
getURL
()
:
null
;
...
...
@@ -1814,7 +1812,6 @@ public abstract class ClassLoader {
// Invoked in the java.lang.Runtime class to implement load and loadLibrary.
static
void
loadLibrary
(
Class
fromClass
,
String
name
,
boolean
isAbsolute
)
{
BootClassLoaderHook
.
preLoadLibrary
(
name
);
ClassLoader
loader
=
(
fromClass
==
null
)
?
null
:
fromClass
.
getClassLoader
();
if
(
sys_paths
==
null
)
{
...
...
src/share/classes/java/util/zip/ZipEntry.java
浏览文件 @
ad5d7da0
...
...
@@ -26,7 +26,6 @@
package
java.util.zip
;
import
java.util.Date
;
import
sun.misc.BootClassLoaderHook
;
/**
* This class is used to represent a ZIP file entry.
...
...
src/share/classes/sun/misc/BootClassLoaderHook.java
已删除
100644 → 0
浏览文件 @
e9ce96bb
/*
* Copyright (c) 2009, 2010, 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
sun.misc
;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.URLStreamHandlerFactory
;
import
sun.misc.URLClassPath
;
/**
* BootClassLoaderHook defines an interface for a hook to inject
* into the bootstrap class loader.
*
* With jkernel now removed, no hook is set
*/
public
abstract
class
BootClassLoaderHook
{
private
static
BootClassLoaderHook
bootLoaderHook
=
null
;
public
static
synchronized
BootClassLoaderHook
getHook
()
{
return
bootLoaderHook
;
}
public
static
synchronized
void
setHook
(
BootClassLoaderHook
hook
)
{
if
(!
VM
.
isBooted
())
{
throw
new
InternalError
(
"hook can only be set after VM is booted"
);
}
if
(
bootLoaderHook
!=
null
)
{
throw
new
InternalError
(
"hook should not be reinitialized"
);
}
bootLoaderHook
=
hook
;
}
protected
BootClassLoaderHook
()
{
}
/**
* A method to be invoked before a class loader loads
* a bootstrap class.
*
* @param classname the binary name of the class
*/
public
static
void
preLoadClass
(
String
classname
)
{
BootClassLoaderHook
hook
=
getHook
();
if
(
hook
!=
null
)
{
hook
.
loadBootstrapClass
(
classname
);
}
}
/**
* A method to be invoked before a class loader loads
* a resource.
*
* @param resourcename the resource name
*/
public
static
void
preLoadResource
(
String
resourcename
)
{
BootClassLoaderHook
hook
=
getHook
();
if
(
hook
!=
null
)
{
hook
.
getBootstrapResource
(
resourcename
);
}
}
/**
* A method to be invoked before a library is loaded.
*
* @param libname the name of the library
*/
public
static
void
preLoadLibrary
(
String
libname
)
{
BootClassLoaderHook
hook
=
getHook
();
if
(
hook
!=
null
)
{
hook
.
loadLibrary
(
libname
);
}
}
/**
* Returns a pathname of a JAR or class that the hook loads
* per this loadClass request; or null.
*
* @param classname the binary name of the class
*/
public
abstract
String
loadBootstrapClass
(
String
className
);
/**
* Returns a pathname of a resource file that the hook loads
* per this getResource request; or null.
*
* @param resourceName the resource name
*/
public
abstract
String
getBootstrapResource
(
String
resourceName
);
/**
* Returns true if the hook successfully performs an operation per
* this loadLibrary request; or false if it fails.
*
* @param libname the name of the library
*/
public
abstract
boolean
loadLibrary
(
String
libname
);
/**
* Returns a bootstrap class path constructed by the hook.
*
* @param bcp VM's bootstrap class path
* @param factory Launcher's URL stream handler
*/
public
abstract
URLClassPath
getBootstrapClassPath
(
URLClassPath
bcp
,
URLStreamHandlerFactory
factory
);
/**
* Returns true if the current thread is in the process of doing
* a prefetching operation.
*/
public
abstract
boolean
isCurrentThreadPrefetching
();
/**
* Returns true if the hook successfully prefetches the specified file.
*
* @param name a platform independent pathname
*/
public
abstract
boolean
prefetchFile
(
String
name
);
}
src/share/classes/sun/misc/Launcher.java
浏览文件 @
ad5d7da0
...
...
@@ -38,7 +38,6 @@ import java.util.StringTokenizer;
import
java.util.Set
;
import
java.util.Vector
;
import
java.security.AccessController
;
import
java.security.AllPermission
;
import
java.security.PrivilegedAction
;
import
java.security.PrivilegedExceptionAction
;
import
java.security.AccessControlContext
;
...
...
@@ -117,18 +116,6 @@ public class Launcher {
return
loader
;
}
public
static
void
addURLToAppClassLoader
(
URL
u
)
{
AccessController
.
checkPermission
(
new
AllPermission
());
ClassLoader
loader
=
Launcher
.
getLauncher
().
getClassLoader
();
((
Launcher
.
AppClassLoader
)
loader
).
addAppURL
(
u
);
}
public
static
void
addURLToExtClassLoader
(
URL
u
)
{
AccessController
.
checkPermission
(
new
AllPermission
());
ClassLoader
loader
=
Launcher
.
getLauncher
().
getClassLoader
();
((
Launcher
.
ExtClassLoader
)
loader
.
getParent
()).
addExtURL
(
u
);
}
/*
* The class loader used for loading installed extensions.
*/
...
...
@@ -247,11 +234,6 @@ public class Launcher {
return
null
;
}
protected
Class
findClass
(
String
name
)
throws
ClassNotFoundException
{
BootClassLoaderHook
.
preLoadClass
(
name
);
return
super
.
findClass
(
name
);
}
private
static
AccessControlContext
getContext
(
File
[]
dirs
)
throws
IOException
{
...
...
@@ -316,7 +298,6 @@ public class Launcher {
public
Class
loadClass
(
String
name
,
boolean
resolve
)
throws
ClassNotFoundException
{
BootClassLoaderHook
.
preLoadClass
(
name
);
int
i
=
name
.
lastIndexOf
(
'.'
);
if
(
i
!=
-
1
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
...
...
@@ -373,10 +354,6 @@ public class Launcher {
return
acc
;
}
void
addAppURL
(
URL
url
)
{
super
.
addURL
(
url
);
}
}
private
static
class
BootClassPathHolder
{
...
...
@@ -413,11 +390,7 @@ public class Launcher {
}
public
static
URLClassPath
getBootstrapClassPath
()
{
URLClassPath
bcp
=
BootClassPathHolder
.
bcp
;
// if DownloadManager is installed, return the bootstrap class path
// maintained by the Java kernel
BootClassLoaderHook
hook
=
BootClassLoaderHook
.
getHook
();
return
hook
==
null
?
bcp
:
hook
.
getBootstrapClassPath
(
bcp
,
factory
);
return
BootClassPathHolder
.
bcp
;
}
private
static
URL
[]
pathToURLs
(
File
[]
path
)
{
...
...
test/sun/misc/BootClassLoaderHook/TestHook.java
已删除
100644 → 0
浏览文件 @
e9ce96bb
/*
* Copyright (c) 2009, 2010, 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.
*
* 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.
*/
import
java.io.File
;
import
java.util.TreeSet
;
import
java.util.Set
;
import
java.net.URLStreamHandlerFactory
;
import
sun.misc.BootClassLoaderHook
;
import
sun.misc.URLClassPath
;
/* @test
* @bug 6888802
* @summary Sanity test of BootClassLoaderHook interface
*
* @build TestHook
* @run main TestHook
*/
public
class
TestHook
extends
BootClassLoaderHook
{
private
static
final
TestHook
hook
=
new
TestHook
();
private
static
Set
<
String
>
names
=
new
TreeSet
<
String
>();
private
static
final
String
LOGRECORD_CLASS
=
"java.util.logging.LogRecord"
;
private
static
final
String
NONEXIST_RESOURCE
=
"non.exist.resource"
;
private
static
final
String
LIBHELLO
=
"hello"
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BootClassLoaderHook
.
setHook
(
hook
);
if
(
BootClassLoaderHook
.
getHook
()
==
null
)
{
throw
new
RuntimeException
(
"Null boot classloader hook "
);
}
testHook
();
if
(!
names
.
contains
(
LOGRECORD_CLASS
))
{
throw
new
RuntimeException
(
"loadBootstrapClass for "
+
LOGRECORD_CLASS
+
" not called"
);
}
if
(!
names
.
contains
(
NONEXIST_RESOURCE
))
{
throw
new
RuntimeException
(
"getBootstrapResource for "
+
NONEXIST_RESOURCE
+
" not called"
);
}
if
(!
names
.
contains
(
LIBHELLO
))
{
throw
new
RuntimeException
(
"loadLibrary for "
+
LIBHELLO
+
" not called"
);
}
Set
<
String
>
copy
=
new
TreeSet
<
String
>();
copy
.
addAll
(
names
);
for
(
String
s
:
copy
)
{
System
.
out
.
println
(
" Loaded "
+
s
);
}
}
private
static
void
testHook
()
throws
Exception
{
Class
.
forName
(
LOGRECORD_CLASS
);
ClassLoader
.
getSystemResource
(
NONEXIST_RESOURCE
);
try
{
System
.
loadLibrary
(
LIBHELLO
);
}
catch
(
UnsatisfiedLinkError
e
)
{
}
}
public
String
loadBootstrapClass
(
String
className
)
{
names
.
add
(
className
);
return
null
;
}
public
String
getBootstrapResource
(
String
resourceName
)
{
names
.
add
(
resourceName
);
return
null
;
}
public
boolean
loadLibrary
(
String
libname
)
{
names
.
add
(
libname
);
return
false
;
}
public
URLClassPath
getBootstrapClassPath
(
URLClassPath
bcp
,
URLStreamHandlerFactory
factory
)
{
return
bcp
;
}
public
boolean
isCurrentThreadPrefetching
()
{
return
false
;
}
public
boolean
prefetchFile
(
String
name
)
{
return
false
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录