From a67f9d0f8d5b455aad959eee70d2416c59434b14 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 22 Feb 2023 20:44:09 +0100 Subject: [PATCH] Refactor performance of isVerbose Relates to https://github.com/quarkusio/quarkus/issues/31355 --- core/src/main/java/io/dekorate/utils/Development.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/io/dekorate/utils/Development.java b/core/src/main/java/io/dekorate/utils/Development.java index 2a0cbf761..0e8be7875 100644 --- a/core/src/main/java/io/dekorate/utils/Development.java +++ b/core/src/main/java/io/dekorate/utils/Development.java @@ -23,12 +23,15 @@ */ public final class Development { + private static final boolean IS_VERBOSE = Session.getSession() + .getConfigurationRegistry().get(GeneratorConfig.class).map(GeneratorConfig::isVerbose) + .orElse(false); + private Development() { //Utility class } public static boolean isVerbose() { - return Session.getSession().getConfigurationRegistry().get(GeneratorConfig.class).map(GeneratorConfig::isVerbose) - .orElse(false); + return IS_VERBOSE; } }