Skip to content

Commit

Permalink
Apply spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Mohit Godwani <[email protected]>
  • Loading branch information
mgodwan committed Jul 16, 2024
1 parent 9713c4c commit bbb1667
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
Expand All @@ -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);
}

Expand Down

0 comments on commit bbb1667

Please sign in to comment.