diff --git a/RegExpSupport/intellij.regexp.iml b/RegExpSupport/intellij.regexp.iml
index dacbda0a51db..9f0f4cb8b845 100644
--- a/RegExpSupport/intellij.regexp.iml
+++ b/RegExpSupport/intellij.regexp.iml
@@ -18,5 +18,6 @@
+
\ No newline at end of file
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java
index ce57647a7407..cb14e6c934b8 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java
@@ -48,6 +48,7 @@ import org.jetbrains.annotations.TestOnly;
import javax.swing.*;
import java.awt.*;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -55,7 +56,7 @@ import java.util.regex.Pattern;
/**
* @author Konstantin Bulenkov
*/
-public class CheckRegExpForm {
+public final class CheckRegExpForm {
private static final Logger LOG = Logger.getInstance(CheckRegExpForm.class);
public static final Key CHECK_REG_EXP_EDITOR = Key.create("CHECK_REG_EXP_EDITOR");
@@ -70,7 +71,7 @@ public class CheckRegExpForm {
private final JBLabel myRegExpIcon = new JBLabel();
private final JBLabel mySampleIcon = new JBLabel();
- private final SmartList highlighters = new SmartList<>();
+ private final List highlighters = new ArrayList<>();
public CheckRegExpForm(@NotNull PsiFile regexpFile) {
final Project project = regexpFile.getProject();
diff --git a/images/intellij.platform.images.iml b/images/intellij.platform.images.iml
index 626e6e4930c7..375af8a2c1ea 100644
--- a/images/intellij.platform.images.iml
+++ b/images/intellij.platform.images.iml
@@ -14,5 +14,6 @@
+
\ No newline at end of file
diff --git a/java/compiler/impl/intellij.java.compiler.impl.iml b/java/compiler/impl/intellij.java.compiler.impl.iml
index f1779ade1bb2..ce9c926127af 100644
--- a/java/compiler/impl/intellij.java.compiler.impl.iml
+++ b/java/compiler/impl/intellij.java.compiler.impl.iml
@@ -36,6 +36,7 @@
+
diff --git a/java/compiler/impl/src/com/intellij/ide/JavaExcludedFileIconPatcher.java b/java/compiler/impl/src/com/intellij/ide/JavaExcludedFileIconPatcher.java
index bfcbdb1686d1..acecc89e731f 100644
--- a/java/compiler/impl/src/com/intellij/ide/JavaExcludedFileIconPatcher.java
+++ b/java/compiler/impl/src/com/intellij/ide/JavaExcludedFileIconPatcher.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-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.ide;
import com.intellij.openapi.compiler.CompilerManager;
@@ -20,13 +6,14 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.ui.IconManager;
import com.intellij.ui.LayeredIcon;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
-public class JavaExcludedFileIconPatcher implements FileIconPatcher {
+public final class JavaExcludedFileIconPatcher implements FileIconPatcher {
@Override
public Icon patchIcon(Icon baseIcon, VirtualFile file, int flags, @Nullable Project project) {
if (project == null) {
@@ -34,7 +21,7 @@ public class JavaExcludedFileIconPatcher implements FileIconPatcher {
}
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
if (fileIndex.isInSource(file) && CompilerManager.getInstance(project).isExcludedFromCompilation(file)) {
- return new LayeredIcon(baseIcon, PlatformIcons.EXCLUDED_FROM_COMPILE_ICON);
+ return IconManager.getInstance().createLayered(new LayeredIcon(baseIcon, PlatformIcons.EXCLUDED_FROM_COMPILE_ICON));
}
return baseIcon;
}
diff --git a/java/compiler/intellij.java.compiler.tests.iml b/java/compiler/intellij.java.compiler.tests.iml
index 4ae75d924be1..c8560ffeb8b7 100644
--- a/java/compiler/intellij.java.compiler.tests.iml
+++ b/java/compiler/intellij.java.compiler.tests.iml
@@ -21,7 +21,7 @@
-
+
diff --git a/java/compiler/openapi/intellij.java.compiler.iml b/java/compiler/openapi/intellij.java.compiler.iml
index aba5057a11ce..1606d36aee4e 100644
--- a/java/compiler/openapi/intellij.java.compiler.iml
+++ b/java/compiler/openapi/intellij.java.compiler.iml
@@ -14,6 +14,7 @@
+
diff --git a/java/debugger/impl/intellij.java.debugger.impl.iml b/java/debugger/impl/intellij.java.debugger.impl.iml
index f2b2c755d8b9..c2dd0f3acdf2 100644
--- a/java/debugger/impl/intellij.java.debugger.impl.iml
+++ b/java/debugger/impl/intellij.java.debugger.impl.iml
@@ -39,6 +39,7 @@
+
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ArrayFilterInplaceEditor.kt b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ArrayFilterInplaceEditor.kt
index a84bd056df61..da9624476c3b 100644
--- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ArrayFilterInplaceEditor.kt
+++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ArrayFilterInplaceEditor.kt
@@ -1,8 +1,8 @@
// 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.debugger.ui.tree.render
-import com.intellij.debugger.JavaDebuggerBundle
import com.intellij.debugger.DebuggerManagerEx
+import com.intellij.debugger.JavaDebuggerBundle
import com.intellij.debugger.actions.ArrayAction
import com.intellij.debugger.actions.ArrayFilterAction
import com.intellij.debugger.engine.JavaValue
@@ -33,7 +33,7 @@ import java.awt.Rectangle
import javax.swing.event.TreeModelEvent
import javax.swing.tree.TreeNode
-class ArrayFilterInplaceEditor(node: XDebuggerTreeNode, val myTemp: Boolean, thisType: PsiType?) : XDebuggerTreeInplaceEditor(node,
+final class ArrayFilterInplaceEditor(node: XDebuggerTreeNode, val myTemp: Boolean, thisType: PsiType?) : XDebuggerTreeInplaceEditor(node,
"arrayFilter") {
init {
if (thisType != null) {
diff --git a/java/debugger/openapi/intellij.java.debugger.iml b/java/debugger/openapi/intellij.java.debugger.iml
index a2f322a18d83..91821a5f9f93 100644
--- a/java/debugger/openapi/intellij.java.debugger.iml
+++ b/java/debugger/openapi/intellij.java.debugger.iml
@@ -16,6 +16,7 @@
+
diff --git a/java/execution/impl/intellij.java.execution.impl.iml b/java/execution/impl/intellij.java.execution.impl.iml
index f8a7f81018a0..1203ab0ab1ac 100644
--- a/java/execution/impl/intellij.java.execution.impl.iml
+++ b/java/execution/impl/intellij.java.execution.impl.iml
@@ -33,6 +33,7 @@
+
diff --git a/java/execution/openapi/intellij.java.execution.iml b/java/execution/openapi/intellij.java.execution.iml
index 4f5b8dd9b659..9b8e929db710 100644
--- a/java/execution/openapi/intellij.java.execution.iml
+++ b/java/execution/openapi/intellij.java.execution.iml
@@ -11,6 +11,9 @@
+
+
+
diff --git a/java/idea-ui/intellij.java.ui.iml b/java/idea-ui/intellij.java.ui.iml
index 9b1a08bfea8e..177e89734ced 100644
--- a/java/idea-ui/intellij.java.ui.iml
+++ b/java/idea-ui/intellij.java.ui.iml
@@ -28,5 +28,6 @@
+
\ No newline at end of file
diff --git a/java/idea-ui/intellij.java.ui.tests.iml b/java/idea-ui/intellij.java.ui.tests.iml
index 361806f301a3..d28fad6ddf6f 100644
--- a/java/idea-ui/intellij.java.ui.tests.iml
+++ b/java/idea-ui/intellij.java.ui.tests.iml
@@ -13,5 +13,6 @@
+
\ No newline at end of file
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
index a709d6e4e9d3..5b8454d78d16 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
@@ -33,8 +33,8 @@ import com.intellij.util.ArrayUtilRt;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ContainerUtil;
import com.siyeh.ig.psiutils.VariableAccessUtils;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
+import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -391,9 +391,9 @@ public final class GenericsHighlightUtil {
final Collection signaturesWithSupers = aClass.getVisibleSignatures();
PsiManager manager = aClass.getManager();
Map sameErasureMethods =
- new THashMap<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
+ new Object2ObjectOpenCustomHashMap<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
- final Set foundProblems = new THashSet<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
+ final Set foundProblems = new ObjectOpenCustomHashSet<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
for (HierarchicalMethodSignature signature : signaturesWithSupers) {
HighlightInfo info = checkSameErasureNotSubSignatureInner(signature, manager, aClass, sameErasureMethods);
if (info != null && foundProblems.add(signature)) {
@@ -547,7 +547,7 @@ public final class GenericsHighlightUtil {
final PsiClass superClass = psiClass.getSuperClass();
if (superClass != null && superClass.hasTypeParameters()) {
final Collection visibleSignatures = superClass.getVisibleSignatures();
- final Map overrideEquivalent = new THashMap<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
+ final Map overrideEquivalent = new Object2ObjectOpenCustomHashMap<>(MethodSignatureUtil.METHOD_PARAMETERS_ERASURE_EQUALITY);
for (HierarchicalMethodSignature hms : visibleSignatures) {
final PsiMethod method = hms.getMethod();
if (method.isConstructor()) continue;
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java
index 636d5fcd5048..0e9a4cea4504 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java
@@ -6,7 +6,8 @@ import com.intellij.analysis.AnalysisBundle;
import com.intellij.java.analysis.JavaAnalysisBundle;
import com.intellij.openapi.util.Iconable;
import com.intellij.psi.*;
-import com.intellij.util.IconUtil;
+import com.intellij.ui.CoreAwareIconManager;
+import com.intellij.ui.IconManager;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.Stack;
import gnu.trove.THashSet;
@@ -268,8 +269,11 @@ public abstract class RefJavaElementImpl extends RefElementImpl implements RefJa
if (isSyntheticJSP()) {
final PsiElement element = getPsiElement();
if (element != null && element.isValid()) {
- return IconUtil.getIcon(element.getContainingFile().getVirtualFile(),
- Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS, element.getProject());
+ IconManager iconManager = IconManager.getInstance();
+ if (iconManager instanceof CoreAwareIconManager) {
+ return ((CoreAwareIconManager)iconManager).getIcon(element.getContainingFile().getVirtualFile(),
+ Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS, element.getProject());
+ }
}
}
return super.getIcon(expanded);
diff --git a/java/java-impl/intellij.java.impl.iml b/java/java-impl/intellij.java.impl.iml
index 56111f6643c5..1ba4e7d7ae2f 100644
--- a/java/java-impl/intellij.java.impl.iml
+++ b/java/java-impl/intellij.java.impl.iml
@@ -74,6 +74,7 @@
+
diff --git a/java/java-impl/src/com/intellij/lang/java/actions/FieldExpression.kt b/java/java-impl/src/com/intellij/lang/java/actions/FieldExpression.kt
index ccc36fd329c2..2d6662fc8513 100644
--- a/java/java-impl/src/com/intellij/lang/java/actions/FieldExpression.kt
+++ b/java/java-impl/src/com/intellij/lang/java/actions/FieldExpression.kt
@@ -1,4 +1,4 @@
-// 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.
+// 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.lang.java.actions
import com.intellij.codeInsight.completion.JavaLookupElementBuilder
@@ -15,7 +15,8 @@ import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClass
import com.intellij.psi.util.createSmartPointer
import com.intellij.ui.LayeredIcon
-import javax.swing.Icon
+
+private val newFieldIcon by lazy { LayeredIcon.create(AllIcons.Nodes.Field, AllIcons.Actions.New) }
internal class FieldExpression(
project: Project,
@@ -23,11 +24,6 @@ internal class FieldExpression(
private val fieldName: String,
private val typeText: () -> String
) : Expression() {
-
- companion object {
- private val newFieldIcon: Icon = LayeredIcon.create(AllIcons.Nodes.Field, AllIcons.Actions.New)
- }
-
private val myClassPointer = target.createSmartPointer(project)
private val myFactory = JavaPsiFacade.getElementFactory(project)
diff --git a/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java b/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
index d7e84e1e9353..a7a83259bb36 100644
--- a/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
+++ b/java/java-impl/src/com/intellij/psi/impl/JavaDirectoryIconProvider.java
@@ -1,4 +1,4 @@
-// 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.psi.impl;
import com.intellij.icons.AllIcons;
@@ -19,7 +19,6 @@ import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.file.PsiDirectoryFactory;
import com.intellij.ui.IconManager;
-import com.intellij.ui.IconWithToolTip;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -54,7 +53,7 @@ final class JavaDirectoryIconProvider extends IconProvider implements DumbAware
symbolIcon = AllIcons.Nodes.Module;
}
else if (isValidPackage(psiDirectory)) {
- symbolIcon = IconWithToolTip.tooltipOnlyIfComposite(PlatformIcons.PACKAGE_ICON);
+ symbolIcon = IconManager.getInstance().tooltipOnlyIfComposite(PlatformIcons.PACKAGE_ICON);
}
else if (!Registry.is("ide.hide.excluded.files") && ProjectRootManager.getInstance(project).getFileIndex().isExcluded(vFile)) {
symbolIcon = AllIcons.Modules.ExcludeRoot;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java
index cb0d7278da9a..862a3a1f3ca9 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java
@@ -1,4 +1,4 @@
-// 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.refactoring.introduceParameter;
import com.intellij.openapi.application.ApplicationManager;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java
index 92fdabf8de91..2bbbb4f9a318 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterUI.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-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.refactoring.introduceParameter;
import com.intellij.java.refactoring.JavaRefactoringBundle;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterData.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterData.java
index f9844800dffb..d235df5c9314 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterData.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterData.java
@@ -1,18 +1,4 @@
-/*
- * Copyright 2000-2012 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-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.refactoring.introduceParameter;
import com.intellij.openapi.project.Project;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java
index 8f90364918d3..342b6a998659 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterDialog.java
@@ -1,4 +1,4 @@
-// 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.
+// 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.refactoring.introduceParameter;
import com.intellij.codeInspection.AnonymousCanBeLambdaInspection;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
index 8a40b975cf03..76254c7258a8 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterProcessor.java
@@ -1,18 +1,4 @@
-/*
- * 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.
- */
+// 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.refactoring.introduceParameter;
import com.intellij.analysis.AnalysisScope;
@@ -27,7 +13,6 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.Ref;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.searches.MethodReferencesSearch;
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java
index e6c1b869a136..1bc105a76db1 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java
@@ -1,4 +1,4 @@
-// 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.refactoring.introduceParameter;
import com.intellij.java.refactoring.JavaRefactoringBundle;
diff --git a/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzerBase.java b/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzerBase.java
index 01d93102dc0a..42f3afee545f 100644
--- a/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzerBase.java
+++ b/java/java-impl/src/com/intellij/slicer/SliceNullnessAnalyzerBase.java
@@ -17,7 +17,7 @@ import com.intellij.util.WalkingState;
import com.intellij.util.containers.CollectionFactory;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.FactoryMap;
-import gnu.trove.THashSet;
+import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet;
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
import org.jetbrains.annotations.NotNull;
@@ -71,7 +71,7 @@ public abstract class SliceNullnessAnalyzerBase {
}
SliceLeafValueClassNode valueRoot = new SliceLeafValueClassNode(root.getProject(), root, nodeName);
- Set uniqueValues = new THashSet<>(groupedByValue, myLeafEquality);
+ Set uniqueValues = new ObjectOpenCustomHashSet<>(groupedByValue, myLeafEquality);
for (final PsiElement expression : uniqueValues) {
SliceNode newRoot = SliceLeafAnalyzer.filterTree(oldRootStart, oldNode -> {
if (oldNode.getDuplicate() != null) {
diff --git a/java/java-indexing-api/intellij.java.indexing.iml b/java/java-indexing-api/intellij.java.indexing.iml
index d4475c23fde0..cc12a0e57da5 100644
--- a/java/java-indexing-api/intellij.java.indexing.iml
+++ b/java/java-indexing-api/intellij.java.indexing.iml
@@ -13,5 +13,6 @@
+
\ No newline at end of file
diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java
index cd1dad1fea87..ab906cc1f108 100644
--- a/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java
+++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java
@@ -13,7 +13,6 @@ import com.intellij.psi.SmartPointerManager;
import com.intellij.psi.search.SearchScope;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.*;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
@@ -144,8 +143,9 @@ public final class ClassInheritorsSearch extends ExtensibleQueryFactory ReadAction.compute(() -> SmartPointerManager.getInstance(psiClass.getProject()).createSmartPsiElementPointer(psiClass)));
+ return INSTANCE.createUniqueResultsQuery(parameters, psiClass -> {
+ return ReadAction.compute(() -> SmartPointerManager.getInstance(psiClass.getProject()).createSmartPsiElementPointer(psiClass));
+ });
}
/**
diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/FunctionalExpressionSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/FunctionalExpressionSearch.java
index 4f1bd4934793..545345f8e56a 100644
--- a/java/java-indexing-api/src/com/intellij/psi/search/searches/FunctionalExpressionSearch.java
+++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/FunctionalExpressionSearch.java
@@ -1,18 +1,4 @@
-/*
- * 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.
- */
+// 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.psi.search.searches;
import com.intellij.openapi.application.ReadAction;
@@ -22,10 +8,9 @@ import com.intellij.psi.search.SearchScope;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.EmptyQuery;
import com.intellij.util.Query;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
-public class FunctionalExpressionSearch extends ExtensibleQueryFactory {
+public final class FunctionalExpressionSearch extends ExtensibleQueryFactory {
private static final FunctionalExpressionSearch INSTANCE = new FunctionalExpressionSearch();
public static class SearchParameters {
@@ -48,7 +33,7 @@ public class FunctionalExpressionSearch extends ExtensibleQueryFactory search(@NotNull final PsiClass aClass, @NotNull SearchScope scope) {
- return INSTANCE.createUniqueResultsQuery(new SearchParameters(aClass, scope), ContainerUtil.canonicalStrategy(), SmartPointerManager::createPointer);
+ return INSTANCE.createUniqueResultsQuery(new SearchParameters(aClass, scope), SmartPointerManager::createPointer);
}
public static Query search(@NotNull final PsiMethod psiMethod) {
diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/ImplicitToStringSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/ImplicitToStringSearch.java
index 78cd39a1061a..ba490b51ee4b 100644
--- a/java/java-indexing-api/src/com/intellij/psi/search/searches/ImplicitToStringSearch.java
+++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/ImplicitToStringSearch.java
@@ -1,13 +1,12 @@
-// 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.
+// 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.psi.search.searches;
import com.intellij.psi.*;
import com.intellij.psi.search.SearchScope;
import com.intellij.util.Query;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
-public class ImplicitToStringSearch extends ExtensibleQueryFactory {
+public final class ImplicitToStringSearch extends ExtensibleQueryFactory {
public static final ImplicitToStringSearch INSTANCE = new ImplicitToStringSearch();
public static class SearchParameters {
@@ -32,9 +31,7 @@ public class ImplicitToStringSearch extends ExtensibleQueryFactory search(@NotNull PsiMethod targetMethod, @NotNull SearchScope scope) {
- return INSTANCE.createUniqueResultsQuery(new SearchParameters(targetMethod, scope),
- ContainerUtil.canonicalStrategy(),
- SmartPointerManager::createPointer);
+ return INSTANCE.createUniqueResultsQuery(new SearchParameters(targetMethod, scope), SmartPointerManager::createPointer);
}
public static boolean isToStringMethod(@NotNull PsiElement element) {
diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java
index c9d65e4aaa56..0bea78b1f1a1 100644
--- a/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java
+++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java
@@ -9,12 +9,11 @@ import com.intellij.psi.PsiReference;
import com.intellij.psi.search.*;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.*;
-import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class MethodReferencesSearch extends ExtensibleQueryFactory {
- public static final ExtensionPointName> EP_NAME = ExtensionPointName.create("com.intellij.methodReferencesSearch");
+ public static final ExtensionPointName> EP_NAME = new ExtensionPointName<>("com.intellij.methodReferencesSearch");
public static final MethodReferencesSearch INSTANCE = new MethodReferencesSearch();
public static class SearchParameters implements DumbAwareSearchParameters {
@@ -135,6 +134,6 @@ public final class MethodReferencesSearch extends ExtensibleQueryFactory uniqueResults(@NotNull Query extends PsiReference> composite) {
- return new UniqueResultsQuery<>(composite, ContainerUtil.canonicalStrategy(), ReferenceDescriptor.MAPPER);
+ return new UniqueResultsQuery<>(composite, ReferenceDescriptor.MAPPER);
}
}
\ No newline at end of file
diff --git a/java/java-psi-api/intellij.java.psi.iml b/java/java-psi-api/intellij.java.psi.iml
index b7bb61bb0c6e..2490aa83e5a0 100644
--- a/java/java-psi-api/intellij.java.psi.iml
+++ b/java/java-psi-api/intellij.java.psi.iml
@@ -9,9 +9,6 @@
-
-
-
\ No newline at end of file
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
index afe836c5cac7..c60706f2c68f 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/AnnotationUtil.java
@@ -9,8 +9,6 @@ import com.intellij.psi.util.*;
import com.intellij.util.*;
import com.intellij.util.containers.ConcurrentFactoryMap;
import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.*;
@@ -358,8 +356,12 @@ public class AnnotationUtil {
if (BitUtil.isSet(flags, CHECK_HIERARCHY)) {
if (listOwner instanceof PsiMethod) {
PsiMethod method = (PsiMethod)listOwner;
- if (processed == null) processed = new THashSet<>();
- if (!processed.add(method)) return false;
+ if (processed == null) {
+ processed = new HashSet<>();
+ }
+ if (!processed.add(method)) {
+ return false;
+ }
for (PsiMethod superMethod : method.findSuperMethods()) {
if (isAnnotated(superMethod, annotationFQN, flags, processed)) {
return true;
@@ -368,8 +370,12 @@ public class AnnotationUtil {
}
else if (listOwner instanceof PsiClass) {
PsiClass clazz = (PsiClass)listOwner;
- if (processed == null) processed = new THashSet<>();
- if (!processed.add(clazz)) return false;
+ if (processed == null) {
+ processed = new HashSet<>();
+ }
+ if (!processed.add(clazz)) {
+ return false;
+ }
for (PsiClass superClass : clazz.getSupers()) {
if (isAnnotated(superClass, annotationFQN, flags, processed)) {
return true;
@@ -477,7 +483,9 @@ public class AnnotationUtil {
if (inHierarchy) {
if (owner instanceof PsiClass) {
for (PsiClass superClass : ((PsiClass)owner).getSupers()) {
- if (visited == null) visited = new THashSet<>();
+ if (visited == null) {
+ visited = new HashSet<>();
+ }
if (visited.add(superClass)) annotations = ArrayUtil.mergeArrays(annotations, getAllAnnotations(superClass, true, visited, withInferred));
}
}
@@ -491,9 +499,12 @@ public class AnnotationUtil {
PsiResolveHelper resolveHelper = PsiResolveHelper.SERVICE.getInstance(aClass.getProject());
for (final HierarchicalMethodSignature superSignature : superSignatures) {
final PsiMethod superMethod = superSignature.getMethod();
- if (visited == null) visited = new THashSet<>();
- if (!visited.add(superMethod)) continue;
- if (!resolveHelper.isAccessible(superMethod, owner, null)) continue;
+ if (visited == null) {
+ visited = new HashSet<>();
+ }
+ if (!visited.add(superMethod) || !resolveHelper.isAccessible(superMethod, owner, null)) {
+ continue;
+ }
annotations = ArrayUtil.mergeArrays(annotations, getAllAnnotations(superMethod, true, visited, withInferred));
}
}
@@ -513,9 +524,12 @@ public class AnnotationUtil {
PsiResolveHelper resolveHelper = PsiResolveHelper.SERVICE.getInstance(aClass.getProject());
for (final HierarchicalMethodSignature superSignature : superSignatures) {
final PsiMethod superMethod = superSignature.getMethod();
- if (visited == null) visited = new THashSet<>();
- if (!visited.add(superMethod)) continue;
- if (!resolveHelper.isAccessible(superMethod, owner, null)) continue;
+ if (visited == null) {
+ visited = new HashSet<>();
+ }
+ if (!visited.add(superMethod) || !resolveHelper.isAccessible(superMethod, owner, null)) {
+ continue;
+ }
PsiParameter[] superParameters = superMethod.getParameterList().getParameters();
if (index < superParameters.length) {
annotations = ArrayUtil.mergeArrays(annotations, getAllAnnotations(superParameters[index], true, visited, withInferred));
@@ -617,8 +631,8 @@ public class AnnotationUtil {
if (name == null || !name.equals(b.getQualifiedName())) {
return false;
}
- final Map valueMap1 = new THashMap<>(2);
- final Map valueMap2 = new THashMap<>(2);
+ final Map valueMap1 = new HashMap<>(2);
+ final Map valueMap2 = new HashMap<>(2);
if (!fillValueMap(a.getParameterList(), valueMap1) || !fillValueMap(b.getParameterList(), valueMap2) ||
valueMap1.size() != valueMap2.size()) {
return false;
diff --git a/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java b/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java
index 90a975e8c413..292429c923df 100644
--- a/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java
+++ b/java/java-psi-api/src/com/intellij/codeInsight/ClassUtil.java
@@ -1,14 +1,13 @@
// 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.codeInsight;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiUtil;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -35,7 +34,7 @@ public final class ClassUtil {
if (superClass != null && !superClass.hasModifierProperty(PsiModifier.ABSTRACT) && !superClass.isEnum() && aClass.getImplementsListTypes().length == 0) {
return null;
}
- Set alreadyImplemented = new THashSet<>();
+ Set alreadyImplemented = new HashSet<>();
for (HierarchicalMethodSignature signatureHierarchical : aClass.getVisibleSignatures()) {
for (PsiMethod superS : signatureHierarchical.getMethod().findSuperMethods()) {
add(superS, alreadyImplemented);
diff --git a/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java b/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java
index e66fbd60be9c..cb2591e33f01 100644
--- a/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java
+++ b/java/java-psi-api/src/com/intellij/ide/util/JavaAnonymousClassesHelper.java
@@ -4,10 +4,10 @@ package com.intellij.ide.util;
import com.intellij.openapi.util.Key;
import com.intellij.psi.*;
import com.intellij.psi.util.*;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.HashMap;
import java.util.Map;
/**
@@ -15,7 +15,7 @@ import java.util.Map;
*/
public final class JavaAnonymousClassesHelper {
private static final Key, PsiClass>> ANONYMOUS_CLASS_NAME = Key.create("ANONYMOUS_CLASS_NAME");
- public static final AnonClassProvider ANON_CLASS_PROVIDER = new AnonClassProvider();
+ private static final AnonClassProvider ANON_CLASS_PROVIDER = new AnonClassProvider();
@Nullable
public static String getName(@NotNull PsiAnonymousClass cls) {
@@ -31,10 +31,10 @@ public final class JavaAnonymousClassesHelper {
return value.getValue(upper).get(cls);
}
- private static class AnonClassProvider implements ParameterizedCachedValueProvider