mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8174109: Better queuing priorities
Reviewed-by: chegar, dfuchs, rriggs, alanb, robm, rhalade, jeff, ahgross
This commit is contained in:
parent
05331dc72f
commit
7d547d0ee4
14 changed files with 94 additions and 60 deletions
|
@ -1282,6 +1282,33 @@ 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.
|
||||
*/
|
||||
|
@ -3982,6 +4009,10 @@ public class ObjectInputStream
|
|||
}
|
||||
}
|
||||
|
||||
static {
|
||||
SharedSecrets.setJavaObjectInputStreamAccess(ObjectInputStream::checkArray);
|
||||
}
|
||||
|
||||
private void validateDescriptor(ObjectStreamClass descriptor) {
|
||||
ObjectStreamClassValidator validating = validator;
|
||||
if (validating != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue