uros-b opened a new pull request, #58470: URL: https://github.com/apache/spark/pull/58470
### What changes were proposed in this pull request? This replaces the `collection.size == 0` emptiness idiom with the more direct `collection.isEmpty` in the `core` module. All 11 occurrences are in test suites: `MapOutputTrackerSuite`, `SparkTestSuite`, `StandaloneDynamicAllocationSuite`, `TaskSetManagerSuite`, `BlockManagerSuite`, `NextIteratorSuite`. Two main-source occurrences are deliberately left unchanged, because they are **not** collection-emptiness checks: - `BlockManager` (`buf.size() == 0`) and `ShuffleBlockFetcherIterator` (`buf.size == 0`) -- `buf` is a `ManagedBuffer`, whose `size()` returns the buffer's byte count (`long`); `ManagedBuffer` has no `isEmpty`. This is the `core` counterpart of SPARK-59149 (SQL modules); a separate PR covers MLlib. ### Why are the changes needed? `isEmpty` states the intent directly and is already used elsewhere (e.g. `SparkTestSuite` uses `nonEmpty` just above one of these sites). Behavior is unchanged: every converted receiver is a Scala collection where `isEmpty` is exactly `size == 0`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. This is a behavior-preserving refactor; `core` test sources compile cleanly. ### 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]
