davsclaus opened a new pull request, #25678:
URL: https://github.com/apache/camel/pull/25678

   Fixes [CAMEL-24469](https://issues.apache.org/jira/browse/CAMEL-24469): 
`PluginHelperTest` crashes the surefire fork ("The forked VM terminated without 
properly saying goodbye") on the `camel-4.22.x` branch, breaking **all** builds 
on that branch.
   
   ## Root cause
   
   `PluginHelper.versionCheck` stripped `-SNAPSHOT` from the current `version` 
but **not** from the plugin `firstVersion`, then compared them with the 
string-based `VersionHelper.compare`:
   
   ```
   compare("4.22.1", "4.22.1-SNAPSHOT")
     -> "042201" vs "04221-SNAPSHOT"
     -> position 4: '0' (48) < '1' (49) -> negative -> isGE == false
   ```
   
   So a plugin whose `firstVersion` equals the current SNAPSHOT release was 
rejected, invoking `main.quit(1)` — which is `System.exit` on the real 
`CamelJBangMain` and crashes the test fork.
   
   This is **branch-specific**: on `main` (patch `.0`, e.g. `4.23.0-SNAPSHOT`) 
the same string comparison happens to sort `>= 0`, so the fork survives. On 
`4.22.x` (patch `.1`) it does not.
   
   ## Fix
   
   Strip `-SNAPSHOT` from `firstVersion` as well before comparing. Added two 
regression tests in `PluginHelperTest`:
   - `testVersionCheckAcceptsSameSnapshotVersion` — same SNAPSHOT release must 
be accepted (the regression)
   - `testVersionCheckRejectsOlderVersion` — a build older than the plugin's 
`firstVersion` is still rejected
   
   ## Verification
   
   `PluginHelperTest` — 11 tests pass on JDK 21, no fork crash (previously 
crashed at startup).
   
   ---
   _Fix prepared by Claude Code on behalf of davsclaus_


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