Merge remote-tracking branch 'origin/master'

GitOrigin-RevId: 211e84dab4063848c1d3d835a526271ee1466636
This commit is contained in:
Dmitry Avdeev
2019-05-07 15:24:37 +03:00
committed by intellij-monorepo-bot
parent f9664fc455
commit 83f21c7197
1909 changed files with 15906 additions and 21882 deletions

View File

@@ -18,7 +18,6 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -278,6 +277,6 @@ public class CompositeShortNamesCache extends PsiShortNamesCache {
@SuppressWarnings({"HardCodedStringLiteral"})
@Override
public String toString() {
return "Composite cache: " + Arrays.asList(myCaches);
return "Composite cache: " + Collections.singletonList(myCaches);
}
}

View File

@@ -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-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.
package com.intellij.psi.impl
import com.intellij.ide.highlighter.JavaFileType
@@ -22,7 +22,6 @@ import com.intellij.psi.stub.JavaStubImplUtil
import com.intellij.psi.tree.TokenSet
import com.intellij.psi.util.PropertyUtil
import com.intellij.psi.util.PropertyUtilBase
import com.intellij.util.containers.ContainerUtil
import com.intellij.util.indexing.*
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorIntegerDescriptor
@@ -65,10 +64,10 @@ data class PropertyIndexValue(val propertyRefText: String, val getter: Boolean)
class JavaSimplePropertyIndex : FileBasedIndexExtension<Int, PropertyIndexValue>(), PsiDependentIndex {
private val allowedExpressions by lazy {
TokenSet.create(ElementType.REFERENCE_EXPRESSION, ElementType.THIS_EXPRESSION, ElementType.SUPER_EXPRESSION)
}
}
override fun getIndexer(): DataIndexer<Int, PropertyIndexValue, FileContent> = DataIndexer { inputData ->
val result = ContainerUtil.newHashMap<Int, PropertyIndexValue>()
val result = HashMap<Int, PropertyIndexValue>()
val tree = (inputData as FileContentImpl).lighterASTForPsiDependentIndex
object : RecursiveLighterASTNodeWalkingVisitor(tree) {

View File

@@ -1,4 +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-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.
package com.intellij.psi.impl.java;
import com.intellij.ide.highlighter.JavaFileType;
@@ -9,7 +9,6 @@ import com.intellij.psi.impl.source.JavaFileElementType;
import com.intellij.psi.impl.source.tree.ElementType;
import com.intellij.psi.impl.source.tree.JavaElementType;
import com.intellij.psi.impl.source.tree.LightTreeUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.indexing.*;
import com.intellij.util.io.BooleanDataDescriptor;
import com.intellij.util.io.DataExternalizer;
@@ -58,7 +57,7 @@ public class JavaBinaryPlusExpressionIndex extends FileBasedIndexExtension<Boole
result.add(offset);
}
});
THashMap<Boolean, PlusOffsets> resultMap = ContainerUtil.newTroveMap();
THashMap<Boolean, PlusOffsets> resultMap = new THashMap<>();
resultMap.put(Boolean.TRUE, new PlusOffsets(result.toNativeArray()));
return resultMap;
};

View File

@@ -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-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.
package com.intellij.psi.impl.java.stubs.index;
import com.intellij.openapi.project.Project;
@@ -16,10 +16,7 @@ import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
@@ -53,7 +50,7 @@ public class JavaModuleNameIndex extends StringStubIndexExtension<PsiJavaModule>
}
private static Collection<PsiJavaModule> filterVersions(Project project, Collection<PsiJavaModule> modules) {
Set<VirtualFile> filter = ContainerUtil.newHashSet();
Set<VirtualFile> filter = new HashSet<>();
ProjectFileIndex index = ProjectFileIndex.getInstance(project);
for (PsiJavaModule module : modules) {

View File

@@ -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-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.
package com.intellij.psi.impl.search;
import com.intellij.compiler.CompilerDirectHierarchyInfo;
@@ -323,7 +323,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase<PsiFunct
@NotNull
private Set<VirtualFile> getMostLikelyFiles(GlobalSearchScope searchScope) {
Set<VirtualFile> files = ContainerUtil.newLinkedHashSet();
Set<VirtualFile> files = new LinkedHashSet<>();
dumbService.runReadActionInSmartMode(() -> {
if (!samClass.isValid()) return;