Skip to content

Xpp3DomUtils#mergeIntoXpp3Dom() must not override the dominant value in case it is blank #212

Closed
@kwin

Description

@kwin

Despite the javadoc saying that

if the dominant root node's value is empty, set it to the recessive root node's value

which is clearly not true for blank values (i.e. length() > 0), still the dominant root node's value is overwritten by the recessive one in case it is blank(!) due to the trim logic in

return ( str == null || str.trim().length() == 0 );
.

As the Xpp3DomBuilder trims by default it seems like a bug to me that merging two Xpp3Dom s (usually created by Xpp3DomBuilder) should trim again before merging as this would only make a difference in case someone set xml:space="preserve" in the dominant Xpp3Dom which should IMHO take precedence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions