You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by PascalSchumacher <gi...@git.apache.org> on 2016/10/22 11:58:52 UTC
[GitHub] commons-lang pull request #199: LANG-1258: Add ArrayUtils#toStringArray(Obje...
GitHub user PascalSchumacher opened a pull request:
https://github.com/apache/commons-lang/pull/199
LANG-1258: Add ArrayUtils#toStringArray(Object[]) method
patch supplied by IG
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/PascalSchumacher/commons-lang ArrayUtils#toStringArray
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/commons-lang/pull/199.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #199
----
commit bfc8805ac898cb4d7a8ca45ab1d5106bc2b63342
Author: mildis <ig...@yahoo.fr>
Date: 2016-08-16T16:00:00Z
LANG-1258: Add ArrayUtils#toStringArray(Object[]) method
patch supplied by IG
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:
https://github.com/apache/commons-lang/pull/199
@Xaerxess Sorry for the confusion, I wasn't talking about `toString`, but about the `toPrimitive` methods e.g.
https://github.com/apache/commons-lang/blob/96c8ea2fb3719e2f6e3d7a4d7b46718f26515a86/src/main/java/org/apache/commons/lang3/ArrayUtils.java#L4497
As these also convert the type of the array I think they are the most similar existing methods (compared to the new method in this pull request).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8569597)
Coverage increased (+0.01%) to 93.551% when pulling **bf978e7ec7a1bb3d1d671331383619d81bae95ed on PascalSchumacher:ArrayUtils#toStringArray** into **91d6bd74fa358fdc8d7cb7681c76c509fd9a8e7d on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8673865)
Coverage increased (+0.03%) to 93.588% when pulling **8f3577b6919c8bbd806cd499b36babd61f9d3bb5 on PascalSchumacher:ArrayUtils#toStringArray** into **ff4497aff8cc9de4e0b2c6e5e23e5b6550f76f29 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang pull request #199: LANG-1258: Add ArrayUtils#toStringArray(Obje...
Posted by Xaerxess <gi...@git.apache.org>.
Github user Xaerxess commented on a diff in the pull request:
https://github.com/apache/commons-lang/pull/199#discussion_r85637819
--- Diff: src/main/java/org/apache/commons/lang3/ArrayUtils.java ---
@@ -7967,4 +7967,29 @@ public static boolean isSorted(boolean[] array) {
return removeAll(array, Arrays.copyOf(indices, count));
}
+
+ /**
+ * Returns an array containing the string representation of each entry in the argument array.
+ *
+ * <p>
+ * A {@code null} input Object[] returns {@code null}.
--- End diff --
One more thing came to my mind - we can document `null` elements handling. I don't have exact words for that, but something like `A {@code null} input Object[] returns {@code null}. {@code null} elements are preserved.`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8673982)
Coverage increased (+0.03%) to 93.588% when pulling **8f3577b6919c8bbd806cd499b36babd61f9d3bb5 on PascalSchumacher:ArrayUtils#toStringArray** into **ff4497aff8cc9de4e0b2c6e5e23e5b6550f76f29 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:
https://github.com/apache/commons-lang/pull/199
Merged: https://github.com/apache/commons-lang/commit/8d95ae41975a2307501aa0f4a7eba296c59edce9 and https://github.com/apache/commons-lang/commit/8d601ab71228f7c3dff950540e7ee6e4043e9053
Thanks everybody!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang pull request #199: LANG-1258: Add ArrayUtils#toStringArray(Obje...
Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher closed the pull request at:
https://github.com/apache/commons-lang/pull/199
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by Xaerxess <gi...@git.apache.org>.
Github user Xaerxess commented on the issue:
https://github.com/apache/commons-lang/pull/199
[I added null elements handling in PR to this branch](https://github.com/PascalSchumacher/commons-lang/pull/1), because in current state NPE would be thrown in case of null in array.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:
https://github.com/apache/commons-lang/pull/199
I have updated the pull request with @Xaerxess changes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8674113)
Coverage increased (+0.008%) to 93.563% when pulling **8f3577b6919c8bbd806cd499b36babd61f9d3bb5 on PascalSchumacher:ArrayUtils#toStringArray** into **ff4497aff8cc9de4e0b2c6e5e23e5b6550f76f29 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by kinow <gi...@git.apache.org>.
Github user kinow commented on the issue:
https://github.com/apache/commons-lang/pull/199
Patch looks good. I wonder if the inline if will raise a warning in checkstyle. Other than that, +1 :D
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by Xaerxess <gi...@git.apache.org>.
Github user Xaerxess commented on the issue:
https://github.com/apache/commons-lang/pull/199
Sure, consistency in API is the key. But `stringIfNull` is used when array itself is `null`, not element, so it wouldn't be consistent with the API.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8459190)
Coverage increased (+0.04%) to 93.581% when pulling **bfc8805ac898cb4d7a8ca45ab1d5106bc2b63342 on PascalSchumacher:ArrayUtils#toStringArray** into **91d6bd74fa358fdc8d7cb7681c76c509fd9a8e7d on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:
https://github.com/apache/commons-lang/pull/199
I checked the implementation of the existing `ArrayUtils#toX` methods. They throw a `NullPointerException` if the array contains `null`. For consistency reasons this method should have the same behavior.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8674388)
Coverage increased (+0.04%) to 93.595% when pulling **8f3577b6919c8bbd806cd499b36babd61f9d3bb5 on PascalSchumacher:ArrayUtils#toStringArray** into **ff4497aff8cc9de4e0b2c6e5e23e5b6550f76f29 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] commons-lang issue #199: LANG-1258: Add ArrayUtils#toStringArray(Object[]) m...
Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:
https://github.com/apache/commons-lang/pull/199
[](https://coveralls.io/builds/8674055)
Coverage increased (+0.008%) to 93.563% when pulling **8f3577b6919c8bbd806cd499b36babd61f9d3bb5 on PascalSchumacher:ArrayUtils#toStringArray** into **ff4497aff8cc9de4e0b2c6e5e23e5b6550f76f29 on apache:master**.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---