You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "pedrosans (via GitHub)" <gi...@apache.org> on 2026/09/03 18:26:55 UTC
[PR] Let applications restrict which classes wicket-cdi injects [wicket]
pedrosans opened a new pull request, #1569:
URL: https://github.com/apache/wicket/pull/1569
CdiConfiguration now takes a Predicate<Class<?>> deciding whether a class
is an injection candidate, and ComponentInjector, BehaviorInjector and
SessionInjector consult it before entering CDI. The default accepts every
class, so nothing changes unless an application opts in.
Every Component and Behavior instantiation goes through NonContextual,
which resolves the BeanManager twice, creates a CreationalContext and
calls InjectionTarget#inject, even for the many framework classes that
declare no injection point at all. The InjectionTarget is cached per
class, so nothing is rescanned, but that surrounding work is repeated per
instance.
It is cheap on a bare Weld container, which registers no InjectionServices
and goes straight to Weld's own injection. It need not be cheap on a
Jakarta EE container, where the integrator registers an InjectionServices
of its own and Weld calls aroundInject on every InjectionTarget#inject,
whether or not the class has anything to inject. That hook is where the
container performs @Resource, @PersistenceContext, @PersistenceUnit, @EJB
and @WebServiceRef injection, and the SPI leaves it to the integrator
whether to cache the metadata parsed there. An application whose
components need no injection can now skip the call rather than pay for it
once per component.
A rejected class gets no CDI at all: no @Inject, none of the resource
injection above, and no @PostConstruct on a Session. None of those are
reported by InjectionTarget#getInjectionPoints, so a filter that rejects
too much fails silently. Hence the filter is opt-in and the default
accepts everything.
wicket-cdi's own listeners inject themselves through NonContextual
directly and are never filtered, and neither is the application, which
CdiConfiguration#configure injects itself.
--
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: commits-unsubscribe@wicket.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Let applications restrict which classes wicket-cdi injects [wicket]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1569:
URL: https://github.com/apache/wicket/pull/1569#issuecomment-5530374426
## [Codecov](https://app.codecov.io/gh/apache/wicket/pull/1569?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `79.90196%` with `41 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 61.87%. Comparing base ([`979c868`](https://app.codecov.io/gh/apache/wicket/commit/979c86844120f6165b86d473eb55e1d24633313d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`64d1d95`](https://app.codecov.io/gh/apache/wicket/commit/64d1d95be136d2b0a1087480485ccd8c886e5ca0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1569 +/- ##
============================================
+ Coverage 61.85% 61.87% +0.02%
- Complexity 11179 11189 +10
============================================
Files 1245 1245
Lines 48213 48226 +13
Branches 6760 6760
============================================
+ Hits 29822 29842 +20
+ Misses 15688 15682 -6
+ Partials 2703 2702 -1
```
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@wicket.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org