Skip to content

Commit a13e2cd

Browse files
committed
updated changelog.md
1 parent d8c2a89 commit a13e2cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
> * **Hash/equals contract violation** - Fixed hashDouble() and hashFloat() to maintain contract that equal values have equal hashes. Changed quantization from 1e12 to 1e10 (100× coarser) to match epsilon-based equality tolerance (1e-12), preventing HashMap/HashSet storage failures. Trade-off: ~40% hash collisions for values 2-10× epsilon apart (acceptable - narrow band).
1414
> * **ThreadLocal memory leak** - Added try-finally blocks with ThreadLocal.remove() in deepHashCode() entry point to prevent memory leaks in long-running applications, especially those using thread pools where threads are reused.
1515
> * **Unbounded memory allocation** - Moved depth budget tracking from options Map to separate ThreadLocal stack, making options Map stable and reusable. Reduced HashMap allocations from 500,000 to ~2 for 1M-node graphs (500,000× improvement), preventing OutOfMemoryError with large object graphs.
16-
> * **SimpleDateFormat race condition** - Replaced ThreadLocal<SimpleDateFormat> with SafeSimpleDateFormat for date formatting in diff output. SafeSimpleDateFormat provides copy-on-write semantics and per-thread LRU cache, preventing corrupted date formatting from re-entrant callbacks.
17-
> * **formattingStack re-entrancy** - Changed formattingStack from `ThreadLocal<Set<Object>>` to `ThreadLocal<Deque<Set<Object>>` (stack of Sets), where each top-level formatValue() call gets its own Set for circular reference detection. Prevents false `<circular Object>` detection when re-entrant deepEquals calls format the same object in different contexts.
16+
> * **SimpleDateFormat race condition** - Replaced `ThreadLocal<SimpleDateFormat>` with SafeSimpleDateFormat for date formatting in diff output. SafeSimpleDateFormat provides copy-on-write semantics and per-thread LRU cache, preventing corrupted date formatting from re-entrant callbacks.
17+
> * **formattingStack re-entrancy** - Changed formattingStack from `ThreadLocal<Set<Object>>` to `ThreadLocal<Deque<Set<Object>>>` (stack of Sets), where each top-level formatValue() call gets its own Set for circular reference detection. Prevents false `<circular Object>` detection when re-entrant deepEquals calls format the same object in different contexts.
1818
> * **Unsafe visited set publication** - Replaced HashSet with ConcurrentSet for visited set tracking. ConcurrentSet uses weakly consistent iterators (backed by ConcurrentHashMap) that never throw ConcurrentModificationException, providing fail-safe behavior instead of fail-fast when inputs are modified concurrently.
1919
> * **Test coverage**: Added 37 comprehensive tests across 6 new test classes verifying all fixes. All 17,726 existing tests pass with zero regressions.
2020
> * **Performance**: Minimal overhead for normal usage, with massive improvements for edge cases (500,000× fewer allocations for large graphs, 100 MB → 400 bytes memory usage)

0 commit comments

Comments
 (0)