Skip to content

Commit de7c347

Browse files
committed
Add input validation for duration parameters with 1-second minimum requirement
1 parent b8b80e5 commit de7c347

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sdk/src/main/java/com/amazonaws/lambda/durable/validation/ParameterValidator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public static void validateDuration(Duration duration, String parameterName) {
2929
throw new IllegalArgumentException(parameterName + " cannot be null");
3030
}
3131
if (duration.toSeconds() < MIN_DURATION_SECONDS) {
32-
throw new IllegalArgumentException(parameterName + " must be at least " + MIN_DURATION_SECONDS
33-
+ " second, got: " + duration);
32+
throw new IllegalArgumentException(
33+
parameterName + " must be at least " + MIN_DURATION_SECONDS + " second, got: " + duration);
3434
}
3535
}
3636

@@ -43,8 +43,8 @@ public static void validateDuration(Duration duration, String parameterName) {
4343
*/
4444
public static void validateOptionalDuration(Duration duration, String parameterName) {
4545
if (duration != null && duration.toSeconds() < MIN_DURATION_SECONDS) {
46-
throw new IllegalArgumentException(parameterName + " must be at least " + MIN_DURATION_SECONDS
47-
+ " second, got: " + duration);
46+
throw new IllegalArgumentException(
47+
parameterName + " must be at least " + MIN_DURATION_SECONDS + " second, got: " + duration);
4848
}
4949
}
5050

0 commit comments

Comments
 (0)