Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 13, 2026

Bumps com.cedarsoftware:java-util from 4.80.0 to 4.81.0.

Changelog

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

4.81.0 - 2025-01-10

  • ARCHITECTURE: CompactMap - Replaced runtime Java compilation with pre-compiled bytecode template
    • No longer requires JDK: The builder API (CompactMap.builder().build()) now works on JRE, not just JDK
    • How it works: A pre-compiled bytecode template is patched at runtime with the configuration hash, then static fields are injected with configuration values (case sensitivity, compact size, ordering, etc.)
    • Performance: Eliminates JavaCompiler overhead - template classes are created via MethodHandles.Lookup.defineClass() with simple byte array patching
    • Same functionality: All existing builder options work exactly as before (case sensitivity, ordering, compact size, custom map types, etc.)
    • Backward compatible: Subclassing CompactMap continues to work unchanged
    • Disabled obsolete CompactMapMethodsTest.testGetJavaFileForOutputAndOpenOutputStream (tested old JavaFileManager approach)
  • BUG FIX: Converter - Fixed char[]/byte[] cross-conversion returning null after isConversionSupportedFor() was called
    • Root cause: VoidConversions::toNull was used as a placeholder in CONVERSION_DB to "advertise" that char[] ↔ byte[] conversions are supported
    • When isConversionSupportedFor(char[].class, byte[].class) was called, this placeholder got cached
    • Subsequent convert(char[], byte[].class) found the cached placeholder and used it, returning null instead of performing actual conversion
    • Fix: Replaced placeholder entries with actual converters that call ArrayConversions.arrayToArray()
    • Added tests: testIsConversionSupportedForDoesNotBreakConvert, testArrayCrossConversionWithAndWithoutSupportCheck
  • BUG FIX: AbstractConcurrentNullSafeMap.computeIfAbsent() - Fixed contention causing hangs under concurrent load
    • Affects: ConcurrentHashMapNullSafe and ConcurrentNavigableMapNullSafe (both extend AbstractConcurrentNullSafeMap)
    • Root cause: Used ConcurrentHashMap.compute() which holds a lock on the hash bin for the entire duration of the mapping function execution. Under high concurrency, threads pile up waiting for bin locks, causing hangs.
    • Key insight: The common case (no null values stored) doesn't need special sentinel handling during computation
    • Fix: Fast path now delegates directly to ConcurrentHashMap.computeIfAbsent() - this is lock-free for cache hits and only briefly locks for insertions. The slow path (key mapped to null, which is rare) uses optimistic locking with putIfAbsent()/replace().
    • Result: Performance is now virtually identical to plain ConcurrentHashMap for typical use cases (caching, memoization, etc.)
  • TEST FIX: LRUCacheTest - Added proper cleanup to prevent OutOfMemoryError during deployment tests
    • The testSpeed and testCacheBlast tests create 10M-entry caches (~800MB each)
    • Added @AfterEach cleanup that clears and nullifies caches, then suggests GC
    • Added explicit cache.clear() at the end of large tests to free memory before next test
  • IMPROVED: Scheduler lifecycle management for ThreadedLRUCacheStrategy and TTLCache
    • Both classes now have proper shutdown methods that await termination (up to 5 seconds graceful, then 1 second forced)
    • Schedulers are now lazily recreatable - if shut down, creating new cache instances automatically restarts them
    • ThreadedLRUCacheStrategy.shutdownScheduler() - new static method for explicit cleanup
    • TTLCache.shutdown() - now returns boolean indicating clean termination, properly awaits termination
    • All schedulers use daemon threads, so they won't prevent JVM shutdown even without explicit cleanup
  • IMPROVED: ThreadedLRUCacheStrategy - Complete algorithm redesign with zone-based eviction and sample-15 approximate LRU
    • Memory guarantee: Cache never exceeds 2x capacity, allowing predictable worst-case memory sizing
    • Four-zone eviction strategy:
      • Zone A (0 to 1x capacity): Normal operation, no eviction
      • Zone B (1x to 1.5x capacity): Background cleanup only (every 500ms)
      • Zone C (1.5x to 2x capacity): Probabilistic inline eviction (0% at 1.5x → 100% at 2x)
      • Zone D (2x+ capacity): Hard cap with evict-before-insert
    • Sample-15 eviction: Instead of sorting all entries O(n log n), samples 15 entries and evicts the oldest. Based on Redis research, this provides ~99% LRU accuracy with O(1) cost per eviction.
    • No more sorting: Eliminated all O(n log n) sort operations - entire algorithm is now O(1) for inline operations
    • Concurrent race fix: Zone D eviction now uses a while-loop to guarantee hard cap enforcement. Previously, multiple threads could all check size < hardCap, then all insert, causing unbounded growth (check-then-act race condition). Now inserts first, then loops eviction until under hard cap.
    • Fixes deployment hang: Heavy write load (500k unique keys into 5k cache) no longer causes hangs due to expensive sorting or unbounded cache growth
Commits
  • 56134d2 ThreadedLRUCacheStrategy: Zone-based eviction with sample-15 approximate LRU
  • c612d51 Docs: Fix Javadoc to use {@​code } blocks instead of HTML entities
  • 8b0a2f2 Remove JDK requirement warnings from CompactMap/CompactSet docs
  • acc51a0 Minor formatting cleanup in CompactMap.injectStaticFields()
  • 3ce3502 Refactor CompactMap to use ByteUtilities and ReflectionUtils
  • 08b16bd Simplify CompactSet to always use CompactMap.builder()
  • a0f004c Replace CompactMap runtime compilation with bytecode template manipulation
  • 5d582d2 updated date on changelog.md
  • b3e7344 update jar size info
  • 267b2c6 update jar size
  • See full diff in compare view

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 4.80.0 to 4.81.0.
- [Changelog](https://github.com/jdereg/java-util/blob/master/changelog.md)
- [Commits](jdereg/java-util@4.80.0...4.81.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file java Pull requests that update Java code labels Jan 13, 2026
@github-actions
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 davsclaus merged commit 643f19b into main Jan 13, 2026
5 checks passed
@dependabot dependabot bot deleted the dependabot/maven/com.cedarsoftware-java-util-4.81.0 branch January 13, 2026 08:54
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