From 67e3801a6c8ba714096993344081f24fa20368d0 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Sat, 15 Feb 2020 08:56:33 +0100 Subject: [PATCH] PlatformUtils - avoid ContainerUtil (and Trove lib) dependency GitOrigin-RevId: 4f90822b7707e22d906988db7b195ff82e63966b --- .../src/com/intellij/util/PlatformUtils.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/platform/core-api/src/com/intellij/util/PlatformUtils.java b/platform/core-api/src/com/intellij/util/PlatformUtils.java index fbec74399756..7187bedc2929 100644 --- a/platform/core-api/src/com/intellij/util/PlatformUtils.java +++ b/platform/core-api/src/com/intellij/util/PlatformUtils.java @@ -1,9 +1,10 @@ -// Copyright 2000-2019 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-2020 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.util; import com.intellij.openapi.application.ApplicationInfo; -import com.intellij.util.containers.ContainerUtil; +import java.util.Arrays; +import java.util.HashSet; import java.util.Set; /** @@ -34,10 +35,10 @@ public final class PlatformUtils { public static final String RIDER_PREFIX = "Rider"; public static final String GOIDE_PREFIX = "GoLand"; - private static final Set COMMERCIAL_EDITIONS = ContainerUtil.immutableSet(IDEA_PREFIX, APPCODE_PREFIX, CLION_PREFIX, - PYCHARM_PREFIX, RUBY_PREFIX, PHP_PREFIX, - WEB_PREFIX, DBE_PREFIX, RIDER_PREFIX, - GOIDE_PREFIX); + private static final Set COMMERCIAL_EDITIONS = new HashSet<>(Arrays.asList(IDEA_PREFIX, APPCODE_PREFIX, CLION_PREFIX, + PYCHARM_PREFIX, RUBY_PREFIX, PHP_PREFIX, + WEB_PREFIX, DBE_PREFIX, RIDER_PREFIX, + GOIDE_PREFIX)); public static String getPlatformPrefix() { return getPlatformPrefix(IDEA_PREFIX); @@ -46,10 +47,10 @@ public final class PlatformUtils { public static String getPlatformPrefix(String defaultPrefix) { return System.getProperty(PLATFORM_PREFIX_KEY, defaultPrefix); } - + public static void setDefaultPrefixForCE() { - //IJ CE doesn't have prefix if we start IDE from the source code. - //The proper fix is to set the prefix in all CE run configurations but for keeping compatibility set it indirectly + // IJ CE doesn't have prefix if we start IDE from the source code. + // The proper fix is to set the prefix in all CE run configurations but for keeping compatibility set it indirectly System.setProperty(PLATFORM_PREFIX_KEY, getPlatformPrefix(IDEA_CE_PREFIX)); }