Skip to content

java-util 4.118.0

Latest

Choose a tag to compare

@jdereg jdereg released this 27 Oct 09:00

java-util 4.118.0

Maven Central: com.cedarsoftware:java-util:4.118.0

Released alongside json-io 4.118.0, which needs it. The test suite passes on JDK 8, 17 and 25.

Upgrading from 4.117.0: six results can change. The table at the top of the
changelog lists each with an example, pinned by
UpgradeTo4118NotesTest.

New

  • Converter.convert(Object, java.lang.reflect.Type) converts to a generic type, element by element:
    List<LocalDate>, Map<String, ZonedDateTime>, Optional<UUID>, generic arrays and nested types.
    isConversionSupportedFor(Type, Type) answers for it. Existing calls still bind to the Class forms, in Java and in
    Groovy.

Fixed

  • ISO-8601 ZonedDateTime text reads in the zone it names. "2026-01-15T10:00:00+05:00" was in the zone
    GMT+05:00, and "...Z[GMT]" in Etc/GMT: the same instant, but not equal to what was written. The Converter's own
    text now reads back equal. It is also 20-40% faster for such text.
  • A bare offset in brackets reads: 2026-01-15T10:00:00+05:00[+05:00], which json-io 4.x wrote for an offset zone.
  • Converting an object to a Map keeps a reference loop. The loop is the Map already made for that object; it
    was null.
  • MathUtilities.parseToMinimalNumericType() returns the number the text names: never Infinity for finite text,
    never another number, and a Double wherever a double holds the value.
  • A Converter's own conversion for a supertype of the source (Map -> Timestamp, used for a LinkedHashMap) is the
    one it runs, whatever other Converters converted first.
  • ClassUtilities.newInstance() says why a class cannot be built on every call, not only the first.

Faster

  • FastReader.readUntil() can also stop below a given character in the same pass; json-io's strict mode uses it.

Docs

  • isConversionSupportedFor() says its answer is about the classes, not a value.