Skip to content

[LANG-1810] Deprecate SOFT_MAX_ARRAY_LENGTH in favor of MAX_ARRAY_LENGTH#1559

Merged
garydgregory merged 3 commits intoapache:masterfrom
debbs061:LANG-1810-FinalizeSoftMaxArrayLength
Jan 11, 2026
Merged

[LANG-1810] Deprecate SOFT_MAX_ARRAY_LENGTH in favor of MAX_ARRAY_LENGTH#1559
garydgregory merged 3 commits intoapache:masterfrom
debbs061:LANG-1810-FinalizeSoftMaxArrayLength

Conversation

@debbs061
Copy link
Copy Markdown
Contributor

@debbs061 debbs061 commented Jan 10, 2026

Overview

Addresses LANG-1810 by transitioning the non-final field SOFT_MAX_ARRAY_LENGTH to a final constant.

Changes

  • Deprecation: Marked SOFT_MAX_ARRAY_LENGTH as @Deprecated.
  • New Constant: Added public static final int SAFE_ARRAY_LENGTH as a safe alternative.

Why

To resolve the "non-final public field" flaw while maintaining Binary Compatibility for the 3.x release line.

Copy link
Copy Markdown
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Helo @debbs061

Thank you for your PR. Please take a look at my comments.

Comment thread src/main/java/org/apache/commons/lang3/ArrayUtils.java Outdated
Comment thread src/main/java/org/apache/commons/lang3/ArrayUtils.java Outdated
@debbs061 debbs061 requested a review from garydgregory January 10, 2026 22:19
@garydgregory garydgregory merged commit d9de2fd into apache:master Jan 11, 2026
20 checks passed
@garydgregory
Copy link
Copy Markdown
Member

garydgregory added a commit that referenced this pull request Jan 11, 2026
@garydgregory
Copy link
Copy Markdown
Member

@debbs061

I merged the PR. Thank you! 👍

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