From 7e346ff62c711e08968c6493741db166ec2f1ddf Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Fri, 26 Jul 2019 23:39:04 -0700 Subject: [PATCH] remove deprecated concurrent hash map and set GitOrigin-RevId: 318e91004a8b1b88c8f749c2e4f1362c9099f700 --- .../util/containers/ConcurrentHashMap.java | 38 ----- .../util/containers/ConcurrentHashSet.java | 153 ------------------ 2 files changed, 191 deletions(-) delete mode 100644 platform/util/src/com/intellij/util/containers/ConcurrentHashMap.java delete mode 100644 platform/util/src/com/intellij/util/containers/ConcurrentHashSet.java diff --git a/platform/util/src/com/intellij/util/containers/ConcurrentHashMap.java b/platform/util/src/com/intellij/util/containers/ConcurrentHashMap.java deleted file mode 100644 index 37f5a45ea1d9..000000000000 --- a/platform/util/src/com/intellij/util/containers/ConcurrentHashMap.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2014 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. - */ - -package com.intellij.util.containers; - -import com.intellij.util.DeprecatedMethodException; -import org.jetbrains.annotations.ApiStatus; - -/** - * @deprecated Use {@link ContainerUtil#newConcurrentMap()} or {@link java.util.concurrent.ConcurrentHashMap} instead. - * TODO to remove in IDEA 2018.1 - */ -@ApiStatus.ScheduledForRemoval(inVersion = "2018.1") -@Deprecated -public final class ConcurrentHashMap extends java.util.concurrent.ConcurrentHashMap { - /** - * @deprecated Use {@link ContainerUtil#newConcurrentMap()} or {@link java.util.concurrent.ConcurrentHashMap} instead. - * TODO to remove in IDEA 2018.1 - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2018.1") - public ConcurrentHashMap() { - DeprecatedMethodException.report("Use java.util.concurrent.ConcurrentHashMap instead"); - } -} \ No newline at end of file diff --git a/platform/util/src/com/intellij/util/containers/ConcurrentHashSet.java b/platform/util/src/com/intellij/util/containers/ConcurrentHashSet.java deleted file mode 100644 index 5e2db1868b4b..000000000000 --- a/platform/util/src/com/intellij/util/containers/ConcurrentHashSet.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2000-2016 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. - */ - -package com.intellij.util.containers; - -import com.intellij.util.DeprecatedMethodException; -import org.jetbrains.annotations.NotNull; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.ConcurrentMap; - -/** - * @deprecated use {@link ContainerUtil#newConcurrentSet()} instead - */ -@Deprecated -public final class ConcurrentHashSet implements Set { - private final ConcurrentMap map; - - /** - * @deprecated use {@link ContainerUtil#newConcurrentSet()} instead - */ - @Deprecated - public ConcurrentHashSet() { - map = ContainerUtil.newConcurrentMap(); - DeprecatedMethodException.report("Use com.intellij.util.containers.ContainerUtil.newConcurrentSet() instead"); - } - - @Override - public int size() { - return map.size(); - } - - @Override - public boolean isEmpty() { - return map.isEmpty(); - } - - @Override - public boolean contains(Object o) { - return map.containsKey(o); - } - - @NotNull - @Override - public Iterator iterator() { - return map.keySet().iterator(); - } - - @NotNull - @Override - public Object[] toArray() { - return map.keySet().toArray(); - } - - @NotNull - @Override - public T[] toArray(@NotNull T[] a) { - return map.keySet().toArray(a); - } - - @Override - public boolean add(@NotNull K o) { - return map.putIfAbsent(o, Boolean.TRUE) == null; - } - - @Override - public boolean remove(@NotNull Object o) { - return map.remove(o) != null; - } - - @Override - public boolean containsAll(@NotNull Collection c) { - return map.keySet().containsAll(c); - } - - @Override - public boolean addAll(@NotNull Collection c) { - boolean ret = false; - for (K o : c) { - ret |= add(o); - } - - return ret; - } - - @Override - public boolean retainAll(@NotNull Collection c) { - return map.keySet().retainAll(c); - } - - @Override - public boolean removeAll(@NotNull Collection c) { - return map.keySet().removeAll(c); - } - - @Override - public void clear() { - map.clear(); - } - - @Override - public String toString() { - return map.keySet().toString(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof ConcurrentHashSet) { - return map.equals(((ConcurrentHashSet)obj).map); - } - - if (!(obj instanceof Set)) { - return false; - } - - Set c = (Set)obj; - if (c.size() != size()) { - return false; - } - - try { - return containsAll(c); - } - catch (ClassCastException | NullPointerException ignored) { - return false; - } - } - - @Override - public int hashCode() { - return map.hashCode(); - } -} -