code formatter

This commit is contained in:
Shinsuke Sugaya 2020-02-14 23:06:03 +09:00
parent aae90a31cb
commit 31f2e82bd6
3 changed files with 20 additions and 22 deletions

View file

@ -297,9 +297,8 @@ public class AdminGroupAction extends FessAdminAction {
}
public static void validateAttributes(final Map<String, String> attributes, final Consumer<VaMessenger<FessMessages>> throwError) {
ComponentUtil.getLdapManager().validateGroupAttributes(Long.class, attributes, s ->
throwError.accept(messages -> messages.addErrorsPropertyTypeLong("attributes." + s,
"attributes." + s)));
ComponentUtil.getLdapManager().validateGroupAttributes(Long.class, attributes,
s -> throwError.accept(messages -> messages.addErrorsPropertyTypeLong("attributes." + s, "attributes." + s)));
}
// ===================================================================================

View file

@ -359,9 +359,8 @@ public class AdminUserAction extends FessAdminAction {
}
public static void validateAttributes(final Map<String, String> attributes, final Consumer<VaMessenger<FessMessages>> throwError) {
ComponentUtil.getLdapManager().validateUserAttributes(Long.class, attributes, s ->
throwError.accept(messages -> messages.addErrorsPropertyTypeLong("attributes." + s,
"attributes." + s)));
ComponentUtil.getLdapManager().validateUserAttributes(Long.class, attributes,
s -> throwError.accept(messages -> messages.addErrorsPropertyTypeLong("attributes." + s, "attributes." + s)));
}
// ===================================================================================

View file

@ -886,14 +886,14 @@ public class LdapManager {
final String attrUidNumber = fessConfig.getLdapAttrUidNumber();
final String attrGidNumber = fessConfig.getLdapAttrGidNumber();
Stream.of(attrUidNumber, attrGidNumber).forEach(attrName ->
OptionalUtil.ofNullable(attributes.get(attrName)).filter(StringUtil::isNotBlank).ifPresent(s -> {
try {
DfTypeUtil.toLong(s);
} catch (final NumberFormatException e) {
consumer.accept(attrName);
}
}));
Stream.of(attrUidNumber, attrGidNumber).forEach(
attrName -> OptionalUtil.ofNullable(attributes.get(attrName)).filter(StringUtil::isNotBlank).ifPresent(s -> {
try {
DfTypeUtil.toLong(s);
} catch (final NumberFormatException e) {
consumer.accept(attrName);
}
}));
} else {
// do nothing
}
@ -1043,14 +1043,14 @@ public class LdapManager {
// Long type attributes
final String attrGidNumber = fessConfig.getLdapAttrGidNumber();
Stream.of(attrGidNumber).forEach(attrName ->
OptionalUtil.ofNullable(attributes.get(attrName)).filter(StringUtil::isNotBlank).ifPresent(s -> {
try {
DfTypeUtil.toLong(s);
} catch (final NumberFormatException e) {
consumer.accept(attrName);
}
}));
Stream.of(attrGidNumber).forEach(
attrName -> OptionalUtil.ofNullable(attributes.get(attrName)).filter(StringUtil::isNotBlank).ifPresent(s -> {
try {
DfTypeUtil.toLong(s);
} catch (final NumberFormatException e) {
consumer.accept(attrName);
}
}));
} else {
// do nothing
}