You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/21 19:10:58 UTC
[commons-lang] branch master updated: Use a String instead of
building one.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 5b025fe Use a String instead of building one.
5b025fe is described below
commit 5b025fe4b60ebe33fa3e8cd5f16f0924f8eefdd2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 21 14:10:54 2020 -0500
Use a String instead of building one.
---
src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java | 4 ++--
src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java | 6 +++---
src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
index f9b74d9..0278051 100644
--- a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
@@ -1294,7 +1294,7 @@ public class ArrayUtilsTest {
@Test
public void testIsEmptyObject() {
final Object[] emptyArray = new Object[]{};
- final Object[] notEmptyArray = new Object[]{new String("Value")};
+ final Object[] notEmptyArray = new Object[]{"Value"};
assertTrue(ArrayUtils.isEmpty((Object[]) null));
assertTrue(ArrayUtils.isEmpty(emptyArray));
assertFalse(ArrayUtils.isEmpty(notEmptyArray));
@@ -1418,7 +1418,7 @@ public class ArrayUtilsTest {
@Test
public void testIsNotEmptyObject() {
final Object[] emptyArray = new Object[]{};
- final Object[] notEmptyArray = new Object[]{new String("Value")};
+ final Object[] notEmptyArray = new Object[]{"Value"};
assertFalse(ArrayUtils.isNotEmpty((Object[]) null));
assertFalse(ArrayUtils.isNotEmpty(emptyArray));
assertTrue(ArrayUtils.isNotEmpty(notEmptyArray));
diff --git a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
index 26250d6..22ed73b 100644
--- a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
@@ -185,12 +185,12 @@ public class BooleanUtilsTest {
assertTrue(BooleanUtils.toBoolean(null, null, "N"));
assertFalse(BooleanUtils.toBoolean(null, "Y", null));
assertTrue(BooleanUtils.toBoolean("Y", "Y", "N"));
- assertTrue(BooleanUtils.toBoolean("Y", new String("Y"), new String("N")));
+ assertTrue(BooleanUtils.toBoolean("Y", "Y", "N"));
+ assertFalse(BooleanUtils.toBoolean("N", "Y", "N"));
assertFalse(BooleanUtils.toBoolean("N", "Y", "N"));
- assertFalse(BooleanUtils.toBoolean("N", new String("Y"), new String("N")));
assertTrue(BooleanUtils.toBoolean((String) null, null, null));
assertTrue(BooleanUtils.toBoolean("Y", "Y", "Y"));
- assertTrue(BooleanUtils.toBoolean("Y", new String("Y"), new String("Y")));
+ assertTrue(BooleanUtils.toBoolean("Y", "Y", "Y"));
}
@Test
diff --git a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
index a70d1d7..3efafe7 100644
--- a/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java
@@ -569,7 +569,7 @@ public class ObjectUtilsTest {
*/
@Test
public void testCloneOfNotCloneable() {
- final String string = new String("apache");
+ final String string = "apache";
assertNull(ObjectUtils.clone(string));
}
@@ -615,7 +615,7 @@ public class ObjectUtilsTest {
*/
@Test
public void testPossibleCloneOfNotCloneable() {
- final String string = new String("apache");
+ final String string = "apache";
assertSame(string, ObjectUtils.cloneIfPossible(string));
}