From bbb166768cd7f3c16b5d710e1048918d2095ce36 Mon Sep 17 00:00:00 2001 From: Mohit Godwani Date: Tue, 16 Jul 2024 19:26:00 +0530 Subject: [PATCH] Apply spotless Signed-off-by: Mohit Godwani --- .../ClusterStateSystemTemplateLoader.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/applicationtemplates/ClusterStateSystemTemplateLoader.java b/server/src/main/java/org/opensearch/cluster/applicationtemplates/ClusterStateSystemTemplateLoader.java index e274d925ecc9e..332960ef49064 100644 --- a/server/src/main/java/org/opensearch/cluster/applicationtemplates/ClusterStateSystemTemplateLoader.java +++ b/server/src/main/java/org/opensearch/cluster/applicationtemplates/ClusterStateSystemTemplateLoader.java @@ -55,7 +55,9 @@ public boolean loadTemplate(SystemTemplate template) throws IOException { .get(template.templateMetadata().fullyQualifiedName()); if (existingTemplate != null - && !SystemTemplateMetadata.COMPONENT_TEMPLATE_TYPE.equals(Objects.toString(existingTemplate.metadata().get(TEMPLATE_TYPE_KEY)))) { + && !SystemTemplateMetadata.COMPONENT_TEMPLATE_TYPE.equals( + Objects.toString(existingTemplate.metadata().get(TEMPLATE_TYPE_KEY)) + )) { throw new OpenSearchCorruptionException( "Attempting to create " + template.templateMetadata().name() + " which has already been created through some other source." ); @@ -72,11 +74,13 @@ public boolean loadTemplate(SystemTemplate template) throws IOException { } ComponentTemplate newTemplate = null; - try(XContentParser contentParser = JsonXContent.jsonXContent.createParser( - NamedXContentRegistry.EMPTY, - DeprecationHandler.IGNORE_DEPRECATIONS, - template.templateContent().utf8ToString() - )) { + try ( + XContentParser contentParser = JsonXContent.jsonXContent.createParser( + NamedXContentRegistry.EMPTY, + DeprecationHandler.IGNORE_DEPRECATIONS, + template.templateContent().utf8ToString() + ) + ) { newTemplate = ComponentTemplate.parse(contentParser); }