4.101.0
java-util 4.101.0
Maven Central: com.cedarsoftware:java-util:4.101.0
Highlights
New APIs
ClassValueMap.getByClass(Class)— typed fast-path lookup that skips theinstanceof Classguard inget(Object), compiling to a near-directClassValue.get(type)call. Converted 30+ hot-path call sites acrossClassUtilities,Converter.ClassPairMap,MultiKeyMap,TypeUtilities,Unsafe,CompactMap, andCollectionHandling.ClassValueSet.containsClass(Class)— parallel typed fast path on the Set side. Skips the null check andinstanceof Classguard incontains(Object). Converted 9 hot-path call sites inMultiKeyMap(flatten/hash/equals paths) andClassUtilities.SECURITY_CHECK_CACHE.ReflectionUtils.getDirectClassAnnotation(Class, Class)— strict JDK-semantics companion togetClassAnnotation. MatchesClass.getAnnotation(Class)exactly (respects@Inherited, never walks interfaces), for identity-tied annotations like@Entity,@JsonNaming,@IoNaming.StringUtilities.getChars(String, int)+getChars(String)— SIMD bulk-copy helpers for hot-pathcharAt-loop replacements.
Performance
Converter— refactored 4 internal caches (CONVERSION_DB,FULL_CONVERSION_CACHE,USER_DB,cacheInheritancePairs) fromMap<ConversionPair, V>to nestedClassValueMap<ClassValueMap<V>>, eliminating per-lookupConversionPairallocation from everyconvert()call.ConversionPairis gone from the JFR hot-path allocation top-5.Converter.USER_DB— dropped redundantinstanceIdfrom cache keys (legacy from an earlier static design).FastReader.readUntil/readLine— 30% reduction in GETFIELD field accesses on the common path (scan-loop local hoisting, elided unconditional PUTFIELD writes, refill moved to loop top).FastReader.readLine(char[], int, int)— ~22% self-time reduction via explicit CSE hoisting ofb[scanPos].StringUtilities— SIMD-intrinsicString.getChars()bulk-copy pattern applied tolevenshteinDistance,damerauLevenshteinDistance, anddecode(String)(hex). Loop-invariant chars hoisted out of the Levenshtein inner loops.
Correctness
ClassValueMap— markedcachedEntrySet,cachedValues,cachedUnmodifiableViewvolatileto close a latent DCL publication race.ReflectionUtils.getAllConstructorsInternal()— added deterministic tie-breaker to constructor sort (fixes ~30% intermittent failure rate inClassUtilitiesVarargsArrayStoreTestunder JaCoCo).
Security
ReflectionUtils.isTrustedCaller()— stack walk no longer misidentifies java-util's own internal cache infrastructure as a trusted caller. Previous prefix-match allowed external callers to bypass dangerous-class blocking on paths routed through cache-populating lambdas.
Build
- JaCoCo code coverage plugin wired in permanently. Reports auto-generated on every
mvn testattarget/site/jacoco/.
Testing
- 19,964 tests total — +380 new coverage tests across
EncryptionUtilities,ReflectionUtils,UrlUtilities,IOUtilities,DeepEquals,MultiKeyMap,ClassUtilities, plus newClassValueMapTestandClassValueSetTestentries for the typed fast paths.
Full changelog: https://github.com/jdereg/java-util/blob/master/changelog.md