You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StringerrorMessage = String.format("Validation failed: Command '%s' does not contain '='.", command);
1412
-
returnnewPair<>(false, errorMessage);
1413
-
}
1407
+
if (StringUtils.isNotEmpty(value)) {
1408
+
String[] commands = value.split(",");
1409
+
for (Stringcommand : commands) {
1410
+
command = command.trim();
1411
+
if (!command.contains("=")) {
1412
+
StringerrorMessage = String.format("Validation failed: Command '%s' does not contain '='.", command);
1413
+
returnnewPair<>(false, errorMessage);
1414
+
}
1414
1415
1415
-
String[] parts = command.split("=");
1416
-
if (parts.length != 2) {
1417
-
StringerrorMessage = String.format("Validation failed: Command '%s' is not properly formatted.", command);
1418
-
returnnewPair<>(false, errorMessage);
1419
-
}
1416
+
String[] parts = command.split("=");
1417
+
if (parts.length != 2) {
1418
+
StringerrorMessage = String.format("Validation failed: Command '%s' is not properly formatted.", command);
1419
+
returnnewPair<>(false, errorMessage);
1420
+
}
1420
1421
1421
-
StringcommandName = parts[0].trim();
1422
-
StringvalueString = parts[1].trim();
1422
+
StringcommandName = parts[0].trim();
1423
+
StringvalueString = parts[1].trim();
1423
1424
1424
-
if (commandName.isEmpty()) {
1425
-
StringerrorMessage = String.format("Validation failed: Command name is missing in '%s'.", command);
1426
-
returnnewPair<>(false, errorMessage);
1427
-
}
1425
+
if (commandName.isEmpty()) {
1426
+
StringerrorMessage = String.format("Validation failed: Command name is missing in '%s'.", command);
1427
+
returnnewPair<>(false, errorMessage);
1428
+
}
1428
1429
1429
-
try {
1430
-
intnum = Integer.parseInt(valueString);
1431
-
if (num <= 0) {
1432
-
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not greater than 0. Invalid value: %d", commandName, num);
1430
+
try {
1431
+
intnum = Integer.parseInt(valueString);
1432
+
if (num <= 0) {
1433
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not greater than 0. Invalid value: %d", commandName, num);
1434
+
returnnewPair<>(false, errorMessage);
1435
+
}
1436
+
} catch (NumberFormatExceptione) {
1437
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not a valid integer. Invalid value: %s", commandName, valueString);
1433
1438
returnnewPair<>(false, errorMessage);
1434
1439
}
1435
-
} catch (NumberFormatExceptione) {
1436
-
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not a valid integer. Invalid value: %s", commandName, valueString);
0 commit comments