-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Inconsistent @AliasFor behavior #36680
Copy link
Copy link
Open
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continue
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continue
Type
Fields
Give feedbackNo fields configured for issues without a type.
In one of our projects, we had an annotation declaration with meta-annotations that was missing an
@AliasFor:Note the missing
@AliasForongroupId.In Spring Boot 3.5 / Spring Core 6.2, this magically worked anyway, and we got listeners with group.id
app.callbackandapp.callback-mockdepending on the deployment's active profile.In Spring Boot 4 / Spring Core 7.0.6, this broke in a fun and unexpected way: The
ProdCallbackListenergot its group.id set toapp.callbackvia thedefaultvalue of our annotation, whereas the explicitgroupIdonMockCallbackListenercaused the whole thing to be ignored and it ended up with the global default group.id of justapp.I would have expected that this behaved consistently, i.e. either disregarding the non-aliased
groupIdentirely, or applying it in both cases.