Use String#isEmpty()
This commit is contained in:
parent
d961ff2f4d
commit
1b47b24a55
|
@ -250,7 +250,7 @@ public final class TestUtils {
|
||||||
*/
|
*/
|
||||||
public static void assertEquals(final String message,
|
public static void assertEquals(final String message,
|
||||||
final double[] expected, final RealVector actual, final double delta) {
|
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,
|
Assert.assertEquals(msgAndSep + "dimension", expected.length,
|
||||||
actual.getDimension());
|
actual.getDimension());
|
||||||
for (int i = 0; i < expected.length; i++) {
|
for (int i = 0; i < expected.length; i++) {
|
||||||
|
@ -272,7 +272,7 @@ public final class TestUtils {
|
||||||
*/
|
*/
|
||||||
public static void assertEquals(final String message,
|
public static void assertEquals(final String message,
|
||||||
final RealVector expected, final RealVector actual, final double delta) {
|
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(),
|
Assert.assertEquals(msgAndSep + "dimension", expected.getDimension(),
|
||||||
actual.getDimension());
|
actual.getDimension());
|
||||||
final int dim = expected.getDimension();
|
final int dim = expected.getDimension();
|
||||||
|
|
|
@ -509,7 +509,7 @@ public class SimplexOptimizerTest {
|
||||||
final List<Integer> list = new ArrayList<>();
|
final List<Integer> list = new ArrayList<>();
|
||||||
|
|
||||||
if (str == null ||
|
if (str == null ||
|
||||||
str.equals("")) {
|
str.isEmpty()) {
|
||||||
for (int i = 0; i <= dim; i++) {
|
for (int i = 0; i <= dim; i++) {
|
||||||
list.add(i);
|
list.add(i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue