Releases: xzel23/utility
v22.0.0
Additions
- ResourcePool for reusable resources (resource-per thread, fixed- and variable-sized pools).
Breaking Changes
- removed deprecated overloads of
LangUtil.check(),LangUtil.checkArg(), andLangUtil.require...()
methods. - removed
LangUtil.wrapException(), use `LangUtil.throwAsRuntimeException instead. - removed the Counter class; use
java.util.concurrent.atomic.LongAdderinstead, it's standard and it's faster. LangUtil.uncheckedConsumer(),LangUtil.uncheckedFunction(),LangUtil.uncheckedSupplier(), and
LangUtil.uncheckedRunnable()have been replaced byLangUtil.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
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
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
- 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
- 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_MODALinstead 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-levelcommand 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
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
- added
Platform.isNativeImage() - added overloads taking
MessageFormatterArgstoAboutDialogBuilder - added
MessageFormatter.literal() - dependency updates and code cleanup
Full Changelog: v20.1.0...v20.2.0
v20.1.0
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
ValueandReadOnlyValueinterfaces with a thread-safeSimpleValueimplementation (previously removed in 20.0.0). (c598406) - Overloads accepting
MessageFormatterArgsto ease i18n usage. (87ce86a)
Changed
- Extracted record parameter handling into reusable
RecordParamsutility. (26a9f66) - Unified certificate encoding/decoding methods; updated hashing to use
TextUtil. (1874d0b) - Simplified test utility calls; made certain cryptographic methods static. (d308572)
- Treat
keyOrPatternas a pattern if{is present; otherwise treat as key. (e8f02f3) - Added
@Nullableannotations toequals()implementations; refinedOption.equals(). (0f2a481) WizardDialogwill 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
KeyUtilPEM and private key handling (including password-protected keys). (8a8150f)
Refactor / Cleanup
Build/Versioning
- Version bump. (2557857)
Breaking changes
- The 'hidden' parameter in some methods of the
InputBuilderinterface was replaced byvisible. User code
usually does not use these methods directly.
Full Changelog: v20.0.3...v20.1.0
v20.0.3
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
This is a rather large release with additions, changes and bugfixes across the board.
-
Minimum Java version: Java 21. Java 25 is required for
StreamGathererUtiland dark mode detection.
If your project uses Java 24, please upgrade. -
BOM artifact: A new artefact
utility-bomhas 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 theFxLogPaneSampleorDarkModeSampleto 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.
- New utility class
-
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.
- added
-
Package
utility.crypt- Introduced a new package that replaces the old
CryptUtilclass inutility.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)
- Introduced a new package that replaces the old
-
Package
utility.dataDataUtil.convert()now supportsvalueOf(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.fxAboutDialogBuilder.name()was changed toAboutDialogBuilder.applicationName()andAboutDialogwas 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
MessageFormatterclass, making creating localized dialogs less verbose.
TheMessageFormatterclass can be used with either the standard JavaMessageFormatorString.format()
conventions. Dialogs.information(),Dialogs.warning()etc. have been replaced byDialogs.alert()which takes a parameter
of type Àlert.AlertType`.- Added new class
InputValidatorFactoryto 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()andIoUtil.getUserDir()to get the canonical directory
for application data storage of the platform and the user's home directory.
- Fix a race condition that sometimes would lead to a failure of the
-
Package
utility.lang- Add new field
build.keyand methoddigest()to theBuildInfoclass. - Added
Versionclass and refactored BuildInfo class to use it. - Added
LangUtil.checkArg()that throwsIllegalArgumentException. - Added
LangUtil.getOrThrow()that throwsNoSuchElementExceptionwhen the key is not contained in the map. - Added
LangUtil.formatThrowable()andLangUtil.appendThrowable(). - Check format string matches arguments in
LangUtil.check()andLangUtil.checkArg(). LangUtil.newUuidV7()to create UUID v7 instances.LangUtil.reverseInPlace()to reverse array contentsLangUtil.isWrapperFor()to test if a class is a primitive wrapper for another class- Added
addIf(),addIfNonNull(),applyIfNonNull(),applyIfNotEmpty(),newWeakHashSet(). RingBufferimplementsSequencedCollection- Added
ReversedSequencedCollectionWrapperto facilitate implementingreversed()forSequencedCollection
implementations - Removed
StreamGathererUtil.filterAndMap()and related methods - these did offer significant value over chaining
filter()andmap().
- Add new field
-
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
- Removed
-
Package
utility.math- fix
MathUtil.pow10()for negative arguments < -4 - Added several mathematical constants.
- fix
-
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 differentOptionimplementing classes have been replaced by a singleOption<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 ofequals()when checking for specific options.
- The package has been completely refactored to be more consistent and allow for finer control.
-
Package
utility.swingFileInputwas changed to work around the missing "New Directory" button in open dialogs on macOS.- Race conditions and missed updates in
LogTableModelhave been fixed.
-
Package
utility.textTextUtil- 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[]).
- Added
- Fix some
RichText.split()issues; the method should now always produce results consistent with String.split() - Add
MessageFormatterclass - Remove generic parameter from FontUtil class