We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8641df7 commit a572283Copy full SHA for a572283
buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureRules.java
@@ -136,8 +136,11 @@ private static void allBeanPostProcessorBeanMethodsShouldBeStaticAndNotCausePrem
136
137
private static DescribedPredicate<JavaClass> notAnnotatedWithRoleInfrastructure() {
138
return is("not annotated with @Role(BeanDefinition.ROLE_INFRASTRUCTURE", (candidate) -> {
139
+ if (!candidate.isAnnotatedWith(Role.class)) {
140
+ return true;
141
+ }
142
Role role = candidate.getAnnotationOfType(Role.class);
- return (role == null) || (role.value() != BeanDefinition.ROLE_INFRASTRUCTURE);
143
+ return role.value() != BeanDefinition.ROLE_INFRASTRUCTURE;
144
});
145
}
146
0 commit comments