8275002: Remove unused AbstractStringBuilder.MAX_ARRAY_SIZE

Reviewed-by: prappo, jlaskey, martin
This commit is contained in:
Andrey Turbanov 2021-10-12 09:37:54 +00:00 committed by Pavel Rappo
parent cfe7471f17
commit 7d2633f795

View file

@ -231,21 +231,13 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
}
/**
* The maximum size of array to allocate (unless necessary).
* Some VMs reserve some header words in an array.
* Attempts to allocate larger arrays may result in
* OutOfMemoryError: Requested array size exceeds VM limit
*/
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
/**
* Returns a capacity at least as large as the given minimum capacity.
* Returns the current capacity increased by the current length + 2 if
* that suffices.
* Will not return a capacity greater than
* {@code (MAX_ARRAY_SIZE >> coder)} unless the given minimum capacity
* is greater than that.
* {@code (SOFT_MAX_ARRAY_LENGTH >> coder)}
* unless the given minimum capacity is greater than that.
*
* @param minCapacity the desired minimum capacity
* @throws OutOfMemoryError if minCapacity is less than zero or