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);
1393
-
returnnewPair<>(false, errorMessage);
1394
-
}
1388
+
if (StringUtils.isNotEmpty(value)) {
1389
+
String[] commands = value.split(",");
1390
+
for (Stringcommand : commands) {
1391
+
command = command.trim();
1392
+
if (!command.contains("=")) {
1393
+
StringerrorMessage = String.format("Validation failed: Command '%s' does not contain '='.", command);
1394
+
returnnewPair<>(false, errorMessage);
1395
+
}
1395
1396
1396
-
String[] parts = command.split("=");
1397
-
if (parts.length != 2) {
1398
-
StringerrorMessage = String.format("Validation failed: Command '%s' is not properly formatted.", command);
1399
-
returnnewPair<>(false, errorMessage);
1400
-
}
1397
+
String[] parts = command.split("=");
1398
+
if (parts.length != 2) {
1399
+
StringerrorMessage = String.format("Validation failed: Command '%s' is not properly formatted.", command);
1400
+
returnnewPair<>(false, errorMessage);
1401
+
}
1401
1402
1402
-
StringcommandName = parts[0].trim();
1403
-
StringvalueString = parts[1].trim();
1403
+
StringcommandName = parts[0].trim();
1404
+
StringvalueString = parts[1].trim();
1404
1405
1405
-
if (commandName.isEmpty()) {
1406
-
StringerrorMessage = String.format("Validation failed: Command name is missing in '%s'.", command);
1407
-
returnnewPair<>(false, errorMessage);
1408
-
}
1406
+
if (commandName.isEmpty()) {
1407
+
StringerrorMessage = String.format("Validation failed: Command name is missing in '%s'.", command);
1408
+
returnnewPair<>(false, errorMessage);
1409
+
}
1409
1410
1410
-
try {
1411
-
intnum = Integer.parseInt(valueString);
1412
-
if (num <= 0) {
1413
-
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not greater than 0. Invalid value: %d", commandName, num);
1411
+
try {
1412
+
intnum = Integer.parseInt(valueString);
1413
+
if (num <= 0) {
1414
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not greater than 0. Invalid value: %d", commandName, num);
1415
+
returnnewPair<>(false, errorMessage);
1416
+
}
1417
+
} catch (NumberFormatExceptione) {
1418
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not a valid integer. Invalid value: %s", commandName, valueString);
1414
1419
returnnewPair<>(false, errorMessage);
1415
1420
}
1416
-
} catch (NumberFormatExceptione) {
1417
-
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not a valid integer. Invalid value: %s", commandName, valueString);
0 commit comments