fix a warning in PermissionManager
This commit is contained in:
parent
37fe627477
commit
9998f9c4a3
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue