Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7db612b7
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看板
提交
7db612b7
编写于
8月 23, 2017
作者:
A
asaha
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8186674: Remove JDK-8174109 from CPU Aug 21 week builds
Summary: Backed out changeset 4b8d4f91a480 Reviewed-by: robm
上级
d1b5e57b
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
106 addition
and
103 deletion
+106
-103
src/share/classes/java/io/ObjectInputStream.java
src/share/classes/java/io/ObjectInputStream.java
+0
-34
src/share/classes/java/util/ArrayDeque.java
src/share/classes/java/util/ArrayDeque.java
+7
-14
src/share/classes/java/util/ArrayList.java
src/share/classes/java/util/ArrayList.java
+4
-10
src/share/classes/java/util/HashMap.java
src/share/classes/java/util/HashMap.java
+2
-7
src/share/classes/java/util/HashSet.java
src/share/classes/java/util/HashSet.java
+2
-10
src/share/classes/java/util/Hashtable.java
src/share/classes/java/util/Hashtable.java
+1
-6
src/share/classes/java/util/IdentityHashMap.java
src/share/classes/java/util/IdentityHashMap.java
+2
-5
src/share/classes/java/util/PriorityQueue.java
src/share/classes/java/util/PriorityQueue.java
+1
-3
src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java
...re/classes/java/util/concurrent/CopyOnWriteArrayList.java
+0
-2
src/share/classes/sun/misc/JavaOISAccess.java
src/share/classes/sun/misc/JavaOISAccess.java
+1
-4
src/share/classes/sun/misc/JavaObjectInputStreamAccess.java
src/share/classes/sun/misc/JavaObjectInputStreamAccess.java
+41
-0
src/share/classes/sun/misc/ObjectStreamClassValidator.java
src/share/classes/sun/misc/ObjectStreamClassValidator.java
+43
-0
test/java/io/Serializable/serialFilter/SerialFilterTest.java
test/java/io/Serializable/serialFilter/SerialFilterTest.java
+2
-8
未找到文件。
src/share/classes/java/io/ObjectInputStream.java
浏览文件 @
7db612b7
...
...
@@ -43,7 +43,6 @@ import java.util.concurrent.ConcurrentMap;
import
static
java
.
io
.
ObjectStreamClass
.
processQueue
;
import
sun.misc.SharedSecrets
;
import
sun.misc.ObjectInputFilter
;
import
sun.misc.ObjectStreamClassValidator
;
import
sun.misc.SharedSecrets
;
...
...
@@ -255,12 +254,6 @@ public class ObjectInputStream
public
ObjectInputFilter
getObjectInputFilter
(
ObjectInputStream
stream
)
{
return
stream
.
getInternalObjectInputFilter
();
}
public
void
checkArray
(
ObjectInputStream
stream
,
Class
<?>
arrayType
,
int
arrayLength
)
throws
InvalidClassException
{
stream
.
checkArray
(
arrayType
,
arrayLength
);
}
});
}
...
...
@@ -1263,33 +1256,6 @@ public class ObjectInputStream
}
}
/**
* Checks the given array type and length to ensure that creation of such
* an array is permitted by this ObjectInputStream. The arrayType argument
* must represent an actual array type.
*
* This private method is called via SharedSecrets.
*
* @param arrayType the array type
* @param arrayLength the array length
* @throws NullPointerException if arrayType is null
* @throws IllegalArgumentException if arrayType isn't actually an array type
* @throws NegativeArraySizeException if arrayLength is negative
* @throws InvalidClassException if the filter rejects creation
*/
private
void
checkArray
(
Class
<?>
arrayType
,
int
arrayLength
)
throws
InvalidClassException
{
Objects
.
requireNonNull
(
arrayType
);
if
(!
arrayType
.
isArray
())
{
throw
new
IllegalArgumentException
(
"not an array type"
);
}
if
(
arrayLength
<
0
)
{
throw
new
NegativeArraySizeException
();
}
filterCheck
(
arrayType
,
arrayLength
);
}
/**
* Provide access to the persistent fields read from the input stream.
*/
...
...
src/share/classes/java/util/ArrayDeque.java
浏览文件 @
7db612b7
...
...
@@ -36,7 +36,6 @@ package java.util;
import
java.io.Serializable
;
import
java.util.function.Consumer
;
import
sun.misc.SharedSecrets
;
/**
* Resizable-array implementation of the {@link Deque} interface. Array
...
...
@@ -119,7 +118,12 @@ public class ArrayDeque<E> extends AbstractCollection<E>
// ****** Array allocation and resizing utilities ******
private
static
int
calculateSize
(
int
numElements
)
{
/**
* Allocates empty array to hold the given number of elements.
*
* @param numElements the number of elements to hold
*/
private
void
allocateElements
(
int
numElements
)
{
int
initialCapacity
=
MIN_INITIAL_CAPACITY
;
// Find the best power of two to hold elements.
// Tests "<=" because arrays aren't kept full.
...
...
@@ -135,16 +139,7 @@ public class ArrayDeque<E> extends AbstractCollection<E>
if
(
initialCapacity
<
0
)
// Too many elements, must back off
initialCapacity
>>>=
1
;
// Good luck allocating 2 ^ 30 elements
}
return
initialCapacity
;
}
/**
* Allocates empty array to hold the given number of elements.
*
* @param numElements the number of elements to hold
*/
private
void
allocateElements
(
int
numElements
)
{
elements
=
new
Object
[
calculateSize
(
numElements
)];
elements
=
new
Object
[
initialCapacity
];
}
/**
...
...
@@ -884,8 +879,6 @@ public class ArrayDeque<E> extends AbstractCollection<E>
// Read in size and allocate array
int
size
=
s
.
readInt
();
int
capacity
=
calculateSize
(
size
);
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
capacity
);
allocateElements
(
size
);
head
=
0
;
tail
=
size
;
...
...
src/share/classes/java/util/ArrayList.java
浏览文件 @
7db612b7
/*
* Copyright (c) 1997, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -28,7 +28,6 @@ package java.util;
import
java.util.function.Consumer
;
import
java.util.function.Predicate
;
import
java.util.function.UnaryOperator
;
import
sun.misc.SharedSecrets
;
/**
* Resizable-array implementation of the <tt>List</tt> interface. Implements
...
...
@@ -220,15 +219,12 @@ public class ArrayList<E> extends AbstractList<E>
}
}
private
static
int
calculateCapacity
(
Object
[]
elementData
,
int
minCapacity
)
{
private
void
ensureCapacityInternal
(
int
minCapacity
)
{
if
(
elementData
==
DEFAULTCAPACITY_EMPTY_ELEMENTDATA
)
{
return
Math
.
max
(
DEFAULT_CAPACITY
,
minCapacity
);
}
return
minCapacity
;
minCapacity
=
Math
.
max
(
DEFAULT_CAPACITY
,
minCapacity
);
}
private
void
ensureCapacityInternal
(
int
minCapacity
)
{
ensureExplicitCapacity
(
calculateCapacity
(
elementData
,
minCapacity
));
ensureExplicitCapacity
(
minCapacity
);
}
private
void
ensureExplicitCapacity
(
int
minCapacity
)
{
...
...
@@ -787,8 +783,6 @@ public class ArrayList<E> extends AbstractList<E>
if
(
size
>
0
)
{
// be like clone(), allocate array based upon size not capacity
int
capacity
=
calculateCapacity
(
elementData
,
size
);
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
capacity
);
ensureCapacityInternal
(
size
);
Object
[]
a
=
elementData
;
...
...
src/share/classes/java/util/HashMap.java
浏览文件 @
7db612b7
/*
* Copyright (c) 1997, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -34,7 +34,6 @@ import java.util.function.BiConsumer;
import
java.util.function.BiFunction
;
import
java.util.function.Consumer
;
import
java.util.function.Function
;
import
sun.misc.SharedSecrets
;
/**
* Hash table based implementation of the <tt>Map</tt> interface. This
...
...
@@ -1393,10 +1392,6 @@ public class HashMap<K,V> extends AbstractMap<K,V>
float
ft
=
(
float
)
cap
*
lf
;
threshold
=
((
cap
<
MAXIMUM_CAPACITY
&&
ft
<
MAXIMUM_CAPACITY
)
?
(
int
)
ft
:
Integer
.
MAX_VALUE
);
// Check Map.Entry[].class since it's the nearest public type to
// what we're actually creating.
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Map
.
Entry
[].
class
,
cap
);
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
Node
<
K
,
V
>[]
tab
=
(
Node
<
K
,
V
>[])
new
Node
[
cap
];
table
=
tab
;
...
...
src/share/classes/java/util/HashSet.java
浏览文件 @
7db612b7
/*
* Copyright (c) 1997, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -26,7 +26,6 @@
package
java.util
;
import
java.io.InvalidObjectException
;
import
sun.misc.SharedSecrets
;
/**
* This class implements the <tt>Set</tt> interface, backed by a hash table
...
...
@@ -317,19 +316,12 @@ public class HashSet<E>
throw
new
InvalidObjectException
(
"Illegal size: "
+
size
);
}
// Set the capacity according to the size and load factor ensuring that
// the HashMap is at least 25% full but clamping to maximum capacity.
capacity
=
(
int
)
Math
.
min
(
size
*
Math
.
min
(
1
/
loadFactor
,
4.0f
),
HashMap
.
MAXIMUM_CAPACITY
);
// Constructing the backing map will lazily create an array when the first element is
// added, so check it before construction. Call HashMap.tableSizeFor to compute the
// actual allocation size. Check Map.Entry[].class since it's the nearest public type to
// what is actually created.
SharedSecrets
.
getJavaOISAccess
()
.
checkArray
(
s
,
Map
.
Entry
[].
class
,
HashMap
.
tableSizeFor
(
capacity
));
// Create backing HashMap
map
=
(((
HashSet
<?>)
this
)
instanceof
LinkedHashSet
?
new
LinkedHashMap
<
E
,
Object
>(
capacity
,
loadFactor
)
:
...
...
src/share/classes/java/util/Hashtable.java
浏览文件 @
7db612b7
/*
* Copyright (c) 1994, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 201
3
, 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
...
...
@@ -30,7 +30,6 @@ import java.util.concurrent.ThreadLocalRandom;
import
java.util.function.BiConsumer
;
import
java.util.function.Function
;
import
java.util.function.BiFunction
;
import
sun.misc.SharedSecrets
;
/**
* This class implements a hash table, which maps keys to values. Any
...
...
@@ -1193,10 +1192,6 @@ public class Hashtable<K,V>
if
(
length
>
elements
&&
(
length
&
1
)
==
0
)
length
--;
length
=
Math
.
min
(
length
,
origlength
);
// Check Map.Entry[].class since it's the nearest public type to
// what we're actually creating.
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Map
.
Entry
[].
class
,
length
);
table
=
new
Entry
<?,?>[
length
];
threshold
=
(
int
)
Math
.
min
(
length
*
loadFactor
,
MAX_ARRAY_SIZE
+
1
);
count
=
0
;
...
...
src/share/classes/java/util/IdentityHashMap.java
浏览文件 @
7db612b7
/*
* Copyright (c) 2000, 201
7
, 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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -29,7 +29,6 @@ import java.lang.reflect.Array;
import
java.util.function.BiConsumer
;
import
java.util.function.BiFunction
;
import
java.util.function.Consumer
;
import
sun.misc.SharedSecrets
;
/**
* This class implements the <tt>Map</tt> interface with a hash table, using
...
...
@@ -1305,9 +1304,7 @@ public class IdentityHashMap<K,V>
if
(
size
<
0
)
throw
new
java
.
io
.
StreamCorruptedException
(
"Illegal mappings count: "
+
size
);
int
cap
=
capacity
(
size
);
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
cap
);
init
(
cap
);
init
(
capacity
(
size
));
// Read the keys and values, and put the mappings in the table
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
...
...
src/share/classes/java/util/PriorityQueue.java
浏览文件 @
7db612b7
/*
* Copyright (c) 2003, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, 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
...
...
@@ -26,7 +26,6 @@
package
java.util
;
import
java.util.function.Consumer
;
import
sun.misc.SharedSecrets
;
/**
* An unbounded priority {@linkplain Queue queue} based on a priority heap.
...
...
@@ -785,7 +784,6 @@ public class PriorityQueue<E> extends AbstractQueue<E>
// Read in (and discard) array length
s
.
readInt
();
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
size
);
queue
=
new
Object
[
size
];
// Read in all elements.
...
...
src/share/classes/java/util/concurrent/CopyOnWriteArrayList.java
浏览文件 @
7db612b7
...
...
@@ -50,7 +50,6 @@ import java.util.concurrent.locks.ReentrantLock;
import
java.util.function.Consumer
;
import
java.util.function.Predicate
;
import
java.util.function.UnaryOperator
;
import
sun.misc.SharedSecrets
;
/**
* A thread-safe variant of {@link java.util.ArrayList} in which all mutative
...
...
@@ -990,7 +989,6 @@ public class CopyOnWriteArrayList<E>
// Read in array length and allocate array
int
len
=
s
.
readInt
();
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
len
);
Object
[]
elements
=
new
Object
[
len
];
// Read in all elements in the proper order.
...
...
src/share/classes/sun/misc/JavaOISAccess.java
浏览文件 @
7db612b7
/*
* Copyright (c) 2016,
2017,
Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
...
...
@@ -25,12 +25,9 @@
package
sun.misc
;
import
java.io.InvalidClassException
;
import
java.io.ObjectInputStream
;
public
interface
JavaOISAccess
{
void
setObjectInputFilter
(
ObjectInputStream
stream
,
ObjectInputFilter
filter
);
ObjectInputFilter
getObjectInputFilter
(
ObjectInputStream
stream
);
void
checkArray
(
ObjectInputStream
stream
,
Class
<?>
arrayType
,
int
arrayLength
)
throws
InvalidClassException
;
}
src/share/classes/sun/misc/JavaObjectInputStreamAccess.java
0 → 100644
浏览文件 @
7db612b7
/*
* Copyright (c) 2016, 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.ObjectInputStream
;
/**
* The interface to specify methods for accessing {@code ObjectInputStream}
* @author sjiang
*/
public
interface
JavaObjectInputStreamAccess
{
/**
* Sets a descriptor validating.
* @param ois stream to have the descriptors validated
* @param validator validator used to validate a descriptor.
*/
public
void
setValidator
(
ObjectInputStream
ois
,
ObjectStreamClassValidator
validator
);
}
src/share/classes/sun/misc/ObjectStreamClassValidator.java
0 → 100644
浏览文件 @
7db612b7
/*
* Copyright (c) 2016, 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.ObjectStreamClass
;
/**
* A callback used by {@code ObjectInputStream} to do descriptor validation.
*
* @author sjiang
*/
public
interface
ObjectStreamClassValidator
{
/**
* This method will be called by ObjectInputStream to
* check a descriptor just before creating an object described by this descriptor.
* The object will not be created if this method throws a {@code RuntimeException}.
* @param descriptor descriptor to be checked.
*/
public
void
validateDescriptor
(
ObjectStreamClass
descriptor
);
}
test/java/io/Serializable/serialFilter/SerialFilterTest.java
浏览文件 @
7db612b7
...
...
@@ -35,11 +35,9 @@ import java.lang.reflect.InvocationTargetException;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.Hashtable
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.LongAdder
;
import
sun.misc.ObjectInputFilter
;
...
...
@@ -156,11 +154,6 @@ public class SerialFilterTest implements Serializable {
interfaces
,
(
p
,
m
,
args
)
->
p
);
Runnable
runnable
=
(
Runnable
&
Serializable
)
SerialFilterTest:
:
noop
;
List
<
Class
<?>>
classList
=
new
ArrayList
<>();
classList
.
add
(
HashSet
.
class
);
classList
.
addAll
(
Collections
.
nCopies
(
21
,
Map
.
Entry
[].
class
));
Object
[][]
objects
=
{
{
null
,
0
,
-
1
,
0
,
0
,
0
,
Arrays
.
asList
()},
// no callback, no values
...
...
@@ -180,7 +173,8 @@ public class SerialFilterTest implements Serializable {
objArray
.
getClass
(),
SerialFilterTest
.
class
,
java
.
lang
.
invoke
.
SerializedLambda
.
class
)},
{
deepHashSet
(
10
),
69
,
4
,
50
,
11
,
619
,
classList
},
{
deepHashSet
(
10
),
48
,
-
1
,
50
,
11
,
619
,
Arrays
.
asList
(
HashSet
.
class
)},
{
proxy
.
getClass
(),
3
,
-
1
,
2
,
2
,
112
,
Arrays
.
asList
(
Runnable
.
class
,
java
.
lang
.
reflect
.
Proxy
.
class
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录