Skip to content

Commit 7d2633f

Browse files
turbanoffPavel Rappo
authored and
Pavel Rappo
committedOct 12, 2021
8275002: Remove unused AbstractStringBuilder.MAX_ARRAY_SIZE
Reviewed-by: prappo, jlaskey, martin
1 parent cfe7471 commit 7d2633f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
 

‎src/java.base/share/classes/java/lang/AbstractStringBuilder.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,13 @@ private void ensureCapacityInternal(int minimumCapacity) {
231231
}
232232
}
233233

234-
/**
235-
* The maximum size of array to allocate (unless necessary).
236-
* Some VMs reserve some header words in an array.
237-
* Attempts to allocate larger arrays may result in
238-
* OutOfMemoryError: Requested array size exceeds VM limit
239-
*/
240-
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
241-
242234
/**
243235
* Returns a capacity at least as large as the given minimum capacity.
244236
* Returns the current capacity increased by the current length + 2 if
245237
* that suffices.
246238
* Will not return a capacity greater than
247-
* {@code (MAX_ARRAY_SIZE >> coder)} unless the given minimum capacity
248-
* is greater than that.
239+
* {@code (SOFT_MAX_ARRAY_LENGTH >> coder)}
240+
* unless the given minimum capacity is greater than that.
249241
*
250242
* @param minCapacity the desired minimum capacity
251243
* @throws OutOfMemoryError if minCapacity is less than zero or

0 commit comments

Comments
 (0)
Please sign in to comment.