You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Uroš Bojanić (Jira)" <ji...@apache.org> on 2026/09/03 11:46:00 UTC

[jira] [Resolved] (SPARK-59172) Use isEmpty/nonEmpty instead of size comparisons in core

     [ https://issues.apache.org/jira/browse/SPARK-59172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uroš Bojanić resolved SPARK-59172.
----------------------------------
    Fix Version/s: 4.4.0
       Resolution: Fixed

Issue resolved by pull request 58470
[https://github.com/apache/spark/pull/58470]

> Use isEmpty/nonEmpty instead of size comparisons in core
> --------------------------------------------------------
>
>                 Key: SPARK-59172
>                 URL: https://issues.apache.org/jira/browse/SPARK-59172
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 4.4.0
>            Reporter: Uroš Bojanić
>            Assignee: Uroš Bojanić
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.4.0
>
>
> Several core test suites check collection emptiness with 'size == 0' instead of the more direct 'isEmpty'. This replaces 11 such occurrences across 6 test suites (MapOutputTrackerSuite, SparkTestSuite, StandaloneDynamicAllocationSuite, TaskSetManagerSuite, BlockManagerSuite, NextIteratorSuite) with 'isEmpty'. Behavior is unchanged. Note: two main-source occurrences (BlockManager, ShuffleBlockFetcherIterator) are intentionally left unchanged because there 'buf.size' is a ManagedBuffer byte count, not a collection size (ManagedBuffer has no isEmpty). Counterpart of SPARK-59149 (SQL modules); a separate PR covers MLlib.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org