From 21c4957bb2e056d8161217205193b8eb638c3320 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Sat, 26 Aug 2023 19:27:32 +0300 Subject: [PATCH] IDEA-328027 don't use deprecated ConcurrentIntObjectHashMap in production GitOrigin-RevId: 7277f58a08614232c43fe8a131548e5a8f97eda2 --- platform/code-style-api/intellij.platform.codeStyle.iml | 1 + .../src/com/intellij/formatting/WrapType.java | 6 +++--- .../openapi/editor/GenericLineWrapPositionStrategy.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/code-style-api/intellij.platform.codeStyle.iml b/platform/code-style-api/intellij.platform.codeStyle.iml index e0ebde2bf2fc..412c86cc1dcd 100644 --- a/platform/code-style-api/intellij.platform.codeStyle.iml +++ b/platform/code-style-api/intellij.platform.codeStyle.iml @@ -14,5 +14,6 @@ + \ No newline at end of file diff --git a/platform/code-style-api/src/com/intellij/formatting/WrapType.java b/platform/code-style-api/src/com/intellij/formatting/WrapType.java index 5b1392f4eb35..599f8845df7d 100644 --- a/platform/code-style-api/src/com/intellij/formatting/WrapType.java +++ b/platform/code-style-api/src/com/intellij/formatting/WrapType.java @@ -1,9 +1,9 @@ -// 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.formatting; +import com.intellij.concurrency.ConcurrentCollectionFactory; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; -import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.IntObjectMap; /** @@ -39,7 +39,7 @@ public enum WrapType { */ CHOP_DOWN_IF_LONG(CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM); - private static final IntObjectMap LEGACY_MAPPINGS = ContainerUtil.createConcurrentIntObjectMap(); + private static final IntObjectMap LEGACY_MAPPINGS = ConcurrentCollectionFactory.createConcurrentIntObjectMap(); static { for (WrapType wrapType : values()) { diff --git a/platform/code-style-api/src/com/intellij/openapi/editor/GenericLineWrapPositionStrategy.java b/platform/code-style-api/src/com/intellij/openapi/editor/GenericLineWrapPositionStrategy.java index c53b903d821b..31573a911233 100644 --- a/platform/code-style-api/src/com/intellij/openapi/editor/GenericLineWrapPositionStrategy.java +++ b/platform/code-style-api/src/com/intellij/openapi/editor/GenericLineWrapPositionStrategy.java @@ -1,9 +1,9 @@ -// 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.editor; +import com.intellij.concurrency.ConcurrentCollectionFactory; import com.intellij.openapi.project.Project; import com.intellij.util.ArrayUtil; -import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.IntObjectMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -24,7 +24,7 @@ public class GenericLineWrapPositionStrategy implements LineWrapPositionStrategy private static final int NON_ID_WEIGHT = (Rule.DEFAULT_WEIGHT - 1) / 2; /** Holds symbols wrap rules by symbol. */ - private final IntObjectMap myRules = ContainerUtil.createConcurrentIntObjectMap(); + private final IntObjectMap myRules = ConcurrentCollectionFactory.createConcurrentIntObjectMap(); private final Storage myOffset2weight = new Storage(); @Override