diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/client/SidoData.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/client/SidoData.java index b79d7e14bdfc34794470ed3872a2a7b3e2de2921..42eecd568df21f49757ab3451e7285d964ea9464 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/client/SidoData.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/client/SidoData.java @@ -37,7 +37,7 @@ public final class SidoData { * @return instance singleton. */ public static SidoData getInstance() { - return SidoData.instance; + return instance; } /** diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/dao/DatasetDaoImpl.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/dao/DatasetDaoImpl.java index b961af33a51fff88bca215b841c42d4f0d917057..e27454647d0344b33d3045b86c0dc37a1ed42e0b 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/dao/DatasetDaoImpl.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/dao/DatasetDaoImpl.java @@ -263,15 +263,10 @@ public final class DatasetDaoImpl extends DaoHibernate implements DatasetDao { @Override public Set<User> getOwners(final long datasetId) { LOGGER.traceEntry("datasetId: " + datasetId); - try (ScopedEntityManager em = getScopedEntityManager()) { - final Dataset dataset = findById(datasetId); - final Set<User> result = dataset.getUsers(); - LOGGER.traceExit(result); - return result; - } catch (final javax.persistence.NoResultException e) { - LOGGER.traceExit(); - return new HashSet<>(); - } + final Dataset dataset = findById(datasetId); + final Set<User> result = dataset.getUsers(); + LOGGER.traceExit(result); + return result; } diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/downloadfile/FileDownloadServlet.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/downloadfile/FileDownloadServlet.java index 3d2878e6af81efdb4d17a7944a9a1b8d6980b9a6..ad428adc9b4c0b706efe5e483636b3c28d5650eb 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/downloadfile/FileDownloadServlet.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/downloadfile/FileDownloadServlet.java @@ -89,7 +89,6 @@ public class FileDownloadServlet extends AbstractServlet { response.setContentType(CONTENT_TYPE_TEXT_PLAIN); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, i18n.get("msgSessionExpired")); - return; } else { final String fileName; final String filePath; diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/metadata/IdentifierScheme.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/metadata/IdentifierScheme.java index 25ba97010c99b94122dd9b83fd18a867339ff659..f3218e9a771810b66c54755fdbb7a4f3ab641c01 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/metadata/IdentifierScheme.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/metadata/IdentifierScheme.java @@ -32,11 +32,19 @@ public enum IdentifierScheme { */ private final String identifierValue; + /** + * Constructor. + * + * @param value identifier value + */ IdentifierScheme(final String value) { identifierValue = value; } - public final String getValue() { + /** + * @return identifier value + */ + public String getValue() { return identifierValue; } diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/model/oauth2/Scope.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/model/oauth2/Scope.java index e23f6cb83e4438d961daebf2c4d0c38e567c09ec..1d5b20ddad1beb157a6618e4b788cabb32fbc8df 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/model/oauth2/Scope.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/model/oauth2/Scope.java @@ -37,7 +37,7 @@ public enum Scope { * @return Scope according to the name */ public static Scope fromName(final String name) { - for (final Scope scope : Scope.values()) { + for (final Scope scope : values()) { if (scope.getName().equals(name)) { return scope; } @@ -52,7 +52,7 @@ public enum Scope { public static int getScopeSum(final List<String> names) { int sum = 0; for (final String name: names) { - sum += Scope.fromName(name).getId(); + sum += fromName(name).getId(); } return sum; } diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OIDCSessionAttributes.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OIDCSessionAttributes.java index 86c9f528080a3db5c085f243dd174f3d184784a2..c22b3bfd7beec1f62676d82a1363dc68f96118a6 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OIDCSessionAttributes.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OIDCSessionAttributes.java @@ -53,7 +53,7 @@ public enum OIDCSessionAttributes { * Getter for the attribute constant. * @return the constant as a String */ - public final String getAttribute() { + public String getAttribute() { return sessionAttribute; } diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OpenIdCallbackServlet.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OpenIdCallbackServlet.java index 8331972b5df8405bd9647d648a8d98ed2fedb380..5ccfdfb3d639af99c94ae11f4a0e6d1f4393606a 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OpenIdCallbackServlet.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/server/openid/OpenIdCallbackServlet.java @@ -185,7 +185,7 @@ public class OpenIdCallbackServlet extends HttpServlet { final OIDCProviderMetadata providerMetadata = oidcHandler.getProvidersMetadata().get(oidcIdp.getId()); URI redirectURI; try { - redirectURI = new URI(config.get(Key.APP_URL) + OpenIdCallbackServlet.REDIRECTURL); + redirectURI = new URI(config.get(Key.APP_URL) + REDIRECTURL); } catch (final URISyntaxException e) { LOGGER.error(e); throw new IOException("SIDO redirection URI was broken !"); diff --git a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/shared/StringUtils.java b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/shared/StringUtils.java index 1d741136a7a5c0a749badc6fe9f55363b0576730..b12dd61a6e3ac0038da1ea53fbc8fbb88a05a065 100644 --- a/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/shared/StringUtils.java +++ b/sido-gwt/src/main/java/fr/soeretempo/sido/gwt/shared/StringUtils.java @@ -64,9 +64,8 @@ public final class StringUtils { final Long parsed = Long.valueOf(value); return Optional.of(parsed); } catch (final Exception e) { - + return Optional.empty(); } - return Optional.empty(); } /**