Skip to content

Commit

Permalink
Fix modernizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Sep 15, 2023
1 parent 673c241 commit 64ac7f1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ public ConnInstanceTO delete(final String key) {
@PreAuthorize("hasRole('" + IdMEntitlement.CONNECTOR_LIST + "')")
@Transactional(readOnly = true)
public List<ConnInstanceTO> list(final String lang) {
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : new Locale(lang));
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : Locale.of(lang));

return connInstanceDAO.findAll().stream().map(binder::getConnInstanceTO).collect(Collectors.toList());
}

@PreAuthorize("hasRole('" + IdMEntitlement.CONNECTOR_READ + "')")
@Transactional(readOnly = true)
public ConnInstanceTO read(final String key, final String lang) {
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : new Locale(lang));
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : Locale.of(lang));

ConnInstance connInstance = connInstanceDAO.authFind(key);
if (connInstance == null) {
Expand All @@ -178,7 +178,7 @@ public List<ConnIdBundle> getBundles(final String lang) {
if (StringUtils.isBlank(lang)) {
CurrentLocale.set(Locale.ENGLISH);
} else {
CurrentLocale.set(new Locale(lang));
CurrentLocale.set(Locale.of(lang));
}

List<ConnIdBundle> connectorBundleTOs = new ArrayList<>();
Expand Down Expand Up @@ -254,7 +254,7 @@ public void check(final ConnInstanceTO connInstanceTO) {
@PreAuthorize("hasRole('" + IdMEntitlement.CONNECTOR_READ + "')")
@Transactional(readOnly = true)
public ConnInstanceTO readByResource(final String resourceName, final String lang) {
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : new Locale(lang));
CurrentLocale.set(StringUtils.isBlank(lang) ? Locale.ENGLISH : Locale.of(lang));

ExternalResource resource = Optional.ofNullable(resourceDAO.find(resourceName)).
orElseThrow(() -> new NotFoundException("Resource '" + resourceName + '\''));
Expand Down

0 comments on commit 64ac7f1

Please sign in to comment.