1
0
mirror of synced 2026-05-22 21:33:16 +00:00

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:
Phillip Webb
2020-07-30 00:31:13 -07:00
committed by Rob Winch
parent 8d3f039f76
commit 834dcf5bcf
131 changed files with 277 additions and 265 deletions
@@ -128,7 +128,7 @@ public class FilterChainPerformanceTests {
public void provideDataOnScalingWithNumberOfAuthoritiesUserHas() throws Exception {
StopWatch sw = new StopWatch("Scaling with nAuthorities");
for (int user = 0; user < N_AUTHORITIES / 10; user++) {
int nAuthorities = user == 0 ? 1 : user * 10;
int nAuthorities = (user != 0) ? user * 10 : 1;
SecurityContextHolder.getContext().setAuthentication(
new UsernamePasswordAuthenticationToken("bob", "bobspassword", createRoles(nAuthorities)));
this.session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,