Skip to content

Fix MavenResourcesExecution.copyOf() to copy missing fields - #374

Draft
elharo wants to merge 1 commit into
masterfrom
fix-copyOf-missing-fields
Draft

Fix MavenResourcesExecution.copyOf() to copy missing fields#374
elharo wants to merge 1 commit into
masterfrom
fix-copyOf-missing-fields

Conversation

@elharo

@elharo elharo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #350

MavenResourcesExecution.copyOf() was missing four fields:

  • flatten
  • propertiesEncoding
  • delimiters
  • interpolatorCustomizer

These fields were silently dropped when BaseFilter clones the execution object via copyOf(), causing unexpected behavior when the copied instance was used for filtering.

This fix adds the missing field copies and includes tests to verify all four fields are preserved.

copyOf() was missing flatten, propertiesEncoding, delimiters, and
interpolatorCustomizer fields. This caused these fields to be lost
when BaseFilter clones the execution object.
@elharo
elharo requested a review from rmannibucau August 20, 2026 21:04

@rmannibucau rmannibucau left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to guard InterpolatorCustomizer against broken reuse if not stateless somehow? this one can be contextual and copying it can lead to a broken runtime - not in the plugin I'm thinking of but as a shared lib it is, or is a javadoc comment sufficient?

@elharo

elharo commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

do we want to guard InterpolatorCustomizer against broken reuse if not stateless somehow? this one can be contextual and copying it can lead to a broken runtime - not in the plugin I'm thinking of but as a shared lib it is, or is a javadoc comment sufficient?

Good point. I'll need to think about that. Possibly we should not copy it here. Possibly it should not be a field at all. Possibly it should be stateless. Maybe something else? I don't know yet.

@elharo
elharo marked this pull request as draft August 20, 2026 21:26
@rmannibucau

Copy link
Copy Markdown

my first thought was "we shouldn't copy the full model but a "view" but it can make the copy useless too so maybe copyModel() and let the caller copy the dynamic parts if relevant? - thinking out loud

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.

MavenResourcesExecution.copyOf() drops multiple fields

2 participants