-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate declarations of MAX_ARRAY_SIZE in one place #1506
Conversation
👋 Welcome back stsypanov! A progress list of the required criteria for merging this PR into |
@stsypanov The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of the implementation limit for array sizes is not a specified fixed value and should not be public, it may need to change one day.
@RogerRiggs thanks for pointing this out, I've made the field private |
I'd suggest looking at #1617 . That PR not only renames this constant to be more descriptive; it also clarifies its semantics. After it's integrated, I think each of the places that has some constant MAX_ARRAY_SIZE or similar should be revisited and maybe changed to use either the constant, or the |
@stsypanov This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@stsypanov This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! |
In JDK there are multiple declarations of maximum array size (
Integer.MAX_VALUE - 8
) with exactly the same code and documentaion.In some places, e.g. in
AbstractStringBuilder
they have no use in code, only in JavaDoc, in other ones they could be substituted with one single declaration. We already have one injdk.internal.util.ArraysSupport
and it can be propagated intojava.util.Arrays
and used from there (also making it available for JDK users).Progress
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1506/head:pull/1506
$ git checkout pull/1506