From 830357cf12fee1d7c7c8d1b24a3aef8562f2d03d Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Thu, 20 Apr 2023 10:32:43 -0500 Subject: [PATCH] Move SnakeYAML log suppression to slightly earlier in the code path Signed-off-by: tim.quinn@oracle.com --- .../src/main/java/io/helidon/openapi/ParserHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi/src/main/java/io/helidon/openapi/ParserHelper.java b/openapi/src/main/java/io/helidon/openapi/ParserHelper.java index a832eb38843..babc8f6edb7 100644 --- a/openapi/src/main/java/io/helidon/openapi/ParserHelper.java +++ b/openapi/src/main/java/io/helidon/openapi/ParserHelper.java @@ -46,10 +46,6 @@ public class ParserHelper { private ParserHelper(SnakeYAMLParserHelper generatedHelper) { this.generatedHelper = generatedHelper; - boolean warningsEnabled = Boolean.getBoolean("openapi.parsing.warnings.enabled"); - if (SNAKE_YAML_INTROSPECTOR_LOGGER.isLoggable(java.util.logging.Level.WARNING) && !warningsEnabled) { - SNAKE_YAML_INTROSPECTOR_LOGGER.setLevel(java.util.logging.Level.SEVERE); - } } /** @@ -58,6 +54,10 @@ private ParserHelper(SnakeYAMLParserHelper generatedHel * @return a new parser helper */ public static ParserHelper create() { + boolean warningsEnabled = Boolean.getBoolean("openapi.parsing.warnings.enabled"); + if (SNAKE_YAML_INTROSPECTOR_LOGGER.isLoggable(java.util.logging.Level.WARNING) && !warningsEnabled) { + SNAKE_YAML_INTROSPECTOR_LOGGER.setLevel(java.util.logging.Level.SEVERE); + } ParserHelper helper = new ParserHelper(SnakeYAMLParserHelper.create(ExpandedTypeDescription::create)); adjustTypeDescriptions(helper.types()); return helper;