Skip to content

Releases: xzel23/utility

v22.0.0

08 Mar 11:28
6f0e968

Choose a tag to compare

Additions

  • ResourcePool for reusable resources (resource-per thread, fixed- and variable-sized pools).

Breaking Changes

  • removed deprecated overloads of LangUtil.check(), LangUtil.checkArg(), and LangUtil.require...()
    methods.
  • removed LangUtil.wrapException(), use `LangUtil.throwAsRuntimeException instead.
  • removed the Counter class; use java.util.concurrent.atomic.LongAdder instead, it's standard and it's faster.
  • LangUtil.uncheckedConsumer(), LangUtil.uncheckedFunction(), LangUtil.uncheckedSupplier(), and
    LangUtil.uncheckedRunnable() have been replaced by LangUtil.unchecked(); overloads have been
    implemented that cover the use cases Supplier, (Bi)Consumer, (Bi)Function, and Runnable.

Bugfixes

  • text in WizardDialog was sometimes clipped

Other Changes

  • RichTextBuilder: performance optimization.
  • FxLauncher: command line option to set log level.
  • Some small fixes and improvements; reduce code duplication.

v21.0.2

09 Feb 01:58
633f0d5

Choose a tag to compare

21.0.2

  • fix release version
  • Change synchronization mechanisms in FxRefresh to avoid possible deadlocks

21

Breaking Changes

  • All classes and methods that have previously been marked as deprecated for removal have been removed.
  • The I18NProvider interface has been removed; use I18N.init(basename, locale) instead, it is recommended to
    do this in a static initializer block.
  • The utility-logging, utility-logging-slf4j, and logging-utility-log4j modules have been removed. A new independent
    project, SLB4J, was started to provide an easy to use logging backend compatible with the four
    major logging facades/frameworks (JUL, JCL, SLF4J, and Log4J). SLB4J has zero runtime dependencies,
    does not introduce any runtime dependencies and works without any bridge handlers for the different
    frontends. The logging performance is comparable to and in many cases superior to Log4J and Logback.
  • The UI logging components SwingLogPane/FxLogPane and SwingLogWindow/FxLogWindow have also been moved
    to the SLB4J project (artifact slb4j-ext-swing/slb4j-ext-fx).

I18N

All JavaFX components support I18N for use in localized applications. Make sure to initialize the global
I18N instance at application start with a locale supported by your application.

Translations have been added for the following languages:

  • The official EU languages: Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French,
    German, Greek, Hungarian, Irish (Gaelic), Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian,
    Slovak, Slovenian, Spanish, Swedish.
  • The CJK languages: Chinese (simplified and traditional), Japanese, Korean
  • Arabic, Hindi, Indonesian, Russian, Thai, Turkish

Changes to the Build Process

  • It is now possible to build the library directly on Windows ARM.
  • Instead of Gradle Toolchains, the Jdkprovider Gradle plugin is used to manage JDK versions. This was necessary to
    support building on Windows ARM.
  • The versions catalogue previously defined in settings.gradle.kts has been moved to gradle/libs.versions.toml.

Other Changes

  • fix: remove --enable-native-access=javafx.graphics from native-image configuration for base project that does not use
    JavaFX
  • fix: required field message should only be shown when a required field marker is set and should contain the configured symbol
  • support changing the locale at runtime
  • add LangUtil.asUnmodifiableMap(Properties)
  • declare AbstractOptionBuilder.handler() public

v21-rc

23 Jan 05:43
b327642

Choose a tag to compare

v21-rc Pre-release
Pre-release

Breaking Changes

  • All classes and methods that have previously been marked as deprecated for removal have been removed.
  • The I18NProvider interface has been removed; use I18N.init(basename, locale) instead, it is recommended to
    do this in a static initializer block.
  • The utility-logging, utility-logging-slf4j, and logging-utility-log4j modules have been removed. A new independent
    project, SLB4J, was started to provide an easy to use logging backend compatible with the four
    major logging facades/frameworks (JUL, JCL, SLF4J, and Log4J). SLB4J has zero runtime dependencies,
    does not introduce any runtime dependencies and works without any bridge handlers for the different
    frontends. The logging performance is comparable to and in many cases superior to Log4J and Logback.
  • The UI logging components SwingLogPane/FxLogPane and SwingLogWindow/FxLogWindow have also been moved
    to the SLB4J project (artifact slb4j-ext-swing/slb4j-ext-fx).

I18N

All JavaFX components support I18N for use in localized applications. Make sure to initialize the global
I18N instance at application start with a locale supported by your application.

Translations have been added for the following languages:

  • The official EU languages: Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French,
    German, Greek, Hungarian, Irish (Gaelic), Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian,
    Slovak, Slovenian, Spanish, Swedish.
  • The CJK languages: Chinese (simplified and traditional), Japanese, Korean
  • Arabic, Hindi, Indonesian, Russian, Thai, Turkish

Changes to the Build Process

  • It is now possible to build the library directly on Windows ARM.
  • Instead of Gradle Toolchains, the Jdkprovider Gradle plugin is used to manage JDK versions. This was necessary to
    support building on Windows ARM.
  • The versions catalogue previously defined in settings.gradle.kts has been moved to gradle/libs.versions.toml.

Other Changes

  • fix: remove --enable-native-access=javafx.graphics from native-image configuration for base project that does not use
    JavaFX
  • fix: required field message should only be shown when a required field marker is set and should contain the configured symbol
  • support changing the locale at runtime
  • add LangUtil.asUnmodifiableMap(Properties)
  • declare AbstractOptionBuilder.handler() public

v20.4.1

02 Jan 13:38
502f97f

Choose a tag to compare

  • fix ellipsis not displaying correctly on FileInput and ComboBoxEx buttons in english locale
  • add page based validation method to input dialogs

Full Changelog: v20.4.0...v20.4.1

v20.4.0

02 Jan 00:24
29238eb

Choose a tag to compare

  • IMPORTANT: deprecate for removal most methods in Controls that do not return a fluent builder
  • remove flickering when displaying dialogs in dark mode
  • DialogBuilder, AlertBuilder, WizardDialogBuilder: set default modality to Modality.WINDOW_MODAL instead of
    Modality.APPLICATION_MODAL
  • fix WizardDialog layout calculations
  • changed input dialogs to display the required marker on the left and the error marker on the right, also a hint
    for required fields is added automatically when required fields are present; added colors to required and error
    markers and update on dark mode toggle
  • add translations for dialogs and messages for all official EU languages, chinese, japanese, korean, and many others
  • update GraalVM native image support configuration files
  • add Controls.comboBox(), Controls.comboBoxEx()
  • remove the standard --log-level command line switch
  • add support for switching input dialog layout between label before or above input field
  • improved support for CSS styling of dialogs and messages

v20.3.0

27 Dec 16:58
17b327f

Choose a tag to compare

What's Changed

  • Switch from Gradle toolchains to jdkprovider plugin -> Library can now be built directly on Windows ARM
  • Update native window decorations when entering dark/light mode
  • Add GraalVM native image support configuration files
  • Add dark mode support to FxDialogSample

Full Changelog: v20.2.0...v20.3.0

v20.2.0

24 Dec 10:17
2145f85

Choose a tag to compare

  • added Platform.isNativeImage()
  • added overloads taking MessageFormatterArgs to AboutDialogBuilder
  • added MessageFormatter.literal()
  • dependency updates and code cleanup

Full Changelog: v20.1.0...v20.2.0

v20.1.0

24 Dec 10:19
df43748

Choose a tag to compare

20.1.0

Added

  • WriterOutputStream implementation to complement ReaderInputStream. (b851f47)
  • Methods to parse PEM-encoded public keys and certificates. (fdf2dba)
  • TaskProcessorEventDriven: addTaskTimeout() to apply timeouts to already submitted tasks via key. (42eb691)
  • Re-introduced Value and ReadOnlyValue interfaces with a thread-safe SimpleValue implementation (previously removed in 20.0.0). (c598406)
  • Overloads accepting MessageFormatterArgs to ease i18n usage. (87ce86a)

Changed

  • Extracted record parameter handling into reusable RecordParams utility. (26a9f66)
  • Unified certificate encoding/decoding methods; updated hashing to use TextUtil. (1874d0b)
  • Simplified test utility calls; made certain cryptographic methods static. (d308572)
  • Treat keyOrPattern as a pattern if { is present; otherwise treat as key. (e8f02f3)
  • Added @Nullable annotations to equals() implementations; refined Option.equals(). (0f2a481)
  • WizardDialog will not shrink anymore. Set preferred width/height to prevent all size changes
    when navigating through pages.

Fixed

  • Corrected warning about inconsistent headless mode configuration. (fb752de)
  • Option.equals() comparison correctness and nullability annotations improvements. (0f2a481)

Tests

  • Added tests for parsing/handling PEM-encoded certificates and chains. (4cc5f9c)
  • Added tests for KeyUtil PEM and private key handling (including password-protected keys). (8a8150f)

Refactor / Cleanup

  • Removed unused Base64 import from CryptUtil. (2014e55)
  • General code cleanup. (6c2e4c6)

Build/Versioning

Breaking changes

  • The 'hidden' parameter in some methods of the InputBuilder interface was replaced by visible. User code
    usually does not use these methods directly.

Full Changelog: v20.0.3...v20.1.0

v20.0.3

06 Dec 10:06
6e0fc4b

Choose a tag to compare

Full Changelog: v20.0.0...v20.0.3
(This includes changes for the undocumented fix releases V20.0.1 and V20.0.2)

v20.0.0

22 Nov 12:28
fad36ca

Choose a tag to compare

This is a rather large release with additions, changes and bugfixes across the board.

  • Minimum Java version: Java 21. Java 25 is required for StreamGathererUtil and dark mode detection.
    If your project uses Java 24, please upgrade.

  • BOM artifact: A new artefact utility-bom has been introduced that specifies the version for all
    modules.

  • Fixes and improvements: Many small improvements and bug fixes across the board, both for correctness and
    performance.

  • JavaFX overhaul: Much of the code has been rewritten or undergone major refactorings to make the interface
    more consistent and easier to use.

  • New package com.dua3.utility.application: adds utilities and classes to support application dvelopment:

    • A standard way to access the application Preferences.
    • Managing the applications user interface mode (light/dark/system default) and track the system setting.
      Look at the FxLogPaneSample or DarkModeSample to see how to use this in JavaFX or Swing applications.
    • A recently used documents implementation that automatically persists the list of recently used documents
      between application runs.
  • Run tasks for samples: To make running the samples easier, run tasks have been added to the build files.

  • CI workflow and deployment:

    • The CI workflow has been completely rewritten.
    • The Project has been migrated from OSS-RH to Maven Central Publish Portal.
    • Deployments are done through GitHub actions using JReleaser, snapshots are published to Maven snapshots.
    • Javadoc is automatically published to GitHub Pages after each succesfull CI build.

Changes per package

  • Package utility.application

    • New utility class ApplicationUtil.
    • New class DarkModeDetector.
    • New record LicenseData.
    • New class RecentlyUsedDocuments.
  • Package utility.concurrent

    • added scheduleTaskGroup() to schedule a group of tasks that will be displayed with a title in the Swing and JavaFX ProgressView implementations.
  • Package utility.crypt

    • Introduced a new package that replaces the old CryptUtil class in utility.lang.
      that has a more secure API and adds many new features:
      • password generation
      • password strength evaluation
      • certificate creation (depends on BouncyCastle being present)
      • key generation and handling
      • key store handling
      • asymmetric encryption
      • message signing
      • ECIES support (depends on BouncyCastle being present)
      • HMAC support (depends on BouncyCastle being present)
      • Argon2 hash support (depends on BouncyCastle being present)
  • Package utility.data

    • DataUtil.convert() now supports valueOf(primitive) and primitive arguement constructors.
    • DataUtil.convert() now supports converting between array types.
    • Added Color.luminance().
  • Package utility.db

    • Fixed a bug that prevented parsing of command line options to specify a JDBC connection
    • Added convenience method createArgumentsParser().
  • Package utility.fx

    • AboutDialogBuilder.name() was changed to AboutDialogBuilder.applicationName() and AboutDialog was removed.
    • Fixed validation of numeric fields in Dialogs created using Dialogs.input().
    • Show markers vor invalid input in Dialogs created using Dialogs.input().
    • Small fixes and improvements.
    • Dialog builders support the new MessageFormatter class, making creating localized dialogs less verbose.
      The MessageFormatter class can be used with either the standard Java MessageFormat or String.format()
      conventions.
    • Dialogs.information(), Dialogs.warning() etc. have been replaced by Dialogs.alert() which takes a parameter
      of type Àlert.AlertType`.
    • Added new class InputValidatorFactory to make input validation implementation less verbose.
    • Added error message tooltips for input fields with invalid data.
    • Fixed input dialog validation not detecting invalid data when the user clicked 'OK' or 'Next'
      before the relevant fields obtained focus.
  • Package utility.io

    • Fix a race condition that sometimes would lead to a failure of the IoUtil.testRedirectStandardStreams()
      tests when a test on another thread used standard I/O at the same time (which it really should not).
    • hardened IoUtil.unzip() and provided an overload to use custom limits for unzipping.
    • added IoUtil.getApplicationDataDir() and IoUtil.getUserDir() to get the canonical directory
      for application data storage of the platform and the user's home directory.
  • Package utility.lang

    • Add new field build.key and method digest() to the BuildInfo class.
    • Added Version class and refactored BuildInfo class to use it.
    • Added LangUtil.checkArg() that throws IllegalArgumentException.
    • Added LangUtil.getOrThrow() that throws NoSuchElementException when the key is not contained in the map.
    • Added LangUtil.formatThrowable() and LangUtil.appendThrowable().
    • Check format string matches arguments in LangUtil.check() and LangUtil.checkArg().
    • LangUtil.newUuidV7() to create UUID v7 instances.
    • LangUtil.reverseInPlace() to reverse array contents
    • LangUtil.isWrapperFor() to test if a class is a primitive wrapper for another class
    • Added addIf(), addIfNonNull(), applyIfNonNull(), applyIfNotEmpty(), newWeakHashSet().
    • RingBuffer implements SequencedCollection
    • Added ReversedSequencedCollectionWrapper to facilitate implementing reversed() for SequencedCollection
      implementations
    • Removed StreamGathererUtil.filterAndMap() and related methods - these did offer significant value over chaining
      filter() and map().
  • Package utility.logging

    • Removed LogBuffer.size() - the method could not be used meaningfully in a multithreaded environment.
    • LogBuffer.setCapacity() to change the capacity of an existing buffer
  • Package utility.math

    • fix MathUtil.pow10() for negative arguments < -4
    • Added several mathematical constants.
  • Package utility.options

    • The package has been completely refactored to be more consistent and allow for finer control.
      It is now for example easier to create options that have enum or record generic type.
      The different Option implementing classes have been replaced by a single Option<T> generic class.
    • ArgumentsParser.help() output was changed to be more informative and use system line ends as its intended use is
      to display a help message in the system terminal.
    • Use Option.isEquivalent() instead of equals() when checking for specific options.
  • Package utility.swing

    • FileInput was changed to work around the missing "New Directory" button in open dialogs on macOS.
    • Race conditions and missed updates in LogTableModel have been fixed.
  • Package utility.text

    • TextUtil
      • Added TextUtil.toCharArray()|charsToBytes()|bytesToChars().
      • Added removeLeading|Trailing|LeadingAndTrailing() to efficently strip elements from the start or end of a
        list.
      • Removed the MD5-methods. MD5 can still be used by passing "MD5" as algorithm name. Reason: MD5 is considered
        cryptographically weak and insecure, and the API should not make using an unsecure algorithm easier to use
        than
        a secure one. Which algorithms are considered safe is always subject to ongoing research, so be neutral about
        algorithms.
      • Added isNullOrBlank()
      • Fixed an issue where TextUtil.wrap() would drop the last line if not ended with a line-end character.
      • Add TextUtil.asCharSequence(chars[]).
    • Fix some RichText.split() issues; the method should now always produce results consistent with String.split()
    • Add MessageFormatter class
    • Remove generic parameter from FontUtil class