Use String#isEmpty()

This commit is contained in:
Gary Gregory 2023-11-28 11:17:21 -05:00
parent d961ff2f4d
commit 1b47b24a55
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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);
}