Skip to content

Fix: Correctly associate properties from additional metadata#114

Closed
nandorholozsnyak wants to merge 2 commits into
masterfrom
fix/issue-112-unknown-group-additional-metadata
Closed

Fix: Correctly associate properties from additional metadata#114
nandorholozsnyak wants to merge 2 commits into
masterfrom
fix/issue-112-unknown-group-additional-metadata

Conversation

@nandorholozsnyak

Copy link
Copy Markdown
Member

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 Unknown group when using additional-spring-configuration-metadata.json #112, verifying that properties from additional metadata are correctly assigned to their custom groups.

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.
@nandorholozsnyak

Copy link
Copy Markdown
Member Author

It was a Jules AI try, closing it.

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.

1 participant