paulrutter commented on PR #552: URL: https://github.com/apache/felix-dev/pull/552#issuecomment-5530973226
Follow-up: I've narrowed the plurl change so that **nothing changes for a factory that doesn't implement `shouldHandle(URL)`** — including both Equinox factories, which declare only `shouldHandle(Class)`. - **[`5952c24`](https://github.com/apache/felix-dev/commit/5952c24986e4e2cfa813a05533221f7e479c0a69)** — the refinement (plurl only) I checked what my first version would have done to Equinox and wasn't comfortable with it. Skipping the `urlToHandler` record while the URL was unparsed meant selection re-ran at first use, which breaks an assumption `BundleResourceHandler` makes: it keeps mutable per-URL state — `bundleEntry`, cleared in `parseURL` and used as a fast path in `openConnection` — which only works if one handler serves a URL from parse through to use. It could also have routed to a different container when the call stack at first use differs from the one at parse time. Neither is something Equinox should have to accept for a hook it doesn't use. The record is now written during `parseURL` exactly as before, and only a factory that *positively claims* the URL may correct it, once, after which it stays pinned as today: - `findFactory` is restored to its original form, so URL-based selection no longer touches the general path. - `findClaimedPlurlStreamHandler` answers **only** when a factory claims the URL — no call stack inspection, no fallback to the first factory, so it returns null unless an owner identifies the URL as its own. - `URLToHandler.replace` updates the record for that URL. So the opt-in surface is exactly the new default method. `URLHandlersTest.urlHandlersWithClassLoaderIsolation` still passes and the framework suite is unchanged. For reference the three plurl-side commits, in order: 1. [`7f9938c`](https://github.com/apache/felix-dev/commit/7f9938ce896479908213d8c4f7895f9a831df71d) — `shouldHandle(URL)`, consulted in selection, delegated through `PlurlFactoryHolder` 2. [`5952c24`](https://github.com/apache/felix-dev/commit/5952c24986e4e2cfa813a05533221f7e479c0a69) — narrowed to opt-in, preserving the per-URL pinning 3. [`392c522`](https://github.com/apache/felix-dev/commit/392c52234cd7dfaed69346ae8b462655aa143afc) — the Felix side, claiming `bundle:` URLs by framework UUID If you'd prefer them squashed into one commit for lifting upstream, happy to do that. -- 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]
