Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b79620e4
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看板
提交
b79620e4
编写于
1月 05, 2018
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8189977: Improve permission portability
Reviewed-by: rriggs
上级
485c4cc3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
2 deletion
+34
-2
src/share/classes/java/io/FilePermission.java
src/share/classes/java/io/FilePermission.java
+3
-1
src/share/classes/java/util/Hashtable.java
src/share/classes/java/util/Hashtable.java
+4
-0
src/share/classes/java/util/Vector.java
src/share/classes/java/util/Vector.java
+27
-1
未找到文件。
src/share/classes/java/io/FilePermission.java
浏览文件 @
b79620e4
...
@@ -833,6 +833,8 @@ final class FilePermissionCollection extends PermissionCollection
...
@@ -833,6 +833,8 @@ final class FilePermissionCollection extends PermissionCollection
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
Vector
<
Permission
>
permissions
=
(
Vector
<
Permission
>)
gfields
.
get
(
"permissions"
,
null
);
Vector
<
Permission
>
permissions
=
(
Vector
<
Permission
>)
gfields
.
get
(
"permissions"
,
null
);
perms
=
new
ArrayList
<>(
permissions
.
size
());
perms
=
new
ArrayList
<>(
permissions
.
size
());
perms
.
addAll
(
permissions
);
for
(
Permission
perm
:
permissions
)
{
perms
.
add
(
perm
);
}
}
}
}
}
src/share/classes/java/util/Hashtable.java
浏览文件 @
b79620e4
...
@@ -1194,6 +1194,10 @@ public class Hashtable<K,V>
...
@@ -1194,6 +1194,10 @@ public class Hashtable<K,V>
length
--;
length
--;
length
=
Math
.
min
(
length
,
origlength
);
length
=
Math
.
min
(
length
,
origlength
);
if
(
length
<
0
)
{
// overflow
length
=
origlength
;
}
// Check Map.Entry[].class since it's the nearest public type to
// Check Map.Entry[].class since it's the nearest public type to
// what we're actually creating.
// what we're actually creating.
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Map
.
Entry
[].
class
,
length
);
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Map
.
Entry
[].
class
,
length
);
...
...
src/share/classes/java/util/Vector.java
浏览文件 @
b79620e4
/*
/*
* Copyright (c) 1994, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 201
7
, 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,9 @@
...
@@ -25,6 +25,9 @@
package
java.util
;
package
java.util
;
import
java.io.IOException
;
import
java.io.ObjectInputStream
;
import
java.io.StreamCorruptedException
;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
import
java.util.function.Predicate
;
import
java.util.function.Predicate
;
import
java.util.function.UnaryOperator
;
import
java.util.function.UnaryOperator
;
...
@@ -1058,6 +1061,29 @@ public class Vector<E>
...
@@ -1058,6 +1061,29 @@ public class Vector<E>
elementData
[--
elementCount
]
=
null
;
elementData
[--
elementCount
]
=
null
;
}
}
/**
* Loads a {@code Vector} instance from a stream
* (that is, deserializes it).
* This method performs checks to ensure the consistency
* of the fields.
*
* @param in the stream
* @throws java.io.IOException if an I/O error occurs
* @throws ClassNotFoundException if the stream contains data
* of a non-existing class
*/
private
void
readObject
(
ObjectInputStream
in
)
throws
IOException
,
ClassNotFoundException
{
ObjectInputStream
.
GetField
gfields
=
in
.
readFields
();
int
count
=
gfields
.
get
(
"elementCount"
,
0
);
Object
[]
data
=
(
Object
[])
gfields
.
get
(
"elementData"
,
null
);
if
(
count
<
0
||
data
==
null
||
count
>
data
.
length
)
{
throw
new
StreamCorruptedException
(
"Inconsistent vector internals"
);
}
elementCount
=
count
;
elementData
=
data
.
clone
();
}
/**
/**
* Save the state of the {@code Vector} instance to a stream (that
* Save the state of the {@code Vector} instance to a stream (that
* is, serialize it).
* is, serialize it).
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录