Skip to content

Commit cc2e04c

Browse files
committed
Minor styling feedback
1 parent b4563a1 commit cc2e04c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,8 @@ private static void maybeValidateDataStreamsStillReferenced(
953953
String templateName,
954954
ComposableIndexTemplate newTemplate
955955
) {
956-
final ComposableIndexTemplate existing = project.templatesV2().get(templateName);
957-
final Settings existingSettings = Optional.ofNullable(existing)
956+
final ComposableIndexTemplate existingTemplate = project.templatesV2().get(templateName);
957+
final Settings existingSettings = Optional.ofNullable(existingTemplate)
958958
.map(ComposableIndexTemplate::template)
959959
.map(Template::settings)
960960
.orElse(Settings.EMPTY);
@@ -965,11 +965,11 @@ private static void maybeValidateDataStreamsStillReferenced(
965965
// We check whether anything relevant has changed that could affect data stream coverage and return early if not.
966966
// These checks are based on the implementation of findV2Template and the data stream template check in this method.
967967
// If we're adding a new template, we do the full check in case this template's priority changes coverage.
968-
if (existing != null
969-
&& existing.indexPatterns().equals(newTemplate.indexPatterns())
968+
if (existingTemplate != null
969+
&& Objects.equals(existingTemplate.indexPatterns(), newTemplate.indexPatterns())
970970
&& Objects.equals(existingSettings.get(IndexMetadata.SETTING_INDEX_HIDDEN), newSettings.get(IndexMetadata.SETTING_INDEX_HIDDEN))
971-
&& Objects.equals(existing.getDataStreamTemplate() != null, newTemplate.getDataStreamTemplate() != null)
972-
&& existing.priorityOrZero() == newTemplate.priorityOrZero()) {
971+
&& Objects.equals(existingTemplate.getDataStreamTemplate() != null, newTemplate.getDataStreamTemplate() != null)
972+
&& Objects.equals(existingTemplate.priorityOrZero(), newTemplate.priorityOrZero())) {
973973
if (Assertions.ENABLED) {
974974
try {
975975
validateDataStreamsStillReferenced(project, templateName, newTemplate);

0 commit comments

Comments
 (0)