forked from spring-projects/spring-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve exception for mixed explicit/implicit aliases with @AliasFor
Given the following improperly configured composed @RequestMapping annotation: @retention(RetentionPolicy.RUNTIME) @RequestMapping @interface PostApi { @AliasFor("value") String[] path() default {}; @AliasFor(annotation = RequestMapping.class, attribute = "path") String[] value() default {}; } Prior to this commit, an attempt to process the above annotation resulted in an exception similar to the following, which is not especially helpful to discern the problem. > Attribute 'value' in annotation [PostApi] must be declared as an > @AliasFor 'path', not 'path'. This commit improves the exception message for such scenarios, resulting in an exception message similar to the following. > Attribute 'value' in annotation [PostApi] must be declared as an > @AliasFor attribute 'path' in annotation [PostApi], not attribute > 'path' in annotation [RequestMapping]. Closes spring-projectsgh-24168
- Loading branch information
Showing
2 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters