From 6127bb50e17d49c843e0aaf417e8ac5ed1e3169e Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Wed, 4 Oct 2023 07:13:10 +0200 Subject: [PATCH] Removes warnings Signed-off-by: Frank Schnicke --- .../authorization/internal/AuthorizedAASRegistry.java | 2 +- .../authorization/internal/KeycloakRoleAuthenticator.java | 2 ++ .../authorization/internal/RbacRuleSetDeserializer.java | 1 + .../basyx/vab/protocol/http/server/BaSyxContext.java | 6 +++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/eclipse/basyx/extensions/aas/registration/authorization/internal/AuthorizedAASRegistry.java b/src/main/java/org/eclipse/basyx/extensions/aas/registration/authorization/internal/AuthorizedAASRegistry.java index defa31c4..18b8c2be 100644 --- a/src/main/java/org/eclipse/basyx/extensions/aas/registration/authorization/internal/AuthorizedAASRegistry.java +++ b/src/main/java/org/eclipse/basyx/extensions/aas/registration/authorization/internal/AuthorizedAASRegistry.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; + import org.eclipse.basyx.aas.metamodel.map.AssetAdministrationShell; import org.eclipse.basyx.aas.metamodel.map.descriptor.AASDescriptor; import org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor; @@ -40,7 +41,6 @@ import org.eclipse.basyx.extensions.shared.authorization.internal.ISubjectInformationProvider; import org.eclipse.basyx.extensions.shared.authorization.internal.InhibitException; import org.eclipse.basyx.extensions.shared.authorization.internal.NotAuthorizedException; -import org.eclipse.basyx.submodel.metamodel.api.ISubmodel; import org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier; import org.eclipse.basyx.submodel.metamodel.api.reference.IReference; import org.eclipse.basyx.vab.exception.provider.ProviderException; diff --git a/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/KeycloakRoleAuthenticator.java b/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/KeycloakRoleAuthenticator.java index 492e5827..bf8c6034 100644 --- a/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/KeycloakRoleAuthenticator.java +++ b/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/KeycloakRoleAuthenticator.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.context.SecurityContextHolder; @@ -97,6 +98,7 @@ private List getResoureAccessRoles(JwtAuthenticationToken token) { return resourceAccess.values().stream().map(this::getCategoryRoles).flatMap(List::stream).collect(Collectors.toList()); } + @SuppressWarnings("unchecked") private List getCategoryRoles(Object categoryObject) { final Map category = (Map) categoryObject; diff --git a/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/RbacRuleSetDeserializer.java b/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/RbacRuleSetDeserializer.java index 705d108a..771b5467 100644 --- a/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/RbacRuleSetDeserializer.java +++ b/src/main/java/org/eclipse/basyx/extensions/shared/authorization/internal/RbacRuleSetDeserializer.java @@ -127,6 +127,7 @@ private InputStream getInputStreamFromFile(final String filePath) throws IOExcep throw new IOException("could not find " + filePath); } + @SuppressWarnings("unused") private static class RbacRuleMultiple { String role; String[] actions; diff --git a/src/main/java/org/eclipse/basyx/vab/protocol/http/server/BaSyxContext.java b/src/main/java/org/eclipse/basyx/vab/protocol/http/server/BaSyxContext.java index f820aa8a..21e6b4bd 100644 --- a/src/main/java/org/eclipse/basyx/vab/protocol/http/server/BaSyxContext.java +++ b/src/main/java/org/eclipse/basyx/vab/protocol/http/server/BaSyxContext.java @@ -24,16 +24,16 @@ ******************************************************************************/ package org.eclipse.basyx.vab.protocol.http.server; -import org.apache.catalina.Context; -import org.springframework.lang.Nullable; - import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; + import javax.servlet.http.HttpServlet; +import org.springframework.lang.Nullable; + /** * BaSyx context that contains an Industrie 4.0 Servlet infrastructure *