-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[LANG-1707] Add ArrayUtils.concat methods for concatenating multiple arrays #1519
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi! This is my first contribution to Apache Commons. |
|
I'm not entirely sure I understand the question correctly. My implementation was based on the Jira ticket and its comments, where adding these methods was discussed and approved (as I understood it). Could you please clarify what I might be missing? I'd be happy to adjust the approach if needed. |
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.
Hello @ivamly
I see this could be useful now...
- Add Javadoc tags
@since 3.21.0on new public and protected methods - Remove extra blank lines
- Short-circuit the
totalLengthcomputations to throw anIllegalArgumentExceptiononce the value exceedsSAFE_MAX_ARRAY_LENGTH; you'll likely need to use a long as the running total or useMath.addExact(). - Javadoc: Sentence should end in a period (
@param).
|
Hello @ivamly Are you still working on this? |
|
Hello @garydgregory! I'll push the changes today. |
a33357d to
e11de7c
Compare
|
@garydgregory done. |
e11de7c to
5b8a06b
Compare
|
@garydgregory fix build. |
garydgregory
left a comment
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.
Hello @ivamly
Are you sure about the length computation? It looks to me like it allows for values > SAFE_MAX_ARRAY_LENGTH but just less than Integer.MAX_VALUE.
|
Really, you right. Work on it. |
Implementation of the LANG-1707 suggestion: added the concat methods to ArrayUtils for convenient concatenation of multiple arrays in a single call.
mvn; that'smvnon the command line by itself.