Skip to content

chore(deps): Bump com.cedarsoftware:java-util from 3.9.0 to 4.0.0 #18946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2025

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 19, 2025

Bumps com.cedarsoftware:java-util from 3.9.0 to 4.0.0.

Changelog

Sourced from com.cedarsoftware:java-util's changelog.

4.0.0

  • FEATURE: Added deepCopyContainers() method to CollectionUtilities and ArrayUtilities:
    • Deep Container Copy: Iteratively copies all arrays and collections to any depth while preserving references to non-container objects ("berries")
    • Iterative Implementation: Uses heap-based traversal with work queue to avoid stack overflow on deeply nested structures
    • Circular Reference Support: Properly handles circular references, maintaining the circular structure in the copy
    • Enhanced Type Preservation:
      • EnumSet → EnumSet (preserves enum type)
      • Deque → LinkedList (preserves deque operations, supports nulls)
      • PriorityQueue → PriorityQueue (preserves comparator and heap semantics)
      • SortedSet → TreeSet (preserves comparator and sorting)
      • Set → LinkedHashSet (preserves insertion order)
      • List → ArrayList (optimized for random access)
      • Other Queue types → LinkedList (preserves queue operations)
    • Performance Optimizations:
      • Primitive arrays use System.arraycopy for direct copying without boxing/unboxing overhead
      • Primitive arrays at root level are not queued (already fully copied)
      • Collections are pre-sized to avoid resize/rehash operations during population
      • Only containers are queued for processing, eliminating per-element allocations
      • Direct array access for object arrays instead of reflection in tight loops
      • Pre-sized IdentityHashMap (64) to avoid rehash thrashing
      • EnumSet uses efficient clone().clear() for empty sets
    • Maps as Berries: Maps are treated as non-containers and not deep copied
    • Thread Safety Note: Method is not thread-safe under concurrent source mutation
  • FEATURE: Added caseSensitive configuration option to MultiKeyMap:
    • Case-Sensitive Mode: New constructor MultiKeyMap(boolean caseSensitive) allows case-sensitive String key comparisons (default remains case-insensitive)
    • Performance Optimization: Eliminated per-key branching by storing caseSensitive as final field, improving JIT optimization
    • Full API Support: Case sensitivity applies to all MultiKeyMap operations including standard Map interface and multi-key methods
    • Documentation: Updated README.md with examples showing case-sensitive vs case-insensitive behavior
  • DOCUMENTATION: Updated README.md to document MultiKeyMap's advanced configuration options:
    • Added examples for case-sensitive mode configuration
    • Added examples for value-based equality mode for cross-type numeric comparisons
    • Updated comparison table showing MultiKeyMap's unique features vs competitors
  • MAJOR PERFORMANCE OPTIMIZATION: Enhanced MultiKeyMap with comprehensive performance improvements based on GPT5 code review:
    • Fixed KIND_COLLECTION Fast Path: Added !valueBasedEquality check to gate fast path, ensuring collections with numerically equivalent but type-different elements match correctly (e.g., [1,2,3] matches [1L,2L,3L] in value-based mode)
    • Optimized compareNumericValues: Replaced with highly optimized version using same-class fast paths, avoiding BigDecimal conversion for common cases. Added helper methods: isIntegralLike, isBig, extractLongFast, toBigDecimal
    • Defensive RandomAccess Checking: Added instanceof List checks before instanceof RandomAccess in 6 locations to prevent ClassCastException
    • Branch-Free Loop Optimization: Split loops by valueBasedEquality mode in 7 comparison methods, eliminating per-element branching for better JIT optimization and CPU branch prediction
    • Avoided Primitive Boxing: Refactored comparePrimitiveArrayToObjectArray to avoid boxing in type-strict mode with direct type checking
    • Collapsed Duplicate Type Ladders: Created primVsList and primVsIter helper methods, eliminating redundant 8-type switch statements and reducing bytecode size
    • Consolidated Symmetric Methods: Made symmetric comparison methods delegate to their counterparts, reducing code duplication
    • NaN Handling for Primitive Arrays: Added special NaN handling for double[] and float[] arrays respecting valueBasedEquality mode
    • Ref-Equality Guards: Added if (a == b) continue; guards in all comparison loops, leveraging JVM caching for common values
  • PERFORMANCE ENHANCEMENT: Enhanced MultiKeyMap with significant hash computation optimizations:
    • Hash Computation Limit: Added MAX_HASH_ELEMENTS (4) limit to bound hash computation for large arrays/collections, significantly improving performance
    • Early Exit Optimization: Hash computation now stops early for large containers while maintaining excellent hash distribution
    • Dimensionality Check Optimization: Separated hash computation from dimensionality detection for better performance on large containers
    • ArrayList Optimization: Added specialized fast path for ArrayList iteration avoiding iterator overhead
    • Primitive Array Optimizations: Enhanced hash computation for String[], int[], long[], double[], and boolean[] arrays with bounded processing
    • Generic Array Processing: Improved reflection-based array processing with hash computation limits
    • Collection Processing: Optimized both ArrayList and generic Collection processing with early termination

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [com.cedarsoftware:java-util](https://github.com/jdereg/java-util) from 3.9.0 to 4.0.0.
- [Changelog](https://github.com/jdereg/java-util/blob/master/changelog.md)
- [Commits](https://github.com/jdereg/java-util/commits)

---
updated-dependencies:
- dependency-name: com.cedarsoftware:java-util
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file java Pull requests that update Java code labels Aug 19, 2025
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus
Copy link
Contributor

davsclaus commented Aug 19, 2025

/component-test camel-headersmap

Result ✅ The tests passed successfully

Copy link
Contributor

🤖 The Apache Camel test robot will run the tests for you 👍

@davsclaus davsclaus merged commit a94a2ed into main Aug 19, 2025
5 checks passed
@dependabot dependabot bot deleted the dependabot/maven/com.cedarsoftware-java-util-4.0.0 branch August 19, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
camel-4 core-build-and-dependencies dependencies Pull requests that update a dependency file java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant