Fix: Correctly associate properties from additional metadata#114
Closed
nandorholozsnyak wants to merge 2 commits into
Closed
Fix: Correctly associate properties from additional metadata#114nandorholozsnyak wants to merge 2 commits into
nandorholozsnyak wants to merge 2 commits into
Conversation
This commit resolves issue #112 where properties defined in `additional-spring-configuration-metadata.json` without an explicit `sourceType` were incorrectly assigned to an "Unknown group" instead of their intended custom group defined in the same file. Changes include: - Enhanced `MetadataReader.getPropertyMap` to infer the `sourceType` for properties from additional metadata by matching their name prefix against group names. If a match is found, the group's `sourceType` (or `type`) is used for the property. - Updated `MetadataReader.setProperties` to use `propertyGroup.getSourceType()` when retrieving properties from the map, ensuring consistency. - Refined `MetadataReader.getSourceTypeOrDefault` for groups to fall back to the group's `type` if `sourceType` is null, allowing such groups to correctly gather properties. - Added a unit test to `MetadataReaderTest.java` specifically for issue #112, verifying that properties from additional metadata are correctly assigned to their custom groups.
… compat) This commit resolves issue #112 where properties defined in `additional-spring-configuration-metadata.json` without an explicit `sourceType` were incorrectly assigned to an "Unknown group" instead of their intended custom group defined in the same file. Changes include: - Enhanced `MetadataReader.getPropertyMap` to infer the `sourceType` for properties from additional metadata by matching their name prefix against group names. If a match is found, the group's `sourceType` (or `type`) is used for the property. - Updated `MetadataReader.setProperties` to use `propertyGroup.getSourceType()` when retrieving properties from the map, ensuring consistency. - Refined `MetadataReader.getSourceTypeOrDefault` for groups to fall back to the group's `type` if `sourceType` is null, allowing such groups to correctly gather properties. - Added a unit test to `MetadataReaderTest.java` specifically for issue #112, with comprehensive assertions to verify that properties from additional metadata are correctly assigned to their custom groups and not to any other group. - Modified the unit test to use Java 11-compatible string definition instead of a Java 15+ text block.
Member
Author
|
It was a Jules AI try, closing it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit resolves issue #112 where properties defined in
additional-spring-configuration-metadata.jsonwithout an explicitsourceTypewere incorrectly assigned to an "Unknown group" instead of their intended custom group defined in the same file.Changes include:
MetadataReader.getPropertyMapto infer thesourceTypefor properties from additional metadata by matching their name prefix against group names. If a match is found, the group'ssourceType(ortype) is used for the property.MetadataReader.setPropertiesto usepropertyGroup.getSourceType()when retrieving properties from the map, ensuring consistency.MetadataReader.getSourceTypeOrDefaultfor groups to fall back to the group'stypeifsourceTypeis null, allowing such groups to correctly gather properties.MetadataReaderTest.javaspecifically for issue Unknown group when using additional-spring-configuration-metadata.json #112, verifying that properties from additional metadata are correctly assigned to their custom groups.