gnodet opened a new pull request, #410:
URL: https://github.com/apache/maven-archiver/pull/410

   ## Summary
   
   Fix #366
   
   `isNumeric()` rejected the leading `-` sign, causing negative epoch 
timestamps (e.g. `-1`) to fall through to the ISO-8601 parser and throw a 
misleading `IllegalArgumentException`.
   
   ## Root Cause
   
   The `isNumeric()` helper checks each character against `'0'–'9'`, 
unconditionally rejecting `-`. So `parseBuildOutputTimestamp("-1")` skips the 
numeric branch, hits the ISO-8601 parser, and throws:
   
   ```
   IllegalArgumentException("Invalid project.build.outputTimestamp value '-1'")
   ```
   
   ## Fix
   
   Allow an optional leading `-` in `isNumeric()`, while preserving the 
existing behaviour that a lone `-` (used as a disable sentinel in POM 
inheritance) is treated as non-numeric.
   
   ## Testing
   
   Two new parametrized test cases added to `parseOutputTimestampInstant`:
   - `-1` → `Instant.ofEpochSecond(-1)` (= `1969-12-31T23:59:59Z`)
   - `-315532802` → `Instant.ofEpochSecond(-315532802)` (= 
`1960-01-02T00:00:02Z`)
   
   The existing `emptyParseOutputTimestampInstant` test already covers the lone 
`-` sentinel case.


-- 
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