Skip to content

Commit

Permalink
Polish "Ignore @value on record property"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Oct 23, 2023
1 parent 70cb96c commit f3dce4b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,11 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
}
return;
}
if (!method.getDeclaringClass().isRecord() && method.getParameterCount() == 0) {
if (method.getParameterCount() == 0) {
if (method.getDeclaringClass().isRecord()) {
// Annotations on the compact constructor arguments made available on accessors, ignoring.
return;
}
if (logger.isInfoEnabled()) {
logger.info("Autowired annotation should only be used on methods with parameters: " +
method);
Expand Down

0 comments on commit f3dce4b

Please sign in to comment.