Skip to content

Commit

Permalink
Move SnakeYAML log suppression to slightly earlier in the code path (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tjquinno authored Apr 24, 2023
1 parent 2dc9912 commit 9809b56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openapi/src/main/java/io/helidon/openapi/ParserHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public class ParserHelper {

private ParserHelper(SnakeYAMLParserHelper<ExpandedTypeDescription> 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);
}
}

/**
Expand All @@ -58,6 +54,10 @@ private ParserHelper(SnakeYAMLParserHelper<ExpandedTypeDescription> 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;
Expand Down

0 comments on commit 9809b56

Please sign in to comment.