[
https://issues.apache.org/jira/browse/LANG-1659?focusedWorklogId=646604&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-646604
]
ASF GitHub Bot logged work on LANG-1659:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Sep/21 14:30
Start Date: 04/Sep/21 14:30
Worklog Time Spent: 10m
Work Description: arturobernalg commented on a change in pull request
#754:
URL: https://github.com/apache/commons-lang/pull/754#discussion_r702291187
##########
File path: src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
##########
@@ -586,6 +586,23 @@ public void testIsEmpty() {
assertFalse(ObjectUtils.isEmpty(NON_EMPTY_MAP));
}
+ /**
+ * Test for {@link ObjectUtils#isArray(Object)}.
+ */
+ @Test
+ public void testArray() {
+ assertFalse(ObjectUtils.isArray(null));
+ assertFalse(ObjectUtils.isArray(""));
+ assertFalse(ObjectUtils.isArray("abg"));
+ assertFalse(ObjectUtils.isArray(123));
+
+ assertTrue(ObjectUtils.isArray(NON_EMPTY_ARRAY));
+ assertTrue(ObjectUtils.isArray(new int[] {}));
+ assertTrue(ObjectUtils.isArray(new int[]{1, 2, 3}));
+
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 646604)
Time Spent: 2h 10m (was: 2h)
> Method to check if an object it's an array
> ------------------------------------------
>
> Key: LANG-1659
> URL: https://issues.apache.org/jira/browse/LANG-1659
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Arturo Bernal
> Priority: Major
> Labels: pull-requests-available
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> The idea it's have a method that determine whether the given object is an
> array. Change all the reference of .getClass().isArray() in favor of
> {code:java}
> ObjectUtils.isArray(value)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)