Skip to content
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

fix(java): Fix for maximum size of java arrays #1843

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

fink-arthur
Copy link
Contributor

@fink-arthur fink-arthur commented Sep 13, 2024

What does this PR do?

Fixes the maximum size of Java arrays using Integer.MAX_VALUE when it should be Integer.MAX_VALUE - 8.
See this https://github.com/openjdk/jdk14u/blob/84917a040a81af2863fddc6eace3dda3e31bf4b5/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java#L577 or https://www.baeldung.com/java-arrays-max-size

Related issues

Does this PR introduce any user-facing change?

No

  • Does this PR introduce any public API change? No
  • Does this PR introduce any binary protocol compatibility change? No

Benchmark

Copy link
Collaborator

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@chaokunyang chaokunyang merged commit 8c45d95 into apache:main Sep 13, 2024
35 checks passed
chaokunyang pushed a commit that referenced this pull request Sep 14, 2024
## What does this PR do?

Fixes the maximum size of Java arrays using Integer.MAX_VALUE when it
should be Integer.MAX_VALUE - 8.
See this
https://github.com/openjdk/jdk14u/blob/84917a040a81af2863fddc6eace3dda3e31bf4b5/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java#L577
or https://www.baeldung.com/java-arrays-max-size
Same as #1843 but for the reader.

## Related issues

- #1842

## Does this PR introduce any user-facing change?

No

- [ ] Does this PR introduce any public API change? No
- [ ] Does this PR introduce any binary protocol compatibility change?
No

## Benchmark

Not needed

Co-authored-by: Arthur Finkelstein <arthur.finkelstein@instant-system.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants