Skip to content

Commit

Permalink
qa: fix some sonarcloud reported code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Mar 15, 2024
1 parent b22b8b9 commit 9e660ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void onRemoteAddEvent(InfoAdded<? extends Info> event) {
case CatalogInfo info -> facade.add(info);
case ServiceInfo config -> configFacade.add(config);
case SettingsInfo config -> configFacade.add(config);
case LoggingInfo config -> log.debug("ignoring unused LoggingInfo");
case LoggingInfo config -> log.debug("ignoring unused LoggingInfo {}", config);
default -> log.warn("Don't know how to handle remote envent {})", event);
}
}
Expand Down Expand Up @@ -189,18 +189,16 @@ private Info loadInfo(InfoModified event) {
Class<? extends CatalogInfo> ctype = (Class<? extends CatalogInfo>) type.getType();
return catalogFacade().get(objectId, ctype).orElse(null);
}
Info configInfo =
switch (type) {
case GEOSERVER -> configFacade.getGlobal();
case SERVICE -> configFacade.getService(objectId, ServiceInfo.class);
case SETTINGS -> configFacade.getSettings(objectId);
case LOGGING -> configFacade.getLogging();
default -> {
log.warn("Don't know how to handle remote modify envent {}", event);
yield null;
}
};
return configInfo;
return switch (type) {
case GEOSERVER -> configFacade.getGlobal();
case SERVICE -> configFacade.getService(objectId, ServiceInfo.class);
case SETTINGS -> configFacade.getSettings(objectId);
case LOGGING -> configFacade.getLogging();
default -> {
log.warn("Don't know how to handle remote modify envent {}", event);
yield null;
}
};
}

@EventListener(DefaultWorkspaceSet.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public <T extends CatalogInfo, R extends CatalogInfoRepository<T>> R repositoryF
return (R) repos.forObject(info);
}

@SuppressWarnings("java:S1452")
public List<CatalogInfoRepository<?>> all() {
return repos.getAll();
}
Expand Down

0 comments on commit 9e660ec

Please sign in to comment.