diff --git a/sdk/java/logbat-sdk/src/main/java/info/logbat/LogBatFactory.java b/sdk/java/logbat-sdk/src/main/java/info/logbat/LogBatFactory.java index f4ea33a..78bd9a9 100644 --- a/sdk/java/logbat-sdk/src/main/java/info/logbat/LogBatFactory.java +++ b/sdk/java/logbat-sdk/src/main/java/info/logbat/LogBatFactory.java @@ -26,26 +26,14 @@ * be set using the {@link LogBatOptions} class. *
* - * @author KyungMin Lee GitHub - * @version 0.1.0 + * @author KyungMin Lee GitHub, JungJae Park GitHub + * @version 0.1.2 * @since 0.1.0 */ public final class LogBatFactory { private static volatile LogBat instance; - /** - * VarHandle for the LogBat instance, used for thread-safe lazy initialization. - */ - private static final VarHandle INSTANCE; - - static { - try { - INSTANCE = MethodHandles.lookup() - .findStaticVarHandle(LogBatFactory.class, "instance", LogBat.class); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new ExceptionInInitializerError(e); - } - } /** * Returns the singleton instance of LogBat. @@ -116,4 +104,18 @@ private static LogBat createLogbat() throws InvalidOptionException { private LogBatFactory() { throw new UnsupportedOperationException("LogBatFactory cannot be instantiated"); } + + /** + * VarHandle for the LogBat instance, used for thread-safe lazy initialization. + */ + private static final VarHandle INSTANCE; + + static { + try { + INSTANCE = MethodHandles.lookup() + .findStaticVarHandle(LogBatFactory.class, "instance", LogBat.class); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new ExceptionInInitializerError(e); + } + } } \ No newline at end of file