From 9998f9c4a3c86071fc380a0f043e8e772bf6cd69 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 8 Jun 2024 13:55:32 +0200 Subject: [PATCH] fix a warning in PermissionManager --- src/main/java/de/tudbut/security/PermissionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/tudbut/security/PermissionManager.java b/src/main/java/de/tudbut/security/PermissionManager.java index f058604..5d4748e 100644 --- a/src/main/java/de/tudbut/security/PermissionManager.java +++ b/src/main/java/de/tudbut/security/PermissionManager.java @@ -45,7 +45,7 @@ public interface PermissionManager extends Cloneable { return clazz.getName(); try { // Reset the name field so that it must be cached again - Field nameField = clazz.getClass().getDeclaredField("name"); + Field nameField = Class.class.getDeclaredField("name"); ReflectUtil.forceAccessible(nameField); nameField.set(clazz, null); // name is clean, getName can now be used. @@ -59,7 +59,7 @@ public interface PermissionManager extends Cloneable { cache[idx] = false; try { // Unable to reset the name field, invoking the native that gets the name directly - Method initClassName = clazz.getClass().getDeclaredMethod("initClassName"); + Method initClassName = Class.class.getDeclaredMethod("initClassName"); ReflectUtil.forceAccessible(initClassName); return (String) initClassName.invoke(clazz); }