Release 1.2.2
New Features
XML Balance Checking
- XMLBalanceCheckFilter: Added a new filter to ensure that XML tokens are properly balanced in the DiffHandler processing pipeline
- Tracks start and end element pairs to verify they match correctly
- Detects and reports XML structure imbalances including extra or missing elements
- Provides diagnostics through the method and detailed error reporting
isBalanced() - Useful for validating XML integrity during difference operations
API Improvements
Enhanced XMLToken Interface
- Improved Null Safety: Added annotations throughout the API to prevent null pointer exceptions
@NotNull - Standardized Documentation: Enhanced Javadoc clarity with consistent descriptions and improved parameter/return value documentation
- New Default Methods: Added the method to simplify whitespace detection across token types
isWhitespace() - Clarified Contract: Improved documentation on equals/hashCode implementation requirements for better performance
Whitespace Handling
- Simplified Whitespace Detection: Replaced custom
isWhiteSpacemethods with the standardized approach in both andtoken.isWhitespace()``WhitespaceStripper``ExtendedWhitespaceStripper - Enhanced Processing Logic: Improved the whitespace processing algorithm for more consistent results
- Better Edge Case Handling: Added test cases for complex mixed content scenarios
- Fixed Context Management: Implemented more robust context tracking for accurate whitespace preservation
Full Changelog: v1.2.1...v1.2.2