4.98.0
Changes
- PERFORMANCE:
CaseInsensitiveMap.get(),containsKey(), andremove()now use aThreadLocal<LookupKey>for String key lookups on hash-based backings (HashMap, LinkedHashMap, ConcurrentHashMap), eliminating per-callCaseInsensitiveStringallocation. This removes the single largest remaining allocation cost center (403 JFR samples).LookupKeyis a lightweight mutable object reused via ThreadLocal, with bidirectional equals support for both HashMap and ConcurrentHashMap lookup directions. SortedMap backings continue to useCaseInsensitiveStringsince they requireComparablekeys. - PERFORMANCE:
CaseInsensitiveMapnow overridessize()andisEmpty()to delegate directly to the backing map, bypassing theAbstractMap.size()→entrySet().size()indirection chain (168 JFR samples eliminated). - PERFORMANCE:
CaseInsensitiveMapinternal fields changed fromprivateto package-private to eliminate JVM synthetic accessor methods generated for anonymous inner class access (40 JFR samples eliminated). - PERFORMANCE:
StringUtilities.hashCodeIgnoreCase()now inlines the case-fold logic directly into the hash loop, ensuring C2 JIT compiles the entire loop as a single compilation unit. - PERFORMANCE:
StringUtilities.foldCaseForHash()branch ordering optimized to checkc <= 'Z'first, partitioning ASCII so uppercase and lowercase each take only two comparisons. - BUG FIX:
ConverterDurationToOffsetDateTimeTestused the current system timezone offset to compute expected values, but the conversion target is the epoch (1970). Fixed to compute the offset at the actual target instant. - TESTING: Added
ToonRoundTripTest— 46 parameterized tests verifying allConverter-supported types round-trip through TOON format. - TESTING: Added
ConverterDurationToOffsetDateTimeTest— verifies Duration → OffsetDateTime conversion across multiple scenarios.
Maven:
<dependency>
<groupId>com.cedarsoftware</groupId>
<artifactId>java-util</artifactId>
<version>4.98.0</version>
</dependency>