From 4bef9391e1fc0dcaf1fadc21b1ced213111b1f98 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Tue, 27 Feb 2024 12:41:29 +0100 Subject: [PATCH] fix some warnings --- .../hostsharing/hsadminng/rbac/rbacdef/RbacView.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java index b8ae11e4..5317b882 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacdef/RbacView.java @@ -5,6 +5,7 @@ import java.util.function.Consumer; import lombok.EqualsAndHashCode; import lombok.Getter; import net.hostsharing.hsadminng.hs.office.relationship.HsOfficeRelationshipEntity; +import net.hostsharing.hsadminng.persistence.HasUuid; import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject; import jakarta.validation.constraints.NotNull; @@ -102,7 +103,7 @@ public class RbacView { } public RbacView importRootEntityAliasProxy( - final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { if ( rootEntityAliasProxy != null ) { throw new IllegalStateException("there is already an entityAliasProxy: " + rootEntityAliasProxy); } @@ -111,18 +112,18 @@ public class RbacView { } public RbacView importEntityAlias( - final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { importEntityAliasImpl(aliasName, entityClass, fetchSql, dependsOnColum); return this; } - private EntityAlias importEntityAliasImpl(final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { + private EntityAlias importEntityAliasImpl(final String aliasName, final Class entityClass, final SQL fetchSql, final Column dependsOnColum) { final var entityAlias = new EntityAlias(aliasName, entityClass, fetchSql, dependsOnColum); entityAliases.put(aliasName, entityAlias); try { importAsAlias(aliasName, rbacDefinition(entityClass)); - } catch ( final Exception exc) { - new RuntimeException("cannot import entity: " + entityClass, exc); + } catch ( final ReflectiveOperationException exc) { + throw new RuntimeException("cannot import entity: " + entityClass, exc); } return entityAlias; }