mirror of https://github.com/apache/maven.git
Do not recreate nodes if merge does nothing
This commit is contained in:
parent
a6f52774eb
commit
97518b5b29
|
@ -357,8 +357,15 @@ public static XmlNode merge(XmlNode dominant, XmlNode recessive, Boolean childMe
|
|||
if (children == null) {
|
||||
children = dominant.getChildren();
|
||||
}
|
||||
return new XmlNodeImpl(
|
||||
dominant.getName(), value != null ? value : dominant.getValue(), attrs, children, location);
|
||||
if (!Objects.equals(value, dominant.getValue())
|
||||
|| !Objects.equals(attrs, dominant.getAttributes())
|
||||
|| !Objects.equals(children, dominant.getChildren())
|
||||
|| !Objects.equals(location, dominant.getInputLocation())) {
|
||||
return new XmlNodeImpl(
|
||||
dominant.getName(), value != null ? value : dominant.getValue(), attrs, children, location);
|
||||
} else {
|
||||
return dominant;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dominant;
|
||||
|
|
Loading…
Reference in New Issue