mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8275002: Remove unused AbstractStringBuilder.MAX_ARRAY_SIZE
Reviewed-by: prappo, jlaskey, martin
This commit is contained in:
parent
cfe7471f17
commit
7d2633f795
1 changed files with 2 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue