Skip to content

4.98.0

Choose a tag to compare

@jdereg jdereg released this 08 Mar 16:40
· 82 commits to master since this release

Changes

  • PERFORMANCE: CaseInsensitiveMap.get(), containsKey(), and remove() now use a ThreadLocal<LookupKey> for String key lookups on hash-based backings (HashMap, LinkedHashMap, ConcurrentHashMap), eliminating per-call CaseInsensitiveString allocation. This removes the single largest remaining allocation cost center (403 JFR samples). LookupKey is a lightweight mutable object reused via ThreadLocal, with bidirectional equals support for both HashMap and ConcurrentHashMap lookup directions. SortedMap backings continue to use CaseInsensitiveString since they require Comparable keys.
  • PERFORMANCE: CaseInsensitiveMap now overrides size() and isEmpty() to delegate directly to the backing map, bypassing the AbstractMap.size()entrySet().size() indirection chain (168 JFR samples eliminated).
  • PERFORMANCE: CaseInsensitiveMap internal fields changed from private to 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 check c <= 'Z' first, partitioning ASCII so uppercase and lowercase each take only two comparisons.
  • BUG FIX: ConverterDurationToOffsetDateTimeTest used 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 all Converter-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>