Skip to content

v2.1.0

Latest
Compare
Choose a tag to compare
@david-waltermire david-waltermire released this 26 Nov 18:26
· 0 commits to main since this release

This minor release incorporates a bunch of bug fixes, new features, and code refactoring that will improve the stability of runtimes, and the maintainability of the code and use of the APIs.

What's New

  • The following new Metapath functions were added:

  • The time and time-with-timezone data types were added to support the fn:current-date Metapath function. (#265)

  • Support for the following Metapath expressions was added:

  • Expanded the Metapath ANTR grammar to include kind tests. (#136)

    • Completed support for flag, field, assembly, and document kind tests.
    • Added support for IArrayItem contents IItemType matching.
  • The internal type system was greatly improved to support these new Metapath expressions. This system is more robust and lays the groundwork for "instance of", "castable", other type related tests, and dynamic function declarations. (#136, #264)

    • All IItem and ICollectionValue types now have an atomize() method, which provides the prior functionality of the similar names method in FnData,
    • Cleaned up use of getAtomicItem() methods to ensure more consistent use.
    • Added IItem.toSignature() and ICollectionValue.toSignature(), which provides the type signature of the object based on its type. The toString() method on these implementations will also provide the same signature to aid in debugging.
    • Refactored QName use to use an new IEnhancedQName that supports caching qualified names using a numeric index. Name resolution now handled by the StaticContext. Switch flag and model name resolution from IModule to IModule.getStaticContext().
    • Replaced QName based lookups with integer index-based lookups. Use of integer-based indexes should reduce memory usage and enables more efficient integer-based lookups in place of string-based matching.
    • Added support for sequence type matching on sequences.
    • Refactored data type service to handle abstract types that have no associated adapter so that all data types can be discovered using the service.
    • Refactored data and date/time data types to have the ambiguous data type interfaces be the parent of the non-ambiguous data types. This aligns better with the data type naming and the semantics of how they work.
    • Refactored data type and atomic item implementations to move casting operations to the atomic item implementations. This creates a cleaner isolation between the type adapters and Metapath items. (#245)
    • Improved date and date-time adapter unit testing to check for ambiguity and resulting time value.
  • Other refactoring, includes: (#136)

    • Cleaned up all IGroupable implementations to simplify code and reduce methods.
    • Refactored the implementations supporting model container generation, by reducing the number of implementations and implementing a builder pattern to store container information while the container is being built. This enabled cleanup of some duplicate code identified by CPD in XmlFlagContainerSupport and other classes.
    • Removed a bunch of unnecessary interfaces and unwound some significant spaghetti code.
    • Moved the sequence collector toSequencefrom ISequence to CustomCollectors.
    • Added a location hint to ISource which will provide the URI or class for the Metaschema module. Cleaned up source information to provide more context in exceptions. Improved some exceptions using this information.
    • Refactored exception handling in StaticContext lookup methods.
    • Added a bunch of missing Javadocs.
    • Added many missing Javadocs. Adjusted many existing Javadocs to provide more details. (#245)
    • Removed some unused constants.
    • Performed some light refactoring to remove unused code and to improve overall code readability to make maintenance easier.
    • Replaced Paths.get("") with Paths.get(System.getProperty(user.dir)) to be more explicit.
    • Improved value creation methods in date and date/time item classes.
    • Refactored the result type used in MetapathExpression to avoid the need for a case statement. This should result in cleaner code and better performance overall.
    • Removed some commented out code.
    • Updated some inconsistent Log4j2 configurations to be consistent with other configurations.
    • Updated build and unit testing dependencies through parent POM.
    • Improved parser errors and warnings to include the resource the error was found in.
  • Unit test improvements:

    • Added some unit test assertions to ensure HTML to Markdown conversion is tested more completely. (#245)
    • Significantly improved data and date/time parsing test vectors.
  • Updated the Metaschema submodule to latest in metaschema-framework/metaschema develop.

Bug Fixes

  • Resolved #259 by delaying registering module in validation commands to just before constraint validation to ensure schemas are generated directly from the loaded module and not the compiled version. (#263)
  • Fixed a bug related to how sequence transitions from IArrayItem and IMapItem were handled, where they weren't unwrapped properly. (#136)
    • Split ICollectionValue.asSequence() into two methods: 1) toSequence(), which has the same behavior of generating a sequence containing the value. 2) contentsAsSequence() which will return the item's contents as a ISequence if the item is multivalued (i.e., IArrayItem, IMapItem), or the item otherwise.
  • Resolved @258 by disallowing partial metapath parsing, which allowed invalid metapaths to be used if the first part was seen as valid. **Note: This may result in some erroneous Metapaths now being caught, where previously they were allowed. Double checked OSCAL internal constraints to make sure that this wasn't the case there. (#260)
  • Fixed an issue that prevented constraints to be applied to the built-in Metaschema module module.
  • Also fixed an issue that prevented newer binding matchers from overriding previous binding matchers where they have the same element names.

Breaking Changes

There are some minimal breaking changes in this release that are limited to publicly visible implementation classes focused around data type, Metapath items, Metapath function declaration, the Metapath StaticContext, and some internal model classes. These changes will not affect the majority of applications using this library, unless the library is providing custom data types or Metapath functions. liboscal-java was updated based on these changes, and provides a good example of the minimal scope of these changes.

What's Changed

Full Changelog: v2.0.1...v2.1.0