Skip to content

Add support for @Nonbinding in @jakarta.inject.Qualifier annotations #26302

Closed as not planned

Description

@ghillert

Affects: 5.3.2

In our project we reuse Java annotations across Framework boundaries (Spring/CDI/Micronaut). It turns our that Spring does not fully support the semantics of javax.inject.Qualifier annotations. Specifically, Spring Framework should support the marking of annotation fields with the @Nonbinding annotation. This would be especially useful when using @Bean methods together with org.springframework.beans.factory.InjectionPoint.

I have created a demo application to show the current behavior and desired behavior:

https://github.com/ghillert/spring-injectionpoint-demo

Please see especially:

https://github.com/ghillert/spring-injectionpoint-demo/blob/main/src/main/java/com/hillert/injectionpoint/config/AppConfig.java

It looks like @jhoeller aknowledged the issue in 2016:

https://gist.github.com/moelholm/4317e93f18b02e9582afefc152debb44

For reference:

Java EE JavaDoc - Annotation Type Nonbinding
https://javaee.github.io/javaee-spec/javadocs/javax/enterprise/util/Nonbinding.html

Advanced Using @Nonbinding to combine a configuration annotation and a qualifier annotation into one annotation
https://dzone.com/articles/cdi-di-p2

Activity

  1. added
    in: coreIssues in core modules (aop, beans, core, context, expression)
    on Nov 11, 2021
  2. changed the title [-]Add Support for @NonBinding in javax.inject.Qualifier annotations[/-] [+]Add support for `@NonBinding` in `@jakarta.inject.Qualifier` annotations[/+] on Jan 18, 2023
  3. changed the title [-]Add support for `@NonBinding` in `@jakarta.inject.Qualifier` annotations[/-] [+]Add support for `@Nonbinding` in `@jakarta.inject.Qualifier` annotations[/+] on Jan 18, 2023
  4. self-assigned this
    on Jan 18, 2023
  5. added this to the General Backlog milestone on Nov 24, 2023
  6. changed the title [-]Add support for `@Nonbinding` in `@jakarta.inject.Qualifier` annotations[/-] [+]Add support for @Nonbinding in @jakarta.inject.Qualifier annotations[/+] on Feb 14, 2024
  7. removed their assignment
    on Oct 1, 2024
  8. bclozel commented on Oct 23, 2026

    @bclozel
    Member

    Thanks for raising this, and sorry it has gone so long without a decision.

    We're reviewing older issues to keep the tracker focused on work we can realistically plan. This request hasn't drawn much interest from the community and doesn't fit the current priorities, so we're declining it.

    If it still matters to you on a current Spring Framework version, please add a comment with your use case and we can reconsider. A reproducer or concrete examples help a lot.

  9. removed this from the General Backlog milestone on Oct 23, 2026
  10. added
    status: declinedA suggestion or change that we don't feel we should currently apply
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions