Skip to content

Commit a572283

Browse files
committed
Polish
See gh-45231
1 parent 8641df7 commit a572283

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureRules.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ private static void allBeanPostProcessorBeanMethodsShouldBeStaticAndNotCausePrem
136136

137137
private static DescribedPredicate<JavaClass> notAnnotatedWithRoleInfrastructure() {
138138
return is("not annotated with @Role(BeanDefinition.ROLE_INFRASTRUCTURE", (candidate) -> {
139+
if (!candidate.isAnnotatedWith(Role.class)) {
140+
return true;
141+
}
139142
Role role = candidate.getAnnotationOfType(Role.class);
140-
return (role == null) || (role.value() != BeanDefinition.ROLE_INFRASTRUCTURE);
143+
return role.value() != BeanDefinition.ROLE_INFRASTRUCTURE;
141144
});
142145
}
143146

0 commit comments

Comments
 (0)