Skip to content

Commit

Permalink
Fixing sonar findings
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Aug 23, 2023
1 parent fa1b5ea commit 6fdf1cf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public ResultObject<AuthenticatedUserInfo> login(final HttpServletRequest servle

private BaseAuthenticatedUserInfoBuilder createDefaultUserInfoBuilder() {
var builder = BaseAuthenticatedUserInfo.builder().authenticated(true)
.groups(defaultUserGroups.get().stream().map(String::trim).collect(Collectors.toList()))
.roles(defaultUserRoles.get().stream().map(String::trim).collect(Collectors.toList()))
.groups(defaultUserGroups.get().stream().map(String::trim).toList())
.roles(defaultUserRoles.get().stream().map(String::trim).toList())
.system(defaultSystem);
for (String entry : defaultContextMapEntries.get()) {
builder.contextMapElement(entry.split(":")[0].trim(), entry.split(":")[1].trim());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void unregister(Path... paths) {
@Override
public List<Path> getRegisteredPaths() {
List<Path> paths = registeredPaths.values().stream().map(AbstractFileDescriptor::getPath)
.collect(Collectors.toList());
.toList();
log.trace("getRegisteredPaths callled, returning {}", paths);
return paths;
}
Expand Down Expand Up @@ -254,10 +254,10 @@ private void handleChangedWatchKey(WatchKey watchKey) {
}
if (log.isTraceEnabled()) {
log.trace("Handling WatchKey-Events {}",
events.stream().map(w -> w.context() + "-" + w.kind()).collect(Collectors.toList()));
events.stream().map(w -> w.context() + "-" + w.kind()).toList());
}
List<AbstractFileDescriptor> changed = registeredPaths.values().stream()
.filter(AbstractFileDescriptor::isUpdated).collect(Collectors.toList());
.filter(AbstractFileDescriptor::isUpdated).toList();

if (changed.isEmpty()) {
log.debug("No actual changes found for path-change WatchKey-Events {}", events);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void keyNamesShouldBeProvidedByConfiguration() {
System.lineSeparator() + "\t" + Joiner.on(System.lineSeparator() + "\t").join(configurationKeys));

final List<String> notFoundKeys = resolvedKeyNames.stream().filter(key -> !configurationKeys.contains(key))
.collect(Collectors.toList());
.toList();
if (!notFoundKeys.isEmpty()) {
fail("Found Keys that are not backed by the provided configuration: " + notFoundKeys
+ ", you can use #getKeysIgnoreList() to filter the keys to be checked");
Expand All @@ -124,7 +124,7 @@ void configurationKeysShouldReverseMapToKeyNames() {
var resolvedKeyNames = resolveKeyNames();
log.info("Checking configurationKeys='{}' against resolvedKeyNames='{}'", resolvedKeyNames, configurationKeys);
List<String> notFoundKeys = configurationKeys.stream().filter(key -> !resolvedKeyNames.contains(key))
.collect(Collectors.toList());
.toList();
if (!notFoundKeys.isEmpty()) {
fail("Found Keys that are not backed by the provided configuration: " + notFoundKeys
+ ", you can use #getConfigurationKeysIgnoreList() to filter the keys to be checked");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void keyNamesShouldBeProvidedByConfiguration() {
System.lineSeparator() + "\t" + Joiner.on(System.lineSeparator() + "\t").join(configurationKeys));

final List<String> notFoundKeys = resolvedKeyNames.stream().filter(key -> !configurationKeys.contains(key))
.collect(Collectors.toList());
.toList();
if (!notFoundKeys.isEmpty()) {
fail("Found Keys that are not backed by the provided configuration: " + notFoundKeys
+ ", you can use #getKeysIgnoreList() to filter the keys to be checked");
Expand All @@ -124,7 +124,7 @@ void configurationKeysShouldReverseMapToKeyNames() {
var resolvedKeyNames = resolveKeyNames();
log.info("Checking configurationKeys='{}' against resolvedKeyNames='{}'", resolvedKeyNames, configurationKeys);
List<String> notFoundKeys = configurationKeys.stream().filter(key -> !resolvedKeyNames.contains(key))
.collect(Collectors.toList());
.toList();
if (!notFoundKeys.isEmpty()) {
fail("Found Keys that are not backed by the provided configuration: " + notFoundKeys
+ ", you can use #getConfigurationKeysIgnoreList() to filter the keys to be checked");
Expand Down

0 comments on commit 6fdf1cf

Please sign in to comment.