Use consistent ternary expression style
Update all ternary expressions so that the condition is always in parentheses and "not equals" is used in the test. This helps to bring consistency across the codebase which makes ternary expression easier to scan. For example: `a = (a != null) ? a : b` Issue gh-8945
This commit is contained in:
+2
-2
@@ -100,8 +100,8 @@ public class WithSecurityContextTestExecutionListener extends AbstractTestExecut
|
||||
private TestSecurityContext createTestSecurityContext(Class<?> annotated, TestContext context) {
|
||||
MetaAnnotationUtils.AnnotationDescriptor<WithSecurityContext> withSecurityContextDescriptor = MetaAnnotationUtils
|
||||
.findAnnotationDescriptor(annotated, WithSecurityContext.class);
|
||||
WithSecurityContext withSecurityContext = withSecurityContextDescriptor == null ? null
|
||||
: withSecurityContextDescriptor.getAnnotation();
|
||||
WithSecurityContext withSecurityContext = (withSecurityContextDescriptor != null)
|
||||
? withSecurityContextDescriptor.getAnnotation() : null;
|
||||
return createTestSecurityContext(annotated, withSecurityContext, context);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -770,7 +770,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
// remember the SecurityContextRepository is used in many different
|
||||
// locations
|
||||
SecurityContext delegateResult = this.delegate.loadContext(requestResponseHolder);
|
||||
return result == null ? delegateResult : result;
|
||||
return (result != null) ? result : delegateResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -120,8 +120,8 @@ public class SecurityMockMvcRequestPostProcessorsDigestTests {
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response) {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
SecurityMockMvcRequestPostProcessorsDigestTests.this.username = authentication == null ? null
|
||||
: authentication.getName();
|
||||
SecurityMockMvcRequestPostProcessorsDigestTests.this.username = (authentication != null)
|
||||
? authentication.getName() : null;
|
||||
}
|
||||
});
|
||||
return this.username;
|
||||
|
||||
Reference in New Issue
Block a user