Skip to content

Commit

Permalink
Merge pull request #489 from exadel-inc/bugfix/EAK-488
Browse files Browse the repository at this point in the history
[EAK-488] Fixed improper rendering of blank attributes
  • Loading branch information
smiakchilo authored Nov 13, 2023
2 parents b1deed5 + 9d9a85d commit 2e6b312
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ public class XmlContextHelper implements XmlUtility {
* Default routine to manage the merging of two values of an XML attribute by suppressing existing value in favor of
* a non-empty new one
*/
private static final BinaryOperator<String> DEFAULT_ATTRIBUTE_MERGER = (first, second) -> StringUtils.isNotBlank(second) ? second : first;
private static final BinaryOperator<String> DEFAULT_ATTRIBUTE_MERGER = (first, second) -> {
if (StringUtils.isNotBlank(first) && StringUtils.isBlank(second)) {
return first;
}
return StringUtils.isNotEmpty(second) ? second : first;
};

/* ---------------------------------
Instance members and constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@
@SuppressWarnings("HiddenField") // Allows to pass {@code name} arguments in attribute constructors
class TargetImpl extends AdaptationBase<Target> implements Target, LegacyHandlerAcceptor {

static final BinaryOperator<String> DEFAULT_ATTRIBUTE_MERGER = (first, second) -> StringUtils.isNotBlank(second) ? second : first;
static final BinaryOperator<String> DEFAULT_ATTRIBUTE_MERGER = (first, second) -> {
if (StringUtils.isNotBlank(first) && StringUtils.isBlank(second)) {
return first;
}
return StringUtils.isNotEmpty(second) ? second : first;
};

/* -----------------------------
Local fields and constructors
Expand Down

0 comments on commit 2e6b312

Please sign in to comment.