From da3abbd083f1fd9e62a3e6592cf00c1251cc1e01 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 19 Jan 2018 17:43:34 +0100 Subject: [PATCH] always call tearDown, small optimization --- .../compiler/ExternalCompilerConfigurationStorage.kt | 8 +++++--- .../openapi/module/ModulesConfigurationTest.java | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/ExternalCompilerConfigurationStorage.kt b/java/compiler/impl/src/com/intellij/compiler/ExternalCompilerConfigurationStorage.kt index d18a25640d26..351f34135abc 100644 --- a/java/compiler/impl/src/com/intellij/compiler/ExternalCompilerConfigurationStorage.kt +++ b/java/compiler/impl/src/com/intellij/compiler/ExternalCompilerConfigurationStorage.kt @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 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. - */ +// 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.compiler import com.intellij.openapi.components.PersistentStateComponent @@ -55,6 +53,10 @@ internal class ExternalCompilerConfigurationStorage(private val project: Project } internal fun getFilteredModuleNameList(project: Project, map: Map, isExternal: Boolean): List { + if (map.isEmpty()) { + return emptyList() + } + if (!project.isExternalStorageEnabled) { return map.keys.toList() } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java index 99bebbb27c40..1f9da98b7d3a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 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. - */ +// 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.module; import com.intellij.openapi.application.WriteAction; @@ -94,7 +92,11 @@ public class ModulesConfigurationTest extends PlatformTestCase { @Override protected void tearDown() throws Exception { - ApplicationManagerEx.getApplicationEx().doNotSave(myDoNotSaveValue); - super.tearDown(); + try { + ApplicationManagerEx.getApplicationEx().doNotSave(myDoNotSaveValue); + } + finally { + super.tearDown(); + } } }