plugins/ofmeet: hide the NoSuchFieldException sys_paths

Co-authored-by: Dzikoysk <dzikoysk@dzikoysk.net>
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
Sergey Ponomarev 2024-08-11 11:43:24 +03:00
parent 50c54bf6c7
commit 8741ee24cc

View File

@ -401,14 +401,19 @@ public class SparkMeetPlugin implements Plugin, ChatRoomListener, GlobalMessageL
System.setProperty("java.library.path", newLibPath);
// this will reload the new setting
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
fieldSysPath.setAccessible(true);
fieldSysPath.set(System.class.getClassLoader(), null);
try {
@SuppressWarnings("JavaReflectionMemberAccess")
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
fieldSysPath.setAccessible(true);
fieldSysPath.set(System.class.getClassLoader(), null);
} catch (NoSuchFieldException ignored) {
// Happens on non Oracle JDK but has no influence since there is no cached field that needs a reset
}
}
}
catch (Exception e)
{
Log.warning(e.getMessage(), e);
Log.warning("Error during loading of Pade Meetings plugin", e);
}
}