Skip to content

Commit

Permalink
Fix obfuscation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Jun 21, 2021
1 parent 2fe1dea commit 5a5c23e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@
*/
@Static class Exceptions {

static final Logger LOGGER;
static {
static final Logger LOGGER = logger();
static Logger logger() {
try {
var type = MethodHandles.privateLookupIn(Commands.class, MethodHandles.lookup());
LOGGER = (Logger) type.findStaticVarHandle(Commands.class, "LOGGER", Logger.class).get();

try {
return (Logger) type.findStaticVarHandle(Commands.class, "f", Logger.class).get();
} catch (ReflectiveOperationException e) {
return (Logger) type.findStaticVarHandle(Commands.class, "LOGGER", Logger.class).get();
}
} catch (ReflectiveOperationException e) {
throw new ExceptionInInitializerError(e);
}
Expand Down

0 comments on commit 5a5c23e

Please sign in to comment.