uros-b opened a new pull request, #57927:
URL: https://github.com/apache/spark/pull/57927
### What changes were proposed in this pull request?
Rewrites 19 `assert(expr === false)` comparisons in `SecurityManagerSuite`
to `assert(!expr)`.
### Why are the changes needed?
All three receivers return a Scala `Boolean` (`checkUIViewPermissions`,
`checkModifyPermissions`, `aclsEnabled`), so comparing against `false` adds
nothing.
The negated form also produces a better failure message. ScalaTest's
`assert` macro reconstructs the source expression, so a failure reports the
offending call and its argument:
```
assert(!checkUIViewPermissions("user3")) ->
checkUIViewPermissions("user3") was true
assert(checkUIViewPermissions("user3") === false) -> true did not equal
false
```
In a test body with a dozen near-identical permission assertions, the second
message does not identify which one failed.
### Does this PR introduce _any_ user-facing change?
No. Test-only, and the assertions have identical truth values.
### How was this patch tested?
Existing suite. The rewrite is mechanical and every receiver was confirmed
to be a Scala `Boolean` method, so there is no unboxing or null hazard.
The scope is the first six tests, which is where the pattern is densest; the
occurrences in the later tests are left for a follow-up to keep this diff
reviewable. Happy to fold in the rest if preferred.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]