Fix transaction definition setTimeout error message since zero is valid
This commit rephrases the `DefaultTransactionDefinition#setTimeout` exception message to better reflect the fact that 0 is a valid input value. Even though this often leads to a transaction immediately timing out after opening, there is one notable case where this has another meaningful effect: in Jakarta transactions (`UserTransaction`), when passing 0 "the transaction service restores the default value". Closes gh-32635
This commit is contained in:
@@ -227,7 +227,7 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
*/
|
||||
public final void setTimeout(int timeout) {
|
||||
if (timeout < TIMEOUT_DEFAULT) {
|
||||
throw new IllegalArgumentException("Timeout must be a positive integer or TIMEOUT_DEFAULT");
|
||||
throw new IllegalArgumentException("Timeout must be a non-negative integer or TIMEOUT_DEFAULT");
|
||||
}
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user