Skip to content

fix: object and collection convertion#100

Merged
svaningelgem merged 4 commits intomasterfrom
claude/fix-yaml-test-5HPTI
Dec 15, 2025
Merged

fix: object and collection convertion#100
svaningelgem merged 4 commits intomasterfrom
claude/fix-yaml-test-5HPTI

Conversation

@svaningelgem
Copy link
Collaborator

No description provided.

claude and others added 4 commits December 15, 2025 15:37
When a field has type Map<String, Object> and the YAML contains a
List or Map value, the code was attempting to create a collection
instance but failing because Object.class is not assignable from
List/Set/Queue.

The fix checks if the expected type is Object and the value is
already a Collection or Map, and if so, returns it as-is since we
don't have type information to guide conversion.

This fixes the testWrongCollection test which uses nested maps
with List values: Map<String, Map<String, Object>>

Fixes issue where loading YAML with mixed types in Object-typed
map values would throw "Unsupported collection type: Object"
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../main/java/org/avarion/yaml/YamlFileInterface.java 50.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
...n/java-v1/org/avarion/yaml/v1/YamlWrapperImpl.java 100.00% <ø> (ø)
...n/java-v2/org/avarion/yaml/v2/YamlWrapperImpl.java 100.00% <ø> (ø)
src/main/java/org/avarion/yaml/YamlWriter.java 94.11% <ø> (ø)
.../main/java/org/avarion/yaml/YamlFileInterface.java 90.03% <50.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@svaningelgem svaningelgem merged commit a089c00 into master Dec 15, 2025
2 of 3 checks passed
@svaningelgem svaningelgem deleted the claude/fix-yaml-test-5HPTI branch December 15, 2025 15:54
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.

3 participants