Fix MavenResourcesExecution.copyOf() to copy missing fields - #374
Conversation
copyOf() was missing flatten, propertiesEncoding, delimiters, and interpolatorCustomizer fields. This caused these fields to be lost when BaseFilter clones the execution object.
rmannibucau
left a comment
There was a problem hiding this comment.
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. |
|
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 |
Fixes #350
MavenResourcesExecution.copyOf()was missing four fields:flattenpropertiesEncodingdelimitersinterpolatorCustomizerThese fields were silently dropped when
BaseFilterclones the execution object viacopyOf(), 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.