You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove commons-collection4 from the project (#7561)
* Replace commons-collections4 CollectionUtils with JDK equivalents
Two call sites used CollectionUtils.emptyIfNull() to guard against null
collections before streaming. Both are replaced with explicit null checks:
- VariableChannel.checkForVeto(): a stream-then-findAny-isPresent chain
collapses to a single anyMatch() with a null guard.
- VisionDisplay.getVision(): early return on null preserves the same
empty-string output without constructing an empty collection.
Step 1 of removing the commons-collections4 dependency.
* Replace commons-collections4 IteratorUtils with JDK StreamSupport
The single call site converted an Iterator into a List via
IteratorUtils.toList(). Replaced with StreamSupport.stream() over a
Spliterator wrapper of the Iterator and Stream.toList(), which is the
idiomatic JDK pattern for the same conversion.
Step 2 of removing the commons-collections4 dependency.
* Replace commons-collections4 ListUtils and remove the dependency
Four call sites in CDOMObjectUtilities used ListUtils.emptyIfNull() to
guard a forEach against null. Replaced with explicit null checks: skip
the iteration if the list is null, otherwise call forEach directly.
This was the last remaining commons-collections4 import after the prior
two commits removed CollectionUtils and IteratorUtils, so this change
also drops the dependency from build.gradle and the requires clause
from module-info.java.
Step 3 of removing the commons-collections4 dependency. Saves ~880 KB
from the runtime classpath.
* Refactor veto mechanism: replace BiFunction with BiPredicate
BiPredicate<T, T> is the specialized functional interface for boolean-returning two-argument functions, so call sites use .test() rather than .apply() and Sonar's "use the most specialized functional interface" warning goes away. Also tighten getVariableID() to return VariableID<T> instead of VariableID<?>.
The veto API itself (VetoableReferenceFacade, addVetoToChannel) has no in-tree callers and PR #5577 (2019) proposed removing it. The original author (thpr) pushed back, asking that cdom/formula code not be changed without discussion since "it is rarely unused completely" — third-party plugins may rely on it. Keeping the API; only modernizing the signature.
Signed-off-by: Vest <Vest@users.noreply.github.com>
* Refactor ExportDialogController: simplify context creation and streamline UI logic
Fix SonarLint errors/warnings.
Signed-off-by: Vest <Vest@users.noreply.github.com>
* Refactor CDOMObjectUtilities: streamline list handling with getSafeListFor
Signed-off-by: Vest <Vest@users.noreply.github.com>
---------
Signed-off-by: Vest <Vest@users.noreply.github.com>
0 commit comments