From 44dc690736d0f89168d1b7731f51844e0a102ba2 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Fri, 27 Dec 2024 23:15:55 +0100 Subject: [PATCH] Few javadoc update --- .../pandacube/lib/bungee/chat/ChatBungee.java | 3 +++ .../lib/reflect/ReflectionWrapperBypass.java | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandalib-bungee-chat/src/main/java/fr/pandacube/lib/bungee/chat/ChatBungee.java b/pandalib-bungee-chat/src/main/java/fr/pandacube/lib/bungee/chat/ChatBungee.java index 60e6701..fd557fe 100644 --- a/pandalib-bungee-chat/src/main/java/fr/pandacube/lib/bungee/chat/ChatBungee.java +++ b/pandalib-bungee-chat/src/main/java/fr/pandacube/lib/bungee/chat/ChatBungee.java @@ -71,4 +71,7 @@ public class ChatBungee { BaseComponent[] arr = toBungeeArray(component); return arr.length == 1 ? arr[0] : new net.md_5.bungee.api.chat.TextComponent(arr); } + + + private ChatBungee() {} } diff --git a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectionWrapperBypass.java b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectionWrapperBypass.java index 78fdf8b..c3cbffc 100644 --- a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectionWrapperBypass.java +++ b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectionWrapperBypass.java @@ -16,15 +16,27 @@ public class ReflectionWrapperBypass { private static final AtomicBoolean enabled = new AtomicBoolean(false); + /** + * Enables bypassing the eventual translation of the class names when using {@link Class#forName(String)}. + */ public static void enable() { enabled.set(true); } + /** + * Disables bypassing the eventual translation of the class names when using {@link Class#forName(String)}. + */ public static void disable() { enabled.set(false); } - + /** + * Calls {@link Class#forName(String)}, but detects if the returned class has been translated and if so, uses + * reflection to call {@link Class#forName(String)} (some sort of reflection-ception). + * @param className the binary name of the class or the string representing an array type. + * @return the {@link Class} object for the class with the specified name. + * @throws ClassNotFoundException if the class cannot be located. + */ public static Class getClass(String className) throws ClassNotFoundException { if (!enabled.get()) { return Class.forName(className); @@ -51,4 +63,8 @@ public class ReflectionWrapperBypass { } + + private ReflectionWrapperBypass() {} + + }