Skip to content

Feature/8.7.1 - #116

Merged
pmrogala merged 8 commits into
mainfrom
feature/8.7.1
Dec 4, 2025
Merged

Feature/8.7.1#116
pmrogala merged 8 commits into
mainfrom
feature/8.7.1

Conversation

@pmrogala

@pmrogala pmrogala commented Dec 4, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI and others added 8 commits December 4, 2025 17:00
Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
…ableTypeFullName

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
…tc.)

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
…generic parameters

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
…115)

* Initial plan

* Add AddTo method generation for arrays with child builders

- Added ArrayCollectionMetadata class to represent array collections
- Updated CollectionMethodDetector to detect and handle array types
- Implemented array-specific AddTo method generation for both regular and child builder scenarios
- Added ParentWithChildArrayEntity test entity
- Added comprehensive integration tests for array AddTo methods
- Updated CHANGELOG.md with fix details

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

* Remove unused imports from ParentWithChildArrayEntity

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

* Refactor array handling to use List internally with ToArray() conversion

Updated approach per code review feedback:
- Arrays now use List<T> for internal storage
- Conversion to array happens in Build() method via ToArray()
- AddTo methods use List.Add/AddRange instead of Array.Copy
- Simpler and more performant for multiple AddTo calls

Note: This changes semantics - With methods now create new array instances
rather than preserving reference equality. 8 tests fail due to this change.

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

* Revert to array backing field with Array.Copy approach

Reverted changes from commit 5eab549 to restore the original Array.Copy
implementation from commit ac3a84b. This preserves reference equality
semantics for With methods while still supporting AddTo methods for arrays.

All 111 tests now pass (previously 8 were failing with List approach).

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

* Refactor: Consolidate array and concrete collection AddTo generation

Unified the code generation for arrays and concrete collections to reduce
duplication. Both types now share the same pattern with conditional logic
to handle the differences (Array.Copy vs collection.Add).

This addresses code review feedback about similar-looking generation code
between ArrayCollectionMetadata and ConcreteCollectionMetadata.

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

* Improve code readability in child builder AddTo generation

Extracted the inline conditional for whitespace formatting into a
clearer methodBody variable. This makes the code more maintainable
and easier to understand.

Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pmrogala <9459432+pmrogala@users.noreply.github.com>
Co-authored-by: Cranter <progala@ecovadis.com>
@pmrogala
pmrogala merged commit 173863a into main Dec 4, 2025
1 check passed
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