Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EAK-488] Fixed improper rendering of blank attributes #489

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading