From 737bd209002101fe6695d9ed2ca9727a62fd4847 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 27 Jul 2018 12:34:21 +0200 Subject: [PATCH] cleanup --- .../configuration-store-impl/src/StateMap.kt | 7 ++++++- .../impl/stores/FileStorageCoreUtil.java | 17 +---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/platform/configuration-store-impl/src/StateMap.kt b/platform/configuration-store-impl/src/StateMap.kt index 43238d601923..3c9721a04ab1 100644 --- a/platform/configuration-store-impl/src/StateMap.kt +++ b/platform/configuration-store-impl/src/StateMap.kt @@ -144,7 +144,12 @@ class StateMap private constructor(private val names: Array, private val return null } - val prev = states.getAndUpdate(index, { state -> if (archive && state is Element) archiveState(state).toByteArray() else state }) + val prev = states.getAndUpdate(index) { state -> + when { + archive && state is Element -> archiveState(state).toByteArray() + else -> state + } + } return prev as? Element } diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/FileStorageCoreUtil.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/FileStorageCoreUtil.java index 4389767a2128..49b37c5233c3 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/FileStorageCoreUtil.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/FileStorageCoreUtil.java @@ -1,18 +1,4 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.components.impl.stores; import com.intellij.application.options.PathMacrosCollector; @@ -67,7 +53,6 @@ public class FileStorageCoreUtil { // so, PathMacroFilter can easily find component name (null parent) iterator.remove(); - if (pathMacroSubstitutor instanceof TrackingPathMacroSubstitutor) { if (filter == null) { filter = new CompositePathMacroFilter(PathMacrosCollector.MACRO_FILTER_EXTENSION_POINT_NAME.getExtensions());