ao-lang-5.7.0-SNAPSHOT
Snapshot Notes
- Updated to Checkstyle 10.21.1.
- Throw
IOExceptionwhensetLastModifiedfails. - Minimum Java version changed from 1.8 to 11.
ao-lang-5.6.0
Release Notes
- Functional
identity()now declare throwsRuntimeExceptioninstead ofThrowable. CoercionthrowsUncheckedIOExceptioninstead ofIOExceptionfor methods that are not specifically I/O-related.
ao-lang-5.5.1
Release Notes
-
Removed incorrect direct declaration of a POM dependency. Uses of the previous release may fail with:
Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.6.0:jar failed: '…/javaee-web-api-bom-7.0.1.pom' not allowed on the path, only outputDirectories and jars are accepted
ao-lang-5.5.0
ao-lang-5.4.0
ao-lang-5.3.0
Release Notes
-
New interface
Groupfor compatibility withjava.security.acl.Groupremoved since Java 14.
ao-lang-5.2.0
Release Notes
- New exception type
LocalizedUnsupportedOperationException. - Encoder suffix and validate now accept optional trim, when trimmed, validation is applied after trimming.
- New interface
NoClosealong with staticwrap(…)methods to avoid duplicate wrapping. EncoderWriternow unwraps the writer viaCoercion.optimize(Writer, Encoder).- Moved
FailOnWriteWriterfrom AO Encoding. -
New method
Encoder.isBuffered()that provides information about when an encoder is buffered or write-through. This affects which optimizations are allowed to bypass the encoder. - XML output indentation changed from four-space to two-space for consistency with the new AO Checkstyle Config project, which itself is based on Google Java Style Guide.
ao-lang-5.1.3
Release Notes
- Now properly restoring Thread interrupted state on
InterruptedException. AutoCloseables,ExecutionExceptions,Runnables, andThrowablesnow restore Thread interrupted state when suppressing or wrapping anInterruptedExceptionand the resulting throwable is not itself anInterruptedException.- Cleaning-up ThreadLocal variables when no longer used, see https://rules.sonarsource.com/java/RSPEC-5164.
NoCloseOutputStreamnow overrideswrite(byte[],int,int)for greater performance.
ao-lang-5.1.2
Release Notes
-
For compatibility with Java 17, removed
java.rmi.activation.*fromThrowables. See JEP 407: Remove RMI Activation for details.
ao-lang-5.1.1
Release Notes
- Added support for Updated ISO 639 Language Codes in Java 17.
ao-lang-5.1.0
Release Notes
-
New classes
Attribute,Context, andScopefor accessing attributes by scope, context, and name.-
API supports arriving at an attribute in any order, such as
scope → context → nameorname → context. - API provides generic type safety (assumes casts will be OK behind the scenes, which is acceptable when all access to attributes is through this API).
-
Also provides additional functional-friendly methods similar to those in
Map, such ascomputeIfAbsent.
-
API supports arriving at an attribute in any order, such as
- Localized exceptions now allow access to i18n resources used to generate localized message.
- Improved XML parser security.
ao-lang-5.0.1
Release Notes
- Stack trace for missing resource now only logged at level FINER. At FINE, only the message is logged.
ao-lang-5.0.0
Release Notes
- Now supports Java 9+ modules with included
module-info.class. - Maven artifact relocated from
com.aoindustries:ao-langtocom.aoapps:ao-lang. - Packages renamed from
com.aoindustries.*tocom.aoapps.lang.*. -
Resources now default to sub-package
*/i18n/ApplicationResources*, which is done so that modular resource bundles maybe opened without opening the entire package to reflection. If there were separate "opens" for reflection versus resources, this change would not be necessary. -
Filled-out the
com.aoapps.lang.functionpackage withBiFunctionE,BiPredicateE, andSerializableBiFunction. -
New utility classes with lazy-evaluation, functional coalesce methods:
BiFunctions,Functions, andSuppliers.
ao-lang-4.17.0
Release Notes
-
New
ContentTypeconstants formultipart/form-dataandapplication/x-www-form-urlencoded.
ao-lang-4.16.0
Release Notes
-
New functional interfaces that may throw
IOExceptionand, optionally, an arbitrary secondary exception:IOBiConsumerIOBiConsumerEIOConsumerIOConsumerEIOFunctionIOFunctionEIOPredicateIOPredicateEIORunnableIORunnableEIOSupplierIOSupplierE
ao-lang-4.15.0
Release Notes
Coercionimprovements:- Using optimized writer for all writes. This can help maintain string identity for in-context translation tools.
trim(…)methods convert to empty string in more cases.trim(…)methods return originalchar[]when non-empty and not trimmed. This is to allow subsequent writes to use thechar[]directly.-
Added optimization for
Segmentto write the underlyingchar[]directly. - Added support for
Optionalby unwrapping the value.
ao-lang-4.14.0
Release Notes
Coercionmoved out of AO Encoding:- Non-localized parts moved to this project.
-
Localized parts moved to AO Hodgepodge and
renamed to
MarkupCoercion. - New pluggable
CoercionOptimizerto allow this decoupling. - Servlet-specific optimizations moved to AO Servlet Util.
ao-lang-4.13.0
Release Notes
- New functional interfaces:
BiConsumerELocalizedConsumerLocalizedConsumerELocalizedSupplierLocalizedSupplierE
ao-lang-4.12.2
Release Notes
-
Eliminated unnecessary uses of
java.io.ObjectInputValidationwhere immediate validation fromreadObject(…)orreadExternal(…)is sufficient.
ao-lang-4.12.1
Release Notes
- No longer printing localized exception message when it is identical to the non-localized message.
ao-lang-4.12.0
Release Notes
-
May now register SQL statements that cause an exception directly with
ErrorPrinter. This is preferred over the use of WrappedSQLException, which is now deprecated in favor of this mechanism. The issue with wrapping exceptions is it hides the original exception from subtype-specific catch blocks.
ao-lang-4.11.1
Release Notes
-
Fixed bug in
Strings.convertByteArrayFromHex(char[])that was using characters from thehexCharslookup array instead of the given argument. This method was not previously used within our projects, so the impact is limited in scope. -
Deprecated hexadecimal conversion methods of
Stringsin favor of the Apache Commons Codec implementation:Hex.
ao-lang-4.11.0
Release Notes
-
Deprecated
LongLong.compareUnsigned(long, long)in favor of Java 8's standard implementationLong.compareUnsigned(long, long). -
Moved the
com.aoindustries.securitypackage to the new AO Security project.
ao-lang-4.10.0
Release Notes
-
New functional interfaces, based on the standard ones, but that support generic checked exceptions:
ConsumerEFunctionEPredicateESupplierE
ao-lang-4.9.1
Release Notes
- Bug fix: Added missing "." in resource prefixes generated by class names.
ao-lang-4.9.0
Release Notes
- Added overload of
Projects.readVersion(String, InputStream, String, String).
ao-lang-4.8.0
Release Notes
-
Renamed
ApplicationResourcesAccessortoResourcesand moved to a newcom.aoindustries.i18npackage. This new package will develop into its own project once internationalization (i18n) classes are consolidated. New methods in
Resourcesfor obtaining resources relative to aClassorPackage.Being accessed relative to the package, the application resources can still be correctly located after packages are renamed by code obfuscation.
Resourcesnow supports an optional prefix, which is combined with keys on lookups. When using aClassto locate the resources, defaults to the class' simple name.- New method
Throwables.isSuppressed(…)to check if a throwable is already suppressed. -
Split development-only classes into a new sub-project in
devel/. This sub-project is used only for development and is never deployed to artifact repositories. -
Fixed bug in
Resources.getMessage(…)where listeners were not notified from the no-args overloads.
ao-lang-4.7.0
Release Notes
-
Now maintains
InterruptedIOException.bytesTransferredduring surrogate creation. This was an oversight in the previous release. - New method
Throwables.isSuppressed(…)to check if a throwable is already suppressed.
ao-lang-4.6.1
Release Notes
-
Added additional constructors on
WrappedExceptionthat specifically take anIOExceptionfor the purposes of deprecating wrapping ofIOExceptionin favor of the newUncheckedIOExceptionin Java 8+.
ao-lang-4.6.0
Release Notes
-
New utility classes
AutoCloseables,Runnables, andThrowables. -
New method
SysExits.getSysExit(Throwable)that provides sysexit values matching common exception types. -
Deprecated
DisposableandDisposedExceptionin favor ofAutoCloseableandIllegalStateException. -
Moved
CallableEfrom packagecom.aoindustries.langto packagecom.aoindustries.util.concurrent, so that the package structure better matches the standard Java API. CallableEnow has upper-bound genericThrowable.-
New interface
RunnableE, intended for uses likeRunnable, but that must be able to throw checked exceptions. - Added methods for
RunnableandRunnableEtoThreadLocale. -
New utility class
ExecutionExceptionsfor working withExecutionException. Currently provides functions to selectively wrapExecutionExceptionbased on its cause. This way the exception types may be maintained without losing full stack traces, which happens when rethrowing the cause directly. - Added methods for
CallableEandRunnableEtoWrappedException. -
Moved the
com.aoindustries.sqlpackage to the new AO SQL project. -
Deprecated methods of
FileUtilsthat are now reasonably handled by the standard Java API:createTempDirectory(…)delete(…)deleteRecursive(…)mkdir(…)mkdirs(…)
- Temporary files are now created with more secure default permissions.
WrappedExceptionandReflectionExceptionnow use the message of the cause when no message has been provided.-
New class
WrappedErrorthat is much likeWrappedException, except for use in the rare contextsErroris required (such as wrapping arbitraryThrowableas causes to exception types that only allowError). -
New interface
ExtraInfothat any type of throwable may implement to provide extra information lines toErrorPrinter.WrappedExceptionimplements this new interface, as does the newWrappedErrorclass. New method
Throwables.newSurrogate(Throwable)that supports creating new instances of throwables in order to have caller stack trace. When wrapped, the new throwable has a state compatible with the original, and the original throwable is the cause of the new throwable. When not wrapped, the original throwable is used directly and caller stack trace is lost.This is used to maintain exception types and states across thread boundaries, such as when an exception cause is obtained from an
ExecutionException.
ao-lang-4.5.0
Release Notes
-
New getter methods on
InvalidResult, which can be used to defer message bundle lookups. For example, the invalid result may be converted to any of the variousLocalized*Exceptionexceptions. - Moved
FreezableandFrozenExceptionfrom SemanticCMS Core Model. XmlUtilsimprovements:-
Made
isNameStartChar(int),isNameChar(int), andisHyphen(int)public. -
Renamed
isValidId(String)toisValidName(String), since IDs are defined as being valid Name. -
Created variant of
isValidName(String,int,int)to validate a substring without allocation.
-
Made
- Additional utility methods for working with project version numbers.
-
Added Web development MIME types
text/x-sassandtext/x-scss, per css - MIME type as text/plain for Sass stylesheet in chrome - Stack Overflow.
ao-lang-4.4.0
Release Notes
-
New methods
WrappedException.wrapChecked(Callable, …)that invoke a callable while wrapping any checked exceptions. This is especially helpful when using methods with checked exceptions within Java 8+ functional/stream contexts.
ao-lang-4.3.1
Release Notes
ZipUtils.unzip(…)now throwsIOExceptionwhen unable to create directories.
ao-lang-4.3.0
Release Notes
-
New utility class
Projectsto get implementation version from eitherpom.propertiesorMANIFEST.MFas per java - Get Maven artifact version at runtime - Stack Overflow.
ao-lang-4.2.0
Release Notes
- Added support for WebP images.
ao-lang-4.1.0
Release Notes
- New exception type
LocalizedUnsupportedEncodingException.
ao-lang-4.0.0
Release Notes
- Minimum Java version changed from 1.7 to 1.8.
-
Reduced use of property substitutions in
pom.xml. This is to help 3rd-party parsers that fail to perform full Maven-compatible substitutions. - New wrappers to avoid closing streams and writers.
-
New
appendTo(…)methods onWritablefor use withAppendable. Reasonably efficient default interface methods are provided, but implementations may provide more optimal solutions. -
New class
AppendableWriterthat adaptsWritertoAppendable. -
Added support for trimming
StringandCharSequencebased on code points, with a value considered whitespace when it is either<= '\u0020'(for compatibility withString.trim()) orCharacter.isWhitespace(int). Writablenow trims based on code points, with a value considered whitespace when it is either<= '\u0020'(for compatibility withString.trim()) orCharacter.isWhitespace(int).- New static constants for various common content-type:
ContentType. - Deprecated
com.aoindustries.timepackage since now redundant with Java 8. - New package
com.aoindustries.exceptions. - New static
SmartComparator.ROOTfor comparisons done inLocale.ROOT. Stringsnow splits based on code points, with a value considered whitespace when it is either<= '\u0020'(for compatibility withString.trim()) orCharacter.isWhitespace(int).-
New
@FunctionalInterfaceinterfaceSerializableFunction, that unionsFunctionandSerializable. New class
Iterableswith a set of variousIterableover common Java types, useful to avoid conflict after type erasure.Sometimes different method overloads want to accept different types of
Iterable, but they cannot due to conflict after type erasure.- Updated dependencies.
- Moved and renamed classes:
com.aoindustries.util.StringUtility→Strings
com.aoindustries.security.NotAuthenticatedExceptionmoved here from the old AO Hodgepodge project. Resolves this split-package with AO Hodgepodge.- Split collection-related utilities into new AO Collections project.
- Moved a few general-purpose exceptions to the new
com.aoindustries.exceptionpackage: - Renamed
Strings.splitString(…)toStrings.split(…). -
Deprecated
SafeMath.multiply(long, long), please useMath.multiplyExact(long, long).
ao-lang-3.3.0
Release Notes
-
New method
Writable.trim()that trims the contents of the writable.
ao-lang-3.2.0
Release Notes
-
Added new variants of
StringUtility.indexOf(…)that accept aBitSetof the characters to find.
ao-lang-3.1.0
Release Notes
-
Fixed bug in
CalendarUtils.parseDate(…)that failed to set the month before verifying date is valid within the month. - Moved the following classes from the old AO Hodgepodge project:
com.aoindustries.util.StringUtility
- Added missing
chartoStringreplacement methods inStringUtility. - New methods in
XmlUtilsfor element ID validation and generation.
ao-lang-3.0.0
Release Notes
- Breaking changes (source-compatible, rebuild required):
CalendarUtilsreturnsGregorianCalendarinstead ofCalendarwhere appropriate.
-
New class
Moniesfor processing multiple monetary values in different currencies at once. -
New class
CurrencyUtilfor help working withCurrency. -
Changed from
Calendar.getInstance()tonew GregorianCalendar()to work correctly independent of locale settings. - Created
TimeZonevariants of date/time conversion methods. - Deprecated
AoCollections.emptyIterator()in favor ofCollections.emptyIterator()available since Java 1.7. ErrorPrinternow includes all suppressed exceptions fromThrowable.getSuppressed().
ao-lang-2.1.0
Release Notes
-
New method
SafeMath.castShort(long)to safely cast fromlongtoshortwith bounds checks. - Using managed dependencies:
- This project uses managed dependencies.
- This project's managed dependencies may also be imported by other projects.
- Resolved Javadoc warnings.
ao-lang-2.0.0
Release Notes
- Minimum Java version changed from 1.6 to 1.7.
-
Deprecated
FileUtils.getFile(URL url, String urlEncoding, boolean deleteOnExit)in favor of newTempFileContextthat does not suffer from a memory leak in long-running applications. - New class
CallableEfor callables with parameterized exceptions. - New methods in
ThreadLocaleto supportCallableEorThreadLocale.Supplier. - New localizable exceptions:
MinimalListnow represents an empty list as usingCollections.emptyList()instead ofnull.MinimalMapnow represents an empty map as usingCollections.emptyMap()instead ofnull.-
New methods in
AoCollectionsto assist in efficiently convertingIterableto different types ofCollection. Deprecating methods in favor of Apache Commons Lang and Apache Commons Collections where functionality is redundant.
This does not introduce any runtime dependency on
commons-langorcommons-collections. The dependencies are both<optional />and<provided />because they are only used for javadoc@linkand@seegeneration.This is not an exhaustive search for redundant behavior. We will identify and deprecate over time as we go.
-
New methods in
SafeMathto handle multiple values via varargs. -
New class
Classesto help when dealing withClass. -
New classes
PolymorphicRegistryandPolymorphicMultimapsupporting efficient registration of objects and looking up instances by their class, or any parent class and interface they implement. Optimized for high concurrency lookups in O(1) time.
ao-lang-1.0.0
Release Notes
- Pulling small, general-purpose extensions to the standard Java libraries out of AO Hodgepodge into a new AO Lang project.
- New
AoArrays.sortParallelArraysmethod to sort parallel arrays. ProcessResultimprovements:execmethod now allows varargs.- Now uses only one additional thread to read standard error.
- Delays the allocation of
StringBuilderobjects until needed. - Provides an appropriate starting buffer size to the
StringBuilderobjects. - Reduces the amount of
synchronization.
BufferManagerimprovements:- Uses soft references to avoid potential runaway memory leaks.
- Provides additional statistics including the number of buffers zero-filled and detected as garbage collected.
- Javadoc comment improvements.
ApplicationResourcesAccessorimprovements:- Added
Listenerhook for code interested in calls togetMessage. - Used this new hook to decouple AO Lang from AO Hodgepodge.
- Added
FastObjectOutputimprovements:writeFastUTFcompares strings with.equalsto find all duplicates.- Removed internal quick-scan arrays. We've learned to not underestimate the performance of
HashMap. - Improved Javadocs.
FastObjectInputimprovements:- Improved Javadocs.
- Also moving some of the small, general-purpose extensions to the standard Java libraries out of AOServ Client into this new AO Lang project.
AoCollectionsimprovements:- New
filterByValuemethods to get the key set from maps for all entries matching a given value. unmodifiableCopy*methods allow wider generic bounds for more versatility.optimalUnmodifiable*methods allow wider generic bounds for more versatility.unmodifiableIteratormethod allows wider generic bounds for more versatility.filtermethod allows wider generic bounds for more versatility.filterByValuemethods allow wider generic bounds for more versatility.
- New
- New method
XmlUtils.getChildTextContent(Element, String)to get child text content with a one-liner. - New method
FileUtils.readFileAsString(File, Charset)to provide the character set when reading a file into a string. - New localized exception
LocalizedIllegalStateException. - Updated dependencies.