mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-18 02:12:06 +01:00
Add documentation to enforceBounds()
This commit is contained in:
parent
44c32d0620
commit
444ec6d593
1 changed files with 7 additions and 0 deletions
|
@ -287,6 +287,13 @@ public class SignatureSubpackets
|
|||
return setKeyExpirationTime(new KeyExpirationTime(isCritical, secondsFromCreationToExpiration));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce that <pre>secondsFromCreationToExpiration</pre> is within bounds of an unsigned 32bit number.
|
||||
* Values less than 0 are illegal, as well as values greater 0xffffffff.
|
||||
*
|
||||
* @param secondsFromCreationToExpiration number to check
|
||||
* @throws IllegalArgumentException in case of an under- or overflow
|
||||
*/
|
||||
private void enforceBounds(long secondsFromCreationToExpiration) {
|
||||
if (secondsFromCreationToExpiration < 0) {
|
||||
throw new IllegalArgumentException("Seconds from creation to expiration cannot be less than 0.");
|
||||
|
|
Loading…
Reference in a new issue