sharanggupta opened a new pull request, #28313: URL: https://github.com/apache/camel/pull/28313
_Claude Code on behalf of sharanggupta_ # Description Fixes [CAMEL-26029](https://issues.apache.org/jira/browse/CAMEL-26029). `DefaultPackageScanClassResolver.doLoadImplementationsInJar` matched JAR entries with `entry.startsWith(parent)` where `parent` has no trailing `/`, so scanning `com.acme.routes` from a JAR also returned the classes of `com.acme.routesupport` and `com.acme.routes2` (for example through `camel.main.base-package-scan`), while the same scan from a directory on the classpath only returned `com.acme.routes`. The directory branch of the same class and `DefaultPackageScanResourceResolver` already match on the package path plus `/`; this makes the JAR branch do the same (the root package still matches everything). - `core/camel-support`: the one-line boundary fix in `doLoadImplementationsInJar`. - `DefaultPackageScanClassResolverJarTest` (+ two tiny fixture classes in `jarfixture.routes` / `jarfixture.routesupport`): builds a fixture JAR at test time with a class in the scanned package and one in a sibling package, scans through a `URLClassLoader` over that JAR and asserts only the scanned package is returned. Fails before the fix (`[ScanTarget, SiblingPackageClass]`), passes after. - Upgrade guide 4.24: note for packaged applications that unknowingly relied on the sibling match. The reproduction against the released camel-support 4.23.0 is in the JIRA. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (Built `core/camel-support` with the formatter and impsort plugins; no auto-generated changes were produced.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. (Claude Code, Claude Fable 5.1; `Co-authored-by` trailer on the commit.) -- 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]
