Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
3ddbacd5
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看板
提交
3ddbacd5
编写于
2月 17, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
430c4c4e
a65f756d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
35 addition
and
43 deletion
+35
-43
src/share/classes/java/lang/System.java
src/share/classes/java/lang/System.java
+18
-14
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
+15
-27
test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java
...current/BlockingQueue/CancelledProducerConsumerLoops.java
+2
-2
未找到文件。
src/share/classes/java/lang/System.java
浏览文件 @
3ddbacd5
...
@@ -1102,6 +1102,18 @@ public final class System {
...
@@ -1102,6 +1102,18 @@ public final class System {
* Initialize the system class. Called after thread initialization.
* Initialize the system class. Called after thread initialization.
*/
*/
private
static
void
initializeSystemClass
()
{
private
static
void
initializeSystemClass
()
{
// VM might invoke JNU_NewStringPlatform() to set those encoding
// sensitive properties (user.home, user.name, boot.class.path, etc.)
// during "props" initialization, in which it may need access, via
// System.getProperty(), to the related system encoding property that
// have been initialized (put into "props") at early stage of the
// initialization. So make sure the "props" is available at the
// very beginning of the initialization and all system properties to
// be put into it directly.
props
=
new
Properties
();
initProperties
(
props
);
// initialized by the VM
// There are certain system configurations that may be controlled by
// There are certain system configurations that may be controlled by
// VM options such as the maximum amount of direct memory and
// VM options such as the maximum amount of direct memory and
// Integer cache size used to support the object identity semantics
// Integer cache size used to support the object identity semantics
...
@@ -1112,7 +1124,12 @@ public final class System {
...
@@ -1112,7 +1124,12 @@ public final class System {
//
//
// See java.lang.Integer.IntegerCache and the
// See java.lang.Integer.IntegerCache and the
// sun.misc.VM.saveAndRemoveProperties method for example.
// sun.misc.VM.saveAndRemoveProperties method for example.
props
=
initSystemProperties
();
//
// Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access.
sun
.
misc
.
VM
.
saveAndRemoveProperties
(
props
);
lineSeparator
=
props
.
getProperty
(
"line.separator"
);
lineSeparator
=
props
.
getProperty
(
"line.separator"
);
sun
.
misc
.
Version
.
init
();
sun
.
misc
.
Version
.
init
();
...
@@ -1123,7 +1140,6 @@ public final class System {
...
@@ -1123,7 +1140,6 @@ public final class System {
setIn0
(
new
BufferedInputStream
(
fdIn
));
setIn0
(
new
BufferedInputStream
(
fdIn
));
setOut0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdOut
,
128
),
true
));
setOut0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdOut
,
128
),
true
));
setErr0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdErr
,
128
),
true
));
setErr0
(
new
PrintStream
(
new
BufferedOutputStream
(
fdErr
,
128
),
true
));
// Load the zip library now in order to keep java.util.zip.ZipFile
// Load the zip library now in order to keep java.util.zip.ZipFile
// from trying to use itself to load this library later.
// from trying to use itself to load this library later.
loadLibrary
(
"zip"
);
loadLibrary
(
"zip"
);
...
@@ -1151,18 +1167,6 @@ public final class System {
...
@@ -1151,18 +1167,6 @@ public final class System {
setJavaLangAccess
();
setJavaLangAccess
();
}
}
private
static
Properties
initSystemProperties
()
{
Properties
props
=
new
Properties
();
initProperties
(
props
);
// initialized by the VM
// Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access.
sun
.
misc
.
VM
.
saveAndRemoveProperties
(
props
);
return
props
;
}
private
static
void
setJavaLangAccess
()
{
private
static
void
setJavaLangAccess
()
{
// Allow privileged classes outside of java.lang
// Allow privileged classes outside of java.lang
sun
.
misc
.
SharedSecrets
.
setJavaLangAccess
(
new
sun
.
misc
.
JavaLangAccess
(){
sun
.
misc
.
SharedSecrets
.
setJavaLangAccess
(
new
sun
.
misc
.
JavaLangAccess
(){
...
...
src/share/classes/sun/net/www/protocol/jar/URLJarFile.java
浏览文件 @
3ddbacd5
...
@@ -27,6 +27,9 @@ package sun.net.www.protocol.jar;
...
@@ -27,6 +27,9 @@ package sun.net.www.protocol.jar;
import
java.io.*
;
import
java.io.*
;
import
java.net.*
;
import
java.net.*
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.StandardCopyOption
;
import
java.util.*
;
import
java.util.*
;
import
java.util.jar.*
;
import
java.util.jar.*
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipFile
;
...
@@ -208,38 +211,23 @@ public class URLJarFile extends JarFile {
...
@@ -208,38 +211,23 @@ public class URLJarFile extends JarFile {
JarFile
result
=
null
;
JarFile
result
=
null
;
/* get the stream before asserting privileges */
/* get the stream before asserting privileges */
final
InputStream
in
=
url
.
openConnection
().
getInputStream
();
try
(
final
InputStream
in
=
url
.
openConnection
().
getInputStream
())
{
try
{
result
=
AccessController
.
doPrivileged
(
result
=
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
JarFile
>()
{
new
PrivilegedExceptionAction
<
JarFile
>()
{
public
JarFile
run
()
throws
IOException
{
public
JarFile
run
()
throws
IOException
{
OutputStream
out
=
null
;
Path
tmpFile
=
Files
.
createTempFile
(
"jar_cache"
,
null
);
File
tmpFile
=
null
;
try
{
Files
.
copy
(
in
,
tmpFile
,
StandardCopyOption
.
REPLACE_EXISTING
);
JarFile
jarFile
=
new
URLJarFile
(
tmpFile
.
toFile
(),
closeController
);
tmpFile
.
toFile
().
deleteOnExit
();
return
jarFile
;
}
catch
(
Throwable
thr
)
{
try
{
try
{
tmpFile
=
File
.
createTempFile
(
"jar_cache"
,
null
);
Files
.
delete
(
tmpFile
);
tmpFile
.
deleteOnExit
();
}
catch
(
IOException
ioe
)
{
out
=
new
FileOutputStream
(
tmpFile
);
thr
.
addSuppressed
(
ioe
);
int
read
=
0
;
byte
[]
buf
=
new
byte
[
BUF_SIZE
];
while
((
read
=
in
.
read
(
buf
))
!=
-
1
)
{
out
.
write
(
buf
,
0
,
read
);
}
out
.
close
();
out
=
null
;
return
new
URLJarFile
(
tmpFile
,
closeController
);
}
catch
(
IOException
e
)
{
if
(
tmpFile
!=
null
)
{
tmpFile
.
delete
();
}
throw
e
;
}
finally
{
if
(
in
!=
null
)
{
in
.
close
();
}
if
(
out
!=
null
)
{
out
.
close
();
}
}
throw
thr
;
}
}
}
}
});
});
...
...
test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java
浏览文件 @
3ddbacd5
...
@@ -124,11 +124,11 @@ public class CancelledProducerConsumerLoops {
...
@@ -124,11 +124,11 @@ public class CancelledProducerConsumerLoops {
oneRun
(
new
ArrayBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
ArrayBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingQueue
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingDeque
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedBlockingDeque
<
Integer
>(
CAPACITY
),
pairs
,
iters
);
oneRun
(
new
LinkedTransferQueue
<
Integer
>(),
pairs
,
iters
);
oneRun
(
new
SynchronousQueue
<
Integer
>(),
pairs
,
iters
/
8
);
oneRun
(
new
SynchronousQueue
<
Integer
>(),
pairs
,
iters
/
8
);
/*
PriorityBlockingQueue is unbounded
/*
unbounded queue implementations are prone to OOME
oneRun(new PriorityBlockingQueue<Integer>(iters / 2 * pairs), pairs, iters / 4);
oneRun(new PriorityBlockingQueue<Integer>(iters / 2 * pairs), pairs, iters / 4);
oneRun(new LinkedTransferQueue<Integer>(), pairs, iters);
*/
*/
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录