elharo opened a new pull request, #163:
URL: https://github.com/apache/maven-jarsigner-plugin/pull/163

   Fixes #152
   
   ## Problem
   
   `waitAfterFailure()` uses `Math.min(attempt, MAX_WAIT_EXPONENT_ATTEMPT)` to 
clamp the exponent for the exponential backoff delay. For negative `attempt` 
values (e.g. `Integer.MIN_VALUE`), this produces a negative exponent, resulting 
in `Math.pow(2, -2147483648)` which evaluates to 0.0 — no delay at all.
   
   ## Fix
   
   Clamp the exponent to >= 0 using `Math.max(0, Math.min(attempt, 
MAX_WAIT_EXPONENT_ATTEMPT))`. Negative attempt values are now treated as 
attempt 0 (2^0 = 1 second delay).
   
   ## Changes
   
   - `JarsignerSignMojo.java:416`: Added `Math.max(0, ...)` to clamp exponent
   - `JarsignerSignMojoRetryTest.java`: Updated test to assert that 
`Integer.MIN_VALUE` and `-1` produce a 1-second delay instead of no delay
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to