Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Sep 11, 2025

This pull request refactors and enhances the utility methods for extracting nested properties from maps in the DotUtils class, improving support for dot-notated paths and type safety. It also updates related tests to verify the new behaviors and fixes import usages for test fixtures. The most significant changes are grouped below:

DotUtils enhancements

  • Refactored mapFrom, listFrom, and arrayFrom methods in DotUtils to support extraction from nested properties using dot-notated paths and improved type safety checks. Added a new typed variant listFrom(Map<String, Object> source, String property, Class<T> clazz) for extracting lists of a specific type. [1] [2]
  • Introduced internal helper methods getObjectFromSource (for traversing nested map paths) and convertToObjectArray (for safely converting primitive arrays to Object[]).

PathCommon improvement

  • Improved property extraction logic in PathCommon#getPropertyValue to fall back to map access when the source object is a Map and the property exists, increasing robustness for mixed data types.

@petruki petruki self-assigned this Sep 11, 2025
@sonarqubecloud
Copy link

@petruki petruki merged commit e8a1fdb into master Sep 11, 2025
7 checks passed
@petruki petruki deleted the staging branch September 11, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants