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-math.git


The following commit(s) were added to refs/heads/master by this push:
     new 1b47b24a5 Use String#isEmpty()
1b47b24a5 is described below

commit 1b47b24a55c63edf6069a96fc42fae21976ff7cc
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Nov 28 11:17:21 2023 -0500

    Use String#isEmpty()
---
 .../src/test/java/org/apache/commons/math4/legacy/TestUtils.java      | 4 ++--
 .../legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
 
b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
index b6f8f28c1..5718d3d28 100644
--- 
a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
+++ 
b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/TestUtils.java
@@ -250,7 +250,7 @@ public final class TestUtils {
      */
     public static void assertEquals(final String message,
         final double[] expected, final RealVector actual, final double delta) {
-        final String msgAndSep = message.equals("") ? "" : message + ", ";
+        final String msgAndSep = message.isEmpty() ? "" : message + ", ";
         Assert.assertEquals(msgAndSep + "dimension", expected.length,
             actual.getDimension());
         for (int i = 0; i < expected.length; i++) {
@@ -272,7 +272,7 @@ public final class TestUtils {
      */
     public static void assertEquals(final String message,
         final RealVector expected, final RealVector actual, final double 
delta) {
-        final String msgAndSep = message.equals("") ? "" : message + ", ";
+        final String msgAndSep = message.isEmpty() ? "" : message + ", ";
         Assert.assertEquals(msgAndSep + "dimension", expected.getDimension(),
             actual.getDimension());
         final int dim = expected.getDimension();
diff --git 
a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java
 
b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java
index c4b5ec150..43b00de93 100644
--- 
a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java
+++ 
b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerTest.java
@@ -509,7 +509,7 @@ public class SimplexOptimizerTest {
             final List<Integer> list = new ArrayList<>();
 
             if (str == null ||
-                str.equals("")) {
+                str.isEmpty()) {
                 for (int i = 0; i <= dim; i++) {
                     list.add(i);
                 }

Reply via email to