From cd639e95e033e46ebcd26249e1ee5993b75a1210 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Sun, 9 Jul 2017 07:08:24 +0200 Subject: [PATCH] cleanup (reduce nested level) --- .../ex/ConfigurableExtensionPointUtil.java | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableExtensionPointUtil.java b/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableExtensionPointUtil.java index 1f134524a41d..0c3737630752 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableExtensionPointUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableExtensionPointUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -264,32 +264,32 @@ public class ConfigurableExtensionPointUtil { public static Map> groupConfigurables(@NotNull List configurables) { Map> tree = ContainerUtil.newHashMap(); for (Configurable configurable : configurables) { - if (configurable instanceof ConfigurableWrapper) { - ConfigurableWrapper wrapper = (ConfigurableWrapper)configurable; - String id = wrapper.getId(); - Node node = Node.get(tree, id); - if (node.myValue != null) { - LOG.warn("ignore configurable with duplicated id: " + id); - } - else { - String parentId = wrapper.getParentId(); - String groupId = wrapper.getExtensionPoint().groupId; - if (groupId != null) { - if (parentId != null) { - LOG.warn("ignore deprecated groupId: " + groupId + " for id: " + id); - } - else { - //TODO:LOG.warn("use deprecated groupId: " + groupId + " for id: " + id); - parentId = groupId; - } - } - parentId = Node.cyclic(tree, parentId, "other", id, node); - node.myParent = Node.add(tree, parentId, node); - node.myValue = wrapper; - } + if (!(configurable instanceof ConfigurableWrapper)) { + Node.add(tree, "other", configurable); + continue; + } + + ConfigurableWrapper wrapper = (ConfigurableWrapper)configurable; + String id = wrapper.getId(); + Node node = Node.get(tree, id); + if (node.myValue != null) { + LOG.warn("ignore configurable with duplicated id: " + id); } else { - Node.add(tree, "other", configurable); + String parentId = wrapper.getParentId(); + String groupId = wrapper.getExtensionPoint().groupId; + if (groupId != null) { + if (parentId != null) { + LOG.warn("ignore deprecated groupId: " + groupId + " for id: " + id); + } + else { + //TODO:LOG.warn("use deprecated groupId: " + groupId + " for id: " + id); + parentId = groupId; + } + } + parentId = Node.cyclic(tree, parentId, "other", id, node); + node.myParent = Node.add(tree, parentId, node); + node.myValue = wrapper; } } Map> map = ContainerUtil.newHashMap();