mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
deprecate ContainerUtil.newArrayList()
GitOrigin-RevId: bff982a3dabd48c0e4f09e76653b40e2c58636b9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ec3d758312
commit
98912e033d
@@ -25,7 +25,6 @@ import com.intellij.psi.PsiReference;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.intellij.lang.regexp.RegExpLanguageHosts;
|
||||
import org.intellij.lang.regexp.RegExpTT;
|
||||
import org.intellij.lang.regexp.psi.RegExpElementVisitor;
|
||||
@@ -146,7 +145,7 @@ public class RegExpPropertyImpl extends RegExpElementImpl implements RegExpPrope
|
||||
}
|
||||
else {
|
||||
boolean startsWithIs = categoryNode != null && categoryNode.getText().startsWith("Is");
|
||||
Collection<LookupElement> result = ContainerUtil.newArrayList();
|
||||
Collection<LookupElement> result = new ArrayList<>();
|
||||
for (String[] properties : RegExpLanguageHosts.getInstance().getAllKnownProperties(getElement())) {
|
||||
String name = ArrayUtil.getFirstElement(properties);
|
||||
if (name != null) {
|
||||
|
||||
+4
-8
@@ -14,17 +14,13 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.io.URLUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
/**
|
||||
@@ -56,7 +52,7 @@ public class BuildProcessClasspathManager {
|
||||
}
|
||||
|
||||
private static List<String> computeCompileServerPluginsClasspath() {
|
||||
final List<String> classpath = ContainerUtil.newArrayList();
|
||||
final List<String> classpath = new ArrayList<>();
|
||||
|
||||
for (CompileServerPlugin serverPlugin : CompileServerPlugin.EP_NAME.getExtensions()) {
|
||||
final PluginId pluginId = serverPlugin.getPluginDescriptor().getPluginId();
|
||||
@@ -148,7 +144,7 @@ public class BuildProcessClasspathManager {
|
||||
}
|
||||
|
||||
private static List<String> getDynamicClasspath(Project project) {
|
||||
final List<String> classpath = ContainerUtil.newArrayList();
|
||||
final List<String> classpath = new ArrayList<>();
|
||||
for (BuildProcessParametersProvider provider : BuildProcessParametersProvider.EP_NAME.getExtensionList(project)) {
|
||||
classpath.addAll(provider.getClassPath());
|
||||
}
|
||||
@@ -156,7 +152,7 @@ public class BuildProcessClasspathManager {
|
||||
}
|
||||
|
||||
public static List<String> getLauncherClasspath(Project project) {
|
||||
final List<String> classpath = ContainerUtil.newArrayList();
|
||||
final List<String> classpath = new ArrayList<>();
|
||||
for (BuildProcessParametersProvider provider : BuildProcessParametersProvider.EP_NAME.getExtensionList(project)) {
|
||||
classpath.addAll(provider.getLauncherClassPath());
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.concurrency.SequentialTaskExecutor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import gnu.trove.THashMap;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
@@ -118,7 +117,7 @@ public class JarRepositoryManager {
|
||||
JpsMavenRepositoryLibraryDescriptor libraryDescriptor) {
|
||||
RepositoryLibraryProperties props = new RepositoryLibraryProperties(libraryDescriptor);
|
||||
final JpsMavenRepositoryLibraryDescriptor libDescriptor = props.getRepositoryLibraryDescriptor();
|
||||
final Collection<OrderRoot> roots = ContainerUtil.newArrayList();
|
||||
final Collection<OrderRoot> roots = new ArrayList<>();
|
||||
if (libDescriptor.getMavenId() != null) {
|
||||
roots.addAll(loadDependenciesModal(project, libDescriptor, kinds, repositories, copyTo));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.intellij.ui.ComboboxWithBrowseButton;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.AsyncProcessIcon;
|
||||
import com.intellij.xml.util.XmlStringUtil;
|
||||
import gnu.trove.THashMap;
|
||||
@@ -86,7 +85,7 @@ public class RepositoryAttachDialog extends DialogWrapper {
|
||||
private final JComboBox myCombobox;
|
||||
|
||||
private final Map<String, RepositoryArtifactDescription> myCoordinates = new THashMap<>();
|
||||
private final List<String> myShownItems = ContainerUtil.newArrayList();
|
||||
private final List<String> myShownItems = new ArrayList<>();
|
||||
private final String myDefaultDownloadFolder;
|
||||
|
||||
private String myFilterString;
|
||||
|
||||
+2
-2
@@ -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.codeInsight;
|
||||
|
||||
import com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis;
|
||||
@@ -234,7 +234,7 @@ public class DefaultInferredAnnotationProvider implements InferredAnnotationProv
|
||||
@Override
|
||||
public List<PsiAnnotation> findInferredAnnotations(@NotNull PsiModifierListOwner listOwner) {
|
||||
listOwner = PsiUtil.preferCompiledElement(listOwner);
|
||||
List<PsiAnnotation> result = ContainerUtil.newArrayList();
|
||||
List<PsiAnnotation> result = new ArrayList<>();
|
||||
PsiAnnotation[] fromBytecode = ProjectBytecodeAnalysis.getInstance(myProject).findInferredAnnotations(listOwner);
|
||||
for (PsiAnnotation annotation : fromBytecode) {
|
||||
if (!ignoreInference(listOwner, annotation.getQualifiedName())) {
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
// 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.codeInsight;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.psi.PsiAnnotation;
|
||||
import com.intellij.psi.PsiModifierListOwner;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InferredAnnotationsManagerImpl extends InferredAnnotationsManager {
|
||||
@@ -35,7 +35,7 @@ public class InferredAnnotationsManagerImpl extends InferredAnnotationsManager {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiAnnotation[] findInferredAnnotations(@NotNull PsiModifierListOwner listOwner) {
|
||||
List<PsiAnnotation> result = ContainerUtil.newArrayList();
|
||||
List<PsiAnnotation> result = new ArrayList<>();
|
||||
for (InferredAnnotationProvider provider : InferredAnnotationProvider.EP_NAME.getExtensionList(myProject)) {
|
||||
List<PsiAnnotation> annotations = provider.findInferredAnnotations(listOwner);
|
||||
for (PsiAnnotation annotation : annotations) {
|
||||
|
||||
+2
-2
@@ -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.codeInsight.daemon.impl.analysis;
|
||||
|
||||
import com.intellij.codeInsight.daemon.JavaErrorMessages;
|
||||
@@ -919,7 +919,7 @@ public class GenericsHighlightUtil {
|
||||
@Nullable
|
||||
static Collection<HighlightInfo> checkCatchParameterIsClass(@NotNull PsiParameter parameter) {
|
||||
if (!(parameter.getDeclarationScope() instanceof PsiCatchSection)) return null;
|
||||
final Collection<HighlightInfo> result = ContainerUtil.newArrayList();
|
||||
final Collection<HighlightInfo> result = new ArrayList<>();
|
||||
|
||||
final List<PsiTypeElement> typeElements = PsiUtil.getParameterTypeElements(parameter);
|
||||
for (PsiTypeElement typeElement : typeElements) {
|
||||
|
||||
+3
-3
@@ -1338,7 +1338,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
final GlobalSearchScope parameterResolveScope = parameter.getResolveScope();
|
||||
thrownTypes.add(PsiType.getJavaLangError(manager, parameterResolveScope));
|
||||
thrownTypes.add(PsiType.getJavaLangRuntimeException(manager, parameterResolveScope));
|
||||
final Collection<HighlightInfo> result = ContainerUtil.newArrayList();
|
||||
final Collection<HighlightInfo> result = new ArrayList<>();
|
||||
|
||||
final List<PsiTypeElement> parameterTypeElements = PsiUtil.getParameterTypeElements(parameter);
|
||||
final boolean isMultiCatch = parameterTypeElements.size() > 1;
|
||||
@@ -2453,7 +2453,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
static Collection<HighlightInfo> checkCatchTypeIsDisjoint(@NotNull final PsiParameter parameter) {
|
||||
if (!(parameter.getType() instanceof PsiDisjunctionType)) return null;
|
||||
|
||||
final Collection<HighlightInfo> result = ContainerUtil.newArrayList();
|
||||
final Collection<HighlightInfo> result = new ArrayList<>();
|
||||
final List<PsiTypeElement> typeElements = PsiUtil.getParameterTypeElements(parameter);
|
||||
for (int i = 0, size = typeElements.size(); i < size; i++) {
|
||||
final PsiClass class1 = PsiUtil.resolveClassInClassTypeOnly(typeElements.get(i).getType());
|
||||
@@ -2493,7 +2493,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
|
||||
final List<PsiTypeElement> typeElements = PsiUtil.getParameterTypeElements(parameter);
|
||||
final boolean isInMultiCatch = typeElements.size() > 1;
|
||||
final Collection<HighlightInfo> result = ContainerUtil.newArrayList();
|
||||
final Collection<HighlightInfo> result = new ArrayList<>();
|
||||
|
||||
for (PsiTypeElement typeElement : typeElements) {
|
||||
final PsiClass catchClass = PsiUtil.resolveClassInClassTypeOnly(typeElement.getType());
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ class StateQueue {
|
||||
DfaInstructionState next = myQueue.peek();
|
||||
if (next == null || next.compareTo(state) != 0) return Collections.singletonList(state);
|
||||
|
||||
List<DfaMemoryStateImpl> memoryStates = ContainerUtil.newArrayList();
|
||||
List<DfaMemoryStateImpl> memoryStates = new ArrayList<>();
|
||||
memoryStates.add((DfaMemoryStateImpl)state.getMemoryState());
|
||||
while (!myQueue.isEmpty() && myQueue.peek().compareTo(state) == 0) {
|
||||
DfaMemoryState anotherState = myQueue.poll().getMemoryState();
|
||||
@@ -93,7 +93,7 @@ class StateQueue {
|
||||
groups.putValue(memoryState.getSuperficialKey(), memoryState);
|
||||
}
|
||||
|
||||
memoryStates = ContainerUtil.newArrayList();
|
||||
memoryStates = new ArrayList<>();
|
||||
for (Map.Entry<Object, Collection<DfaMemoryStateImpl>> entry : groups.entrySet()) {
|
||||
memoryStates.addAll(mergeGroup((List<DfaMemoryStateImpl>)entry.getValue()));
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
protected DfaMemoryStateImpl(final DfaValueFactory factory) {
|
||||
myFactory = factory;
|
||||
myDefaultVariableStates = new THashMap<>();
|
||||
myEqClasses = ContainerUtil.newArrayList();
|
||||
myEqClasses = new ArrayList<>();
|
||||
myVariableStates = new LinkedHashMap<>();
|
||||
myDistinctClasses = new DistinctPairSet(this);
|
||||
myStack = new Stack<>();
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2013 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-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.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.value.*;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import one.util.streamex.IntStreamEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -68,7 +53,7 @@ class EqClass extends SortedIntSet {
|
||||
}
|
||||
|
||||
List<DfaVariableValue> getVariables(boolean unwrap) {
|
||||
List<DfaVariableValue> vars = ContainerUtil.newArrayList();
|
||||
List<DfaVariableValue> vars = new ArrayList<>();
|
||||
forEach(id -> {
|
||||
DfaValue value = myFactory.getValue(id);
|
||||
if (value instanceof DfaVariableValue) {
|
||||
|
||||
+2
-16
@@ -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-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.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.value.DfaConstValue;
|
||||
@@ -203,7 +189,7 @@ public final class StandardMethodContract extends MethodContract {
|
||||
public static List<StandardMethodContract> parseContract(@NotNull String text) throws ParseException {
|
||||
if (StringUtil.isEmptyOrSpaces(text)) return Collections.emptyList();
|
||||
|
||||
List<StandardMethodContract> result = ContainerUtil.newArrayList();
|
||||
List<StandardMethodContract> result = new ArrayList<>();
|
||||
String[] split = StringUtil.replace(text, " ", "").split(";");
|
||||
for (int clauseIndex = 0; clauseIndex < split.length; clauseIndex++) {
|
||||
String clause = split[clauseIndex];
|
||||
|
||||
@@ -517,7 +517,7 @@ class StateMerger {
|
||||
private static class Replacements {
|
||||
@NotNull private final List<DfaMemoryStateImpl> myAllStates;
|
||||
private final Set<DfaMemoryStateImpl> myRemovedStates = ContainerUtil.newIdentityTroveSet();
|
||||
private final List<DfaMemoryStateImpl> myMerged = ContainerUtil.newArrayList();
|
||||
private final List<DfaMemoryStateImpl> myMerged = new ArrayList<>();
|
||||
|
||||
private Replacements(@NotNull List<DfaMemoryStateImpl> allStates) {
|
||||
myAllStates = allStates;
|
||||
|
||||
+4
-4
@@ -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.codeInspection.dataFlow.inference;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.ContractReturnValue;
|
||||
@@ -242,7 +242,7 @@ class ContractInferenceInterpreter {
|
||||
|
||||
int paramIndex = resolveParameter(expr);
|
||||
if (paramIndex >= 0) {
|
||||
List<StandardMethodContract> result = ContainerUtil.newArrayList();
|
||||
List<StandardMethodContract> result = new ArrayList<>();
|
||||
for (ValueConstraint[] state : states) {
|
||||
if (state[paramIndex] == TRUE_VALUE || state[paramIndex] == FALSE_VALUE || state[paramIndex] == NULL_VALUE) {
|
||||
// like "if(x == null) return x": no need to refer to parameter
|
||||
@@ -305,7 +305,7 @@ class ContractInferenceInterpreter {
|
||||
constraint = getLiteralConstraint(op1);
|
||||
}
|
||||
if (parameter >= 0 && constraint != null) {
|
||||
List<StandardMethodContract> result = ContainerUtil.newArrayList();
|
||||
List<StandardMethodContract> result = new ArrayList<>();
|
||||
for (ValueConstraint[] state : states) {
|
||||
if (constraint == NOT_NULL_VALUE) {
|
||||
if (getPrimitiveParameterType(parameter) == null) {
|
||||
@@ -334,7 +334,7 @@ class ContractInferenceInterpreter {
|
||||
|
||||
private List<StandardMethodContract> visitLogicalOperation(List<LighterASTNode> operands, boolean conjunction, List<ValueConstraint[]> states) {
|
||||
BooleanReturnValue breakValue = returnBoolean(!conjunction);
|
||||
List<StandardMethodContract> finalStates = ContainerUtil.newArrayList();
|
||||
List<StandardMethodContract> finalStates = new ArrayList<>();
|
||||
for (LighterASTNode operand : operands) {
|
||||
List<PreContract> opResults = visitExpression(states, operand);
|
||||
finalStates.addAll(ContainerUtil.filter(knownContracts(opResults), contract -> contract.getReturnValue() == breakValue));
|
||||
|
||||
+1
-2
@@ -12,7 +12,6 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.patterns.ElementPattern;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.FList;
|
||||
import com.intellij.util.containers.FactoryMap;
|
||||
import one.util.streamex.StreamEx;
|
||||
@@ -27,7 +26,7 @@ import static com.intellij.patterns.PsiJavaPatterns.psiParameter;
|
||||
import static com.intellij.patterns.StandardPatterns.or;
|
||||
|
||||
public class DfaValueFactory {
|
||||
private final List<DfaValue> myValues = ContainerUtil.newArrayList();
|
||||
private final List<DfaValue> myValues = new ArrayList<>();
|
||||
final Map<Pair<DfaPsiType, DfaPsiType>, Boolean> myAssignableCache = new HashMap<>();
|
||||
final Map<Pair<DfaPsiType, DfaPsiType>, Boolean> myConvertibleCache = new HashMap<>();
|
||||
private final Map<PsiType, DfaPsiType> myDfaTypes = new HashMap<>();
|
||||
|
||||
+15
-15
@@ -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.codeInspection.nullable;
|
||||
|
||||
import com.intellij.codeInsight.*;
|
||||
@@ -190,7 +190,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
PsiElement list = reference.getParent();
|
||||
PsiElement psiClass = list instanceof PsiReferenceList ? list.getParent() : null;
|
||||
PsiElement intf = reference.resolve();
|
||||
if (psiClass instanceof PsiClass && list == ((PsiClass)psiClass).getImplementsList() &&
|
||||
if (psiClass instanceof PsiClass && list == ((PsiClass)psiClass).getImplementsList() &&
|
||||
intf instanceof PsiClass && ((PsiClass)intf).isInterface()) {
|
||||
String error = checkIndirectInheritance(psiClass, (PsiClass)intf);
|
||||
if (error != null) {
|
||||
@@ -371,9 +371,9 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
"' should not override non-null parameter from '" + intfMethodClass.getName() + "'";
|
||||
}
|
||||
if (isNotNullParameterOverridingNonAnnotated(manager, parameter, supers)) {
|
||||
return "Non-null parameter '" + parameter.getName() +
|
||||
"' in method '" + overridingMethod.getName() +
|
||||
"' from '" + overridingMethodClass.getName() +
|
||||
return "Non-null parameter '" + parameter.getName() +
|
||||
"' in method '" + overridingMethod.getName() +
|
||||
"' from '" + overridingMethodClass.getName() +
|
||||
"' should not override non-annotated parameter from '" + intfMethodClass.getName() + "'";
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
List<PsiExpression> initializers = DfaPsiUtil.findAllConstructorInitializers(field);
|
||||
if (initializers.isEmpty()) return;
|
||||
|
||||
List<PsiParameter> notNullParams = ContainerUtil.newArrayList();
|
||||
List<PsiParameter> notNullParams = new ArrayList<>();
|
||||
|
||||
boolean isFinal = field.hasModifierProperty(PsiModifier.FINAL);
|
||||
|
||||
@@ -611,7 +611,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
AnnotationUtil.findAnnotation(owner, manager.getNullables()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static Annotated check(final PsiModifierListOwner owner, final ProblemsHolder holder, PsiType type) {
|
||||
Annotated annotated = Annotated.from(owner);
|
||||
checkType(owner, holder, type, annotated.notNull, annotated.nullable);
|
||||
@@ -747,7 +747,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
PsiParameter parameter = parameters[i];
|
||||
|
||||
List<PsiParameter> superParameters = ContainerUtil.newArrayList();
|
||||
List<PsiParameter> superParameters = new ArrayList<>();
|
||||
for (PsiMethod superMethod : superMethods) {
|
||||
PsiParameter[] _superParameters = superMethod.getParameterList().getParameters();
|
||||
if (_superParameters.length == parameters.length) {
|
||||
@@ -794,16 +794,16 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
private PsiParameter findNotNullSuperForNonAnnotatedParameter(NullableNotNullManager nullableManager,
|
||||
PsiParameter parameter,
|
||||
List<? extends PsiParameter> superParameters) {
|
||||
return REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL && !nullableManager.hasNullability(parameter)
|
||||
? ContainerUtil.find(superParameters,
|
||||
sp -> isNotNullNotInferred(sp, false, IGNORE_EXTERNAL_SUPER_NOTNULL) && !hasInheritableNotNull(sp))
|
||||
return REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL && !nullableManager.hasNullability(parameter)
|
||||
? ContainerUtil.find(superParameters,
|
||||
sp -> isNotNullNotInferred(sp, false, IGNORE_EXTERNAL_SUPER_NOTNULL) && !hasInheritableNotNull(sp))
|
||||
: null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PsiParameter findNullableSuperForNotNullParameter(PsiParameter parameter, List<? extends PsiParameter> superParameters) {
|
||||
return REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE && isNotNullNotInferred(parameter, false, false)
|
||||
? ContainerUtil.find(superParameters, sp -> isNullableNotInferred(sp, false))
|
||||
return REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE && isNotNullNotInferred(parameter, false, false)
|
||||
? ContainerUtil.find(superParameters, sp -> isNullableNotInferred(sp, false))
|
||||
: null;
|
||||
}
|
||||
|
||||
@@ -895,7 +895,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
for (int i = 0; i < psiParameters.length; i++) {
|
||||
if (parameterQuickFixSuggested[i]) continue;
|
||||
PsiParameter parameter = psiParameters[i];
|
||||
if (parameterAnnotated[i] &&
|
||||
if (parameterAnnotated[i] &&
|
||||
!isNotNullNotInferred(parameter, false, false) &&
|
||||
!isNullableNotInferred(parameter, false) &&
|
||||
AddAnnotationPsiFix.isAvailable(parameter, defaultNotNull)) {
|
||||
@@ -924,7 +924,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
|
||||
|
||||
public static boolean shouldSkipOverriderAsGenerated(PsiMethod overriding) {
|
||||
if (Registry.is("idea.report.nullity.missing.in.generated.overriders")) return false;
|
||||
|
||||
|
||||
PsiFile file = overriding.getContainingFile();
|
||||
VirtualFile virtualFile = file != null ? file.getVirtualFile() : null;
|
||||
return virtualFile != null && GeneratedSourcesFilter.isGeneratedSourceByAnyFilter(virtualFile, overriding.getProject());
|
||||
|
||||
@@ -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.application.options.editor;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
@@ -23,7 +23,6 @@ import com.intellij.ui.ScrollingUtil;
|
||||
import com.intellij.ui.components.fields.ExtendableTextField;
|
||||
import com.intellij.ui.table.JBTable;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.ColumnInfo;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.ListTableModel;
|
||||
@@ -34,10 +33,7 @@ import javax.swing.*;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -186,7 +182,7 @@ class ExcludeTable extends ListTableWithButtons<ExcludeTable.Item> {
|
||||
}
|
||||
|
||||
void reset() {
|
||||
List<Item> rows = ContainerUtil.newArrayList();
|
||||
List<Item> rows = new ArrayList<>();
|
||||
for (String s : CodeInsightSettings.getInstance().EXCLUDED_PACKAGES) {
|
||||
rows.add(new Item(s, ExclusionScope.IDE));
|
||||
}
|
||||
@@ -204,7 +200,7 @@ class ExcludeTable extends ListTableWithButtons<ExcludeTable.Item> {
|
||||
}
|
||||
|
||||
private List<String> getExcludedPackages(ExclusionScope scope) {
|
||||
List<String> result = ContainerUtil.newArrayList();
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Item pair : getTableView().getListTableModel().getItems()) {
|
||||
if (scope == pair.scope) {
|
||||
result.add(pair.exclude);
|
||||
|
||||
@@ -179,7 +179,7 @@ public class ExpectedTypesProvider {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public static PsiType[] processExpectedTypes(@NotNull ExpectedTypeInfo[] infos,
|
||||
@NotNull PsiTypeVisitor<? extends PsiType> visitor, @NotNull Project project) {
|
||||
@@ -270,14 +270,14 @@ public class ExpectedTypesProvider {
|
||||
private final int myMaxCandidates;
|
||||
private final ExpectedClassProvider myClassProvider;
|
||||
private final boolean myVoidable;
|
||||
final List<ExpectedTypeInfo> myResult = ContainerUtil.newArrayList();
|
||||
final List<ExpectedTypeInfo> myResult = new ArrayList<>();
|
||||
@NonNls private static final String LENGTH_SYNTHETIC_ARRAY_FIELD = "length";
|
||||
|
||||
private MyParentVisitor(PsiExpression expr,
|
||||
boolean forCompletion,
|
||||
ExpectedClassProvider classProvider,
|
||||
boolean voidable,
|
||||
boolean usedAfter,
|
||||
boolean usedAfter,
|
||||
int maxCandidates) {
|
||||
myExpr = expr;
|
||||
myForCompletion = forCompletion;
|
||||
@@ -510,7 +510,7 @@ public class ExpectedTypesProvider {
|
||||
PsiType type = statement.getIterationParameter().getType();
|
||||
|
||||
if (PsiType.NULL.equals(type)) return;
|
||||
|
||||
|
||||
PsiType arrayType = type.createArrayType();
|
||||
myResult.add(createInfoImpl(arrayType, arrayType));
|
||||
|
||||
@@ -671,7 +671,7 @@ public class ExpectedTypesProvider {
|
||||
if (candidates != null) {
|
||||
final PsiExpressionList argumentList = Objects.requireNonNull(newExpr.getArgumentList());
|
||||
CandidateInfo[] converted = ContainerUtil.map(candidates, candidate -> (CandidateInfo)candidate, CandidateInfo.EMPTY_ARRAY);
|
||||
Collections.addAll(myResult, getExpectedArgumentTypesForMethodCall(converted, argumentList, myExpr, myForCompletion,
|
||||
Collections.addAll(myResult, getExpectedArgumentTypesForMethodCall(converted, argumentList, myExpr, myForCompletion,
|
||||
newExpr.resolveMethod()));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -1,6 +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.codeInsight;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -12,13 +10,13 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.PatternUtil;
|
||||
import com.intellij.util.containers.ConcurrentFactoryMap;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import com.intellij.util.xmlb.annotations.XCollection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
@@ -33,7 +31,7 @@ public class JavaProjectCodeInsightSettings implements PersistentStateComponent<
|
||||
private static final ConcurrentMap<String, Pattern> ourPatterns = ConcurrentFactoryMap.createWeakMap(PatternUtil::fromMask);
|
||||
|
||||
@XCollection(propertyElementName = "excluded-names", elementName = "name", valueAttributeName = "")
|
||||
public List<String> excludedNames = ContainerUtil.newArrayList();
|
||||
public List<String> excludedNames = new ArrayList<>();
|
||||
|
||||
public static JavaProjectCodeInsightSettings getSettings(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, JavaProjectCodeInsightSettings.class);
|
||||
@@ -93,7 +91,7 @@ public class JavaProjectCodeInsightSettings implements PersistentStateComponent<
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
instance.excludedNames = ContainerUtil.newArrayList();
|
||||
instance.excludedNames = new ArrayList<>();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2013 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-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.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.ExpectedTypeInfo;
|
||||
@@ -76,7 +62,7 @@ public class JavaCompletionSorting {
|
||||
sorter = sorter.weighAfter("priority", new PreferDefaultTypeWeigher(expectedTypes, parameters, false));
|
||||
}
|
||||
|
||||
List<LookupElementWeigher> afterStats = ContainerUtil.newArrayList();
|
||||
List<LookupElementWeigher> afterStats = new ArrayList<>();
|
||||
afterStats.add(new PreferByKindWeigher(type, position, expectedTypes));
|
||||
if (smart) {
|
||||
afterStats.add(new PreferDefaultTypeWeigher(expectedTypes, parameters, true));
|
||||
@@ -284,8 +270,8 @@ public class JavaCompletionSorting {
|
||||
for (int i = 0; i < limit; i++) {
|
||||
String word = words.get(words.size() - i - 1);
|
||||
String expectedWord = expectedWords[expectedWords.length - i - 1];
|
||||
if ( word.equalsIgnoreCase(expectedWord) ||
|
||||
StringUtil.endsWithIgnoreCase(word, expectedWord) ||
|
||||
if ( word.equalsIgnoreCase(expectedWord) ||
|
||||
StringUtil.endsWithIgnoreCase(word, expectedWord) ||
|
||||
StringUtil.endsWithIgnoreCase(expectedWord, word)) {
|
||||
max = Math.max(max, i + 1);
|
||||
}
|
||||
|
||||
@@ -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-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.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.AnnotationTargetUtil;
|
||||
@@ -37,10 +23,7 @@ import com.intellij.util.text.CharArrayUtil;
|
||||
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;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static com.intellij.patterns.PsiJavaPatterns.elementType;
|
||||
@@ -95,7 +78,7 @@ public class PreferByKindWeigher extends LookupElementWeigher {
|
||||
private static Function<PsiClass, MyResult> createSuitabilityCondition(final PsiElement position) {
|
||||
if (isExceptionPosition(position)) {
|
||||
PsiElement container = PsiTreeUtil.getParentOfType(position, PsiTryStatement.class, PsiMethod.class);
|
||||
List<PsiClass> thrownExceptions = ContainerUtil.newArrayList();
|
||||
List<PsiClass> thrownExceptions = new ArrayList<>();
|
||||
if (container != null) {
|
||||
PsiElement block = container instanceof PsiTryStatement ? ((PsiTryStatement)container).getTryBlock() : container;
|
||||
if (block != null) {
|
||||
@@ -154,8 +137,8 @@ public class PreferByKindWeigher extends LookupElementWeigher {
|
||||
}
|
||||
|
||||
static boolean isExceptionPosition(PsiElement position) {
|
||||
return IN_CATCH_TYPE.accepts(position) || IN_MULTI_CATCH_TYPE.accepts(position) ||
|
||||
INSIDE_METHOD_THROWS_CLAUSE.accepts(position) ||
|
||||
return IN_CATCH_TYPE.accepts(position) || IN_MULTI_CATCH_TYPE.accepts(position) ||
|
||||
INSIDE_METHOD_THROWS_CLAUSE.accepts(position) ||
|
||||
JavaDocCompletionContributor.THROWS_TAG_EXCEPTION.accepts(position);
|
||||
}
|
||||
|
||||
@@ -390,11 +373,11 @@ public class PreferByKindWeigher extends LookupElementWeigher {
|
||||
|
||||
private static boolean isGetter(Object object) {
|
||||
if (!(object instanceof PsiMethod)) return false;
|
||||
|
||||
|
||||
PsiMethod method = (PsiMethod)object;
|
||||
if (!PropertyUtilBase.hasGetterName(method)) return false;
|
||||
if (method.hasTypeParameters()) return false;
|
||||
|
||||
|
||||
return !KnownElementWeigher.isGetClass(method);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public abstract class StaticMemberProcessor {
|
||||
}
|
||||
|
||||
public List<PsiMember> processMembersOfRegisteredClasses(final PrefixMatcher matcher, PairConsumer<? super PsiMember, ? super PsiClass> consumer) {
|
||||
final ArrayList<PsiMember> result = ContainerUtil.newArrayList();
|
||||
final ArrayList<PsiMember> result = new ArrayList<>();
|
||||
for (final PsiClass psiClass : myStaticImportedClasses) {
|
||||
for (final PsiMethod method : psiClass.getAllMethods()) {
|
||||
if (matcher.prefixMatches(method.getName())) {
|
||||
|
||||
+4
-18
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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-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.codeInsight.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.FileModificationService;
|
||||
@@ -33,10 +19,10 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiEnumConstant;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -105,12 +91,12 @@ public class ImplementMethodsFix extends LocalQuickFixAndIntentionActionOnPsiEle
|
||||
@Nullable
|
||||
protected static MemberChooser<PsiMethodMember> chooseMethodsToImplement(Editor editor,
|
||||
PsiElement startElement,
|
||||
PsiClass aClass,
|
||||
PsiClass aClass,
|
||||
boolean implemented) {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed(ProductivityFeatureNames.CODEASSISTS_OVERRIDE_IMPLEMENT);
|
||||
|
||||
final Collection<CandidateInfo> overrideImplement = OverrideImplementExploreUtil.getMapToOverrideImplement(aClass, true, implemented).values();
|
||||
return OverrideImplementUtil
|
||||
.showOverrideImplementChooser(editor, startElement, true, overrideImplement, ContainerUtil.newArrayList());
|
||||
.showOverrideImplementChooser(editor, startElement, true, overrideImplement, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
+3
-17
@@ -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-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.codeInsight.editorActions.wordSelection;
|
||||
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
@@ -21,9 +7,9 @@ import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -41,7 +27,7 @@ public class MethodOrClassSelectioner extends BasicSelectioner {
|
||||
|
||||
@Override
|
||||
public List<TextRange> select(@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) {
|
||||
List<TextRange> result = ContainerUtil.newArrayList();
|
||||
List<TextRange> result = new ArrayList<>();
|
||||
|
||||
PsiElement firstChild = e.getFirstChild();
|
||||
PsiElement[] children = e.getChildren();
|
||||
|
||||
@@ -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.codeInsight.generation;
|
||||
|
||||
import com.intellij.application.options.CodeStyle;
|
||||
@@ -418,7 +418,7 @@ public class OverrideImplementUtil extends OverrideImplementExploreUtil {
|
||||
|
||||
Collection<CandidateInfo> candidates = getMethodsToOverrideImplement(aClass, toImplement);
|
||||
Collection<CandidateInfo> secondary = toImplement || aClass.isInterface() ?
|
||||
ContainerUtil.newArrayList() : getMethodsToOverrideImplement(aClass, true);
|
||||
new ArrayList<>() : getMethodsToOverrideImplement(aClass, true);
|
||||
|
||||
final MemberChooser<PsiMethodMember> chooser = showOverrideImplementChooser(editor, aClass, toImplement, candidates, secondary);
|
||||
if (chooser == null) return;
|
||||
|
||||
+3
-17
@@ -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-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.codeInsight.template.macro;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightBundle;
|
||||
@@ -22,9 +8,9 @@ import com.intellij.codeInsight.template.*;
|
||||
import com.intellij.psi.PsiArrayType;
|
||||
import com.intellij.psi.PsiExpression;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ComponentTypeOfMacro extends Macro {
|
||||
@@ -44,7 +30,7 @@ public class ComponentTypeOfMacro extends Macro {
|
||||
LookupElement[] lookupItems = params[0].calculateLookupItems(context);
|
||||
if (lookupItems == null) return null;
|
||||
|
||||
List<LookupElement> result = ContainerUtil.newArrayList();
|
||||
List<LookupElement> result = new ArrayList<>();
|
||||
for (LookupElement element : lookupItems) {
|
||||
PsiTypeLookupItem lookupItem = element.as(PsiTypeLookupItem.CLASS_CONDITION_KEY);
|
||||
if (lookupItem != null) {
|
||||
|
||||
@@ -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.ide.projectView.impl;
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PackageViewPane extends AbstractProjectViewPSIPane {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiDirectory[] getSelectedDirectories() {
|
||||
List<PsiDirectory> directories = ContainerUtil.newArrayList();
|
||||
List<PsiDirectory> directories = new ArrayList<>();
|
||||
for (PackageElementNode node : getSelectedNodes(PackageElementNode.class)) {
|
||||
PackageElement packageElement = node.getValue();
|
||||
PsiPackage aPackage = packageElement != null ? packageElement.getPackage() : null;
|
||||
|
||||
@@ -17,9 +17,9 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ExpressionStatisticsAction extends AnAction {
|
||||
@@ -80,7 +80,7 @@ public class ExpressionStatisticsAction extends AnAction {
|
||||
|
||||
@NotNull
|
||||
private static List<VirtualFile> collectJavaFiles(VirtualFile dir, Project project) {
|
||||
final List<VirtualFile> javaFiles = ContainerUtil.newArrayList();
|
||||
final List<VirtualFile> javaFiles = new ArrayList<>();
|
||||
ProjectFileIndex.SERVICE.getInstance(project).iterateContentUnderDirectory(dir, file -> {
|
||||
if (file.getName().endsWith(".java")) {
|
||||
javaFiles.add(file);
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.jrt.JrtFileSystem;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import com.intellij.util.lang.JavaVersion;
|
||||
import org.jdom.Element;
|
||||
@@ -433,7 +432,7 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
|
||||
@NotNull
|
||||
private static List<String> findClasses(@NotNull File jdkHome, boolean isJre) {
|
||||
List<String> result = ContainerUtil.newArrayList();
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
if (JdkUtil.isExplodedModularRuntime(jdkHome.getPath())) {
|
||||
File[] exploded = new File(jdkHome, "modules").listFiles();
|
||||
|
||||
@@ -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.pom.java;
|
||||
|
||||
import com.intellij.notification.NotificationDisplayType;
|
||||
@@ -22,7 +22,6 @@ import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.ui.components.LegalNoticeDialog;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import com.intellij.util.xmlb.annotations.XCollection;
|
||||
@@ -32,6 +31,7 @@ import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class AcceptedLanguageLevelsSettings implements PersistentStateComponent<
|
||||
new NotificationGroup("Accepted language levels", NotificationDisplayType.STICKY_BALLOON, true);
|
||||
|
||||
@XCollection(propertyElementName = "explicitly-accepted", elementName = "name", valueAttributeName = "")
|
||||
public List<String> acceptedNames = ContainerUtil.newArrayList();
|
||||
public List<String> acceptedNames = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void runActivity(@NotNull Project project) {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
package com.intellij.psi.codeStyle;
|
||||
|
||||
import com.intellij.application.options.codeStyle.properties.ValueListPropertyAccessor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.application.options.codeStyle.properties.CodeStylePropertiesUtil.toCommaSeparatedString;
|
||||
@@ -59,7 +59,7 @@ public class JavaPackageEntryTableAccessor extends ValueListPropertyAccessor<Pac
|
||||
@NotNull
|
||||
@Override
|
||||
protected List<String> toExternal(@NotNull PackageEntryTable value) {
|
||||
List<String> externalList = ContainerUtil.newArrayList();
|
||||
List<String> externalList = new ArrayList<>();
|
||||
for (PackageEntry entry : value.getEntries()) {
|
||||
if (entry == PackageEntry.BLANK_LINE_ENTRY) {
|
||||
externalList.add(String.valueOf(BLANK_LINE_CHAR));
|
||||
|
||||
+2
-6
@@ -2,13 +2,9 @@
|
||||
package com.intellij.psi.codeStyle.arrangement;
|
||||
|
||||
import com.intellij.psi.PsiField;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
public class FieldDependenciesManager {
|
||||
private final Map<PsiField, Set<PsiField>> myFieldDependencies;
|
||||
@@ -24,7 +20,7 @@ public class FieldDependenciesManager {
|
||||
|
||||
@NotNull
|
||||
public List<ArrangementEntryDependencyInfo> getRoots() {
|
||||
List<ArrangementEntryDependencyInfo> list = ContainerUtil.newArrayList();
|
||||
List<ArrangementEntryDependencyInfo> list = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<PsiField, Set<PsiField>> entry : myFieldDependencies.entrySet()) {
|
||||
ArrangementEntryDependencyInfo currentInfo = myFieldInfosMap.get(entry.getKey());
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@ public class JavaArrangementVisitor extends JavaRecursiveElementVisitor {
|
||||
@NotNull
|
||||
private static List<PsiComment> getComments(@NotNull PsiElement element) {
|
||||
PsiElement[] children = element.getChildren();
|
||||
List<PsiComment> comments = ContainerUtil.newArrayList();
|
||||
List<PsiComment> comments = new ArrayList<>();
|
||||
|
||||
for (PsiElement e : children) {
|
||||
if (e instanceof PsiComment) {
|
||||
|
||||
@@ -6,9 +6,9 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.psi.formatter.FormatterUtil;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -21,7 +21,7 @@ public class ChildrenBlocksBuilder {
|
||||
}
|
||||
|
||||
public List<Block> buildNodeChildBlocks(ASTNode node, BlockFactory factory) {
|
||||
List<Block> blocks = ContainerUtil.newArrayList();
|
||||
List<Block> blocks = new ArrayList<>();
|
||||
|
||||
for (ASTNode child : node.getChildren(null)) {
|
||||
if (FormatterUtil.isWhitespaceOrEmpty(child) || child.getTextLength() == 0) {
|
||||
|
||||
@@ -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.formatter.java;
|
||||
|
||||
import com.intellij.formatting.Block;
|
||||
@@ -40,6 +40,7 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1294,7 +1295,7 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
int length = expressions.length;
|
||||
assert length > 1;
|
||||
|
||||
List<TextRange> ranges = ContainerUtil.newArrayList();
|
||||
List<TextRange> ranges = new ArrayList<>();
|
||||
for (int i = 0; i < length - 1; i++) {
|
||||
int startOffset = expressions[i].getTextRange().getEndOffset();
|
||||
int endOffset = expressions[i + 1].getTextRange().getStartOffset();
|
||||
|
||||
+4
-18
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2018 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-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.source.resolve.reference.impl.providers;
|
||||
|
||||
import com.intellij.codeInsight.completion.JavaClassNameCompletionContributor;
|
||||
@@ -240,7 +226,7 @@ public class JavaClassReference extends GenericReference implements PsiJavaRefer
|
||||
@Override
|
||||
@NotNull
|
||||
public Object[] getVariants() {
|
||||
List<Object> result = ContainerUtil.newArrayList();
|
||||
List<Object> result = new ArrayList<>();
|
||||
for (PsiElement context : getCompletionContexts()) {
|
||||
if (context instanceof PsiPackage) {
|
||||
result.addAll(processPackage((PsiPackage)context));
|
||||
@@ -259,7 +245,7 @@ public class JavaClassReference extends GenericReference implements PsiJavaRefer
|
||||
}
|
||||
|
||||
private List<? extends PsiElement> getCompletionContexts() {
|
||||
List<PsiElement> result = ContainerUtil.newArrayList();
|
||||
List<PsiElement> result = new ArrayList<>();
|
||||
|
||||
ContainerUtil.addIfNotNull(result, getCompletionContext());
|
||||
|
||||
@@ -293,7 +279,7 @@ public class JavaClassReference extends GenericReference implements PsiJavaRefer
|
||||
|
||||
@NotNull
|
||||
private List<LookupElement> processPackage(@NotNull PsiPackage aPackage) {
|
||||
final ArrayList<LookupElement> list = ContainerUtil.newArrayList();
|
||||
final ArrayList<LookupElement> list = new ArrayList<>();
|
||||
final int startOffset = StringUtil.isEmpty(aPackage.getName()) ? 0 : aPackage.getQualifiedName().length() + 1;
|
||||
final GlobalSearchScope scope = getScope(getJavaContextFile());
|
||||
for (final PsiPackage subPackage : aPackage.getSubPackages(scope)) {
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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-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.util.proximity;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -29,6 +15,7 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,7 +33,7 @@ public class ExplicitlyImportedWeigher extends ProximityWeigher {
|
||||
final PsiImportList importList = psiJavaFile == null ? null : psiJavaFile.getImportList();
|
||||
if (importList == null) return Collections.emptyList();
|
||||
|
||||
List<String> importedNames = ContainerUtil.newArrayList();
|
||||
List<String> importedNames = new ArrayList<>();
|
||||
for (PsiImportStatementBase statement : importList.getAllImportStatements()) {
|
||||
PsiJavaCodeReferenceElement reference = statement.getImportReference();
|
||||
ContainerUtil.addIfNotNull(importedNames, reference == null ? null : reference.getQualifiedName());
|
||||
|
||||
+2
-17
@@ -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-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.refactoring.encapsulateFields;
|
||||
|
||||
import com.intellij.lang.findUsages.DescriptiveNameUtil;
|
||||
@@ -35,7 +21,6 @@ import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.usageView.UsageViewDescriptor;
|
||||
import com.intellij.usageView.UsageViewUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -246,7 +231,7 @@ public class EncapsulateFieldsProcessor extends BaseRefactoringProcessor {
|
||||
|
||||
@Override
|
||||
@NotNull protected UsageInfo[] findUsages() {
|
||||
ArrayList<EncapsulateFieldUsageInfo> array = ContainerUtil.newArrayList();
|
||||
ArrayList<EncapsulateFieldUsageInfo> array = new ArrayList<>();
|
||||
for (FieldDescriptor fieldDescriptor : myFieldDescriptors) {
|
||||
for (final PsiReference reference : ReferencesSearch.search(fieldDescriptor.getField())) {
|
||||
final PsiElement element = reference.getElement();
|
||||
|
||||
@@ -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.codeInsight;
|
||||
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -36,7 +36,7 @@ public class ExceptionUtil {
|
||||
|
||||
@NotNull
|
||||
public static List<PsiClassType> getThrownExceptions(@NotNull PsiElement[] elements) {
|
||||
List<PsiClassType> array = ContainerUtil.newArrayList();
|
||||
List<PsiClassType> array = new ArrayList<>();
|
||||
for (PsiElement element : elements) {
|
||||
List<PsiClassType> exceptions = getThrownExceptions(element);
|
||||
addExceptions(array, exceptions);
|
||||
@@ -55,7 +55,7 @@ public class ExceptionUtil {
|
||||
|
||||
@NotNull
|
||||
private static List<PsiClassType> filterOutUncheckedExceptions(@NotNull List<? extends PsiClassType> exceptions) {
|
||||
List<PsiClassType> array = ContainerUtil.newArrayList();
|
||||
List<PsiClassType> array = new ArrayList<>();
|
||||
for (PsiClassType exception : exceptions) {
|
||||
if (!isUncheckedException(exception)) array.add(exception);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class ExceptionUtil {
|
||||
|
||||
@NotNull
|
||||
private static List<PsiClassType> getTryExceptions(@NotNull PsiTryStatement tryStatement) {
|
||||
List<PsiClassType> array = ContainerUtil.newArrayList();
|
||||
List<PsiClassType> array = new ArrayList<>();
|
||||
|
||||
PsiResourceList resourceList = tryStatement.getResourceList();
|
||||
if (resourceList != null) {
|
||||
@@ -205,7 +205,7 @@ public class ExceptionUtil {
|
||||
|
||||
GlobalSearchScope scope = place.getResolveScope();
|
||||
|
||||
List<PsiClassType> result = ContainerUtil.newArrayList();
|
||||
List<PsiClassType> result = new ArrayList<>();
|
||||
for (PsiType type : referenceTypes) {
|
||||
type = PsiClassImplUtil.correctType(substitutor.substitute(type), scope);
|
||||
if (type instanceof PsiClassType) {
|
||||
@@ -371,7 +371,7 @@ public class ExceptionUtil {
|
||||
|
||||
@NotNull
|
||||
public static List<PsiClassType> getUnhandledExceptions(final @NotNull PsiElement[] elements) {
|
||||
final List<PsiClassType> array = ContainerUtil.newArrayList();
|
||||
final List<PsiClassType> array = new ArrayList<>();
|
||||
|
||||
final PsiElementVisitor visitor = new JavaRecursiveElementWalkingVisitor() {
|
||||
@Override
|
||||
@@ -473,7 +473,7 @@ public class ExceptionUtil {
|
||||
try {
|
||||
PsiScopesUtil.setupAndRunProcessor(processor, methodCall, false);
|
||||
// Resolve other signatures in case of multiple interface inheritance
|
||||
// e.g. consider
|
||||
// e.g. consider
|
||||
// interface X {void a() throws A;} interface Y{void a() throws B;} class Z extends X, Y {}
|
||||
// here normal resolve returns X.a(), but we should check throws clauses for both a() methods.
|
||||
// (see JLS 15.12.2.5)
|
||||
@@ -672,7 +672,7 @@ public class ExceptionUtil {
|
||||
PsiSubstitutor substitutor,
|
||||
PsiClassType[] referencedTypes) {
|
||||
if (referencedTypes.length > 0) {
|
||||
List<PsiClassType> result = ContainerUtil.newArrayList();
|
||||
List<PsiClassType> result = new ArrayList<>();
|
||||
|
||||
for (PsiClassType referencedType : referencedTypes) {
|
||||
final PsiType type = PsiClassImplUtil.correctType(GenericsUtil.eliminateWildcards(substitutor.substitute(referencedType), false), element.getResolveScope());
|
||||
|
||||
@@ -110,7 +110,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiClass[] getClasses(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
|
||||
final List<PsiClass> result = ContainerUtil.newArrayList();
|
||||
final List<PsiClass> result = new ArrayList<>();
|
||||
processDirectories(psiPackage.getQualifiedName(), scope, dir -> {
|
||||
for (final VirtualFile file : dir.getChildren()) {
|
||||
if (!file.isDirectory() && ArrayUtil.contains(file.getExtension(), myFileExtensions)) {
|
||||
|
||||
@@ -349,7 +349,7 @@ public class PsiClassImplUtil {
|
||||
return ConcurrentFactoryMap.createMap(key -> {
|
||||
final Map<String, List<PsiMember>> map = new THashMap<>();
|
||||
|
||||
final List<PsiMember> allMembers = ContainerUtil.newArrayList();
|
||||
final List<PsiMember> allMembers = new ArrayList<>();
|
||||
map.put(ALL, allMembers);
|
||||
|
||||
ElementClassFilter filter = key == MemberType.CLASS ? ElementClassFilter.CLASS :
|
||||
|
||||
@@ -17,10 +17,7 @@ import gnu.trove.TObjectHashingStrategy;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.assertNotNull;
|
||||
|
||||
@@ -73,7 +70,7 @@ class ScopedClassHierarchy {
|
||||
|
||||
@NotNull
|
||||
private static List<PsiType> getSuperTypes(PsiClass psiClass) {
|
||||
List<PsiType> superTypes = ContainerUtil.newArrayList();
|
||||
List<PsiType> superTypes = new ArrayList<>();
|
||||
if (psiClass instanceof PsiAnonymousClass) {
|
||||
ContainerUtil.addIfNotNull(superTypes, ((PsiAnonymousClass)psiClass).getBaseClassType());
|
||||
}
|
||||
@@ -144,7 +141,7 @@ class ScopedClassHierarchy {
|
||||
@NotNull
|
||||
private List<PsiClassType.ClassResolveResult> calcImmediateSupersWithCapturing() {
|
||||
PsiUtilCore.ensureValid(myPlaceClass);
|
||||
List<PsiClassType.ClassResolveResult> list = ContainerUtil.newArrayList();
|
||||
List<PsiClassType.ClassResolveResult> list = new ArrayList<>();
|
||||
for (PsiClassType type : myPlaceClass.getSuperTypes()) {
|
||||
PsiUtil.ensureValidType(type);
|
||||
PsiClassType corrected = PsiClassImplUtil.correctType(type, myResolveScope);
|
||||
|
||||
@@ -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.compiled;
|
||||
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
@@ -46,7 +46,7 @@ public class ClsClassImpl extends ClsMemberImpl<PsiClassStub<?>> implements PsiE
|
||||
@Override
|
||||
@NotNull
|
||||
public PsiElement[] getChildren() {
|
||||
List<PsiElement> children = ContainerUtil.newArrayList();
|
||||
List<PsiElement> children = new ArrayList<>();
|
||||
ContainerUtil.addAll(children, getChildren(getDocComment(), getModifierListInternal(), getNameIdentifier(), getExtendsList(), getImplementsList()));
|
||||
ContainerUtil.addAll(children, getOwnFields());
|
||||
ContainerUtil.addAll(children, getOwnMethods());
|
||||
|
||||
@@ -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-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.compiled;
|
||||
|
||||
import com.intellij.core.JavaCoreBundle;
|
||||
@@ -34,10 +20,10 @@ import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -95,7 +81,7 @@ public abstract class ClsElementImpl extends PsiElementBase implements PsiCompil
|
||||
return PsiElement.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
List<PsiElement> list = ContainerUtil.newArrayListWithCapacity(children.length);
|
||||
List<PsiElement> list = new ArrayList<>(children.length);
|
||||
for (PsiElement child : children) {
|
||||
if (child != null) {
|
||||
list.add(child);
|
||||
|
||||
@@ -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-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.compiled;
|
||||
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -26,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.text.CharacterIterator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,7 +30,7 @@ public class SignatureParsing {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Pair<String, String[]>> typeParameters = ContainerUtil.newArrayList();
|
||||
List<Pair<String, String[]>> typeParameters = new ArrayList<>();
|
||||
signature.next();
|
||||
while (signature.current() != '>') {
|
||||
typeParameters.add(parseTypeParameter(signature, mapping));
|
||||
|
||||
@@ -28,10 +28,7 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static com.intellij.openapi.util.Pair.pair;
|
||||
import static com.intellij.util.BitUtil.isSet;
|
||||
@@ -672,7 +669,7 @@ public class StubBuildingVisitor<T> extends ClassVisitor {
|
||||
|
||||
private boolean accepted(int index, String text) {
|
||||
if (myFilters == null) {
|
||||
myFilters = ContainerUtil.newArrayListWithCapacity(myParamCount + 1);
|
||||
myFilters = new ArrayList<>(myParamCount + 1);
|
||||
for (int i = 0; i < myParamCount + 1; i++) myFilters.add(null);
|
||||
}
|
||||
Set<String> filter = myFilters.get(index);
|
||||
|
||||
@@ -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-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.file;
|
||||
|
||||
import com.intellij.codeInsight.completion.scope.JavaCompletionHints;
|
||||
@@ -248,7 +234,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
|
||||
}
|
||||
PsiClass[] result = partial.get(Pair.create(scope, name));
|
||||
if (result == null) {
|
||||
List<PsiClass> fastClasses = ContainerUtil.newArrayList();
|
||||
List<PsiClass> fastClasses = new ArrayList<>();
|
||||
for (PsiDirectory directory : getDirectories(scope)) {
|
||||
List<PsiFile> sameNamed = ContainerUtil.filter(directory.getFiles(), file -> file.getName().contains(name));
|
||||
Collections.addAll(fastClasses, CoreJavaDirectoryService.getPsiClasses(directory, sameNamed.toArray(PsiFile.EMPTY_ARRAY)));
|
||||
@@ -307,7 +293,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
|
||||
if (classes.length == 0 && PsiUtil.isInsideJavadocComment(place)) {
|
||||
//extend scope for javadoc references when no classes are found in the resolve scope:
|
||||
|
||||
//always replacing the scope works bad for the case when multiple classes with the same FQName exist, because index return them in unpredictable order,
|
||||
//always replacing the scope works bad for the case when multiple classes with the same FQName exist, because index return them in unpredictable order,
|
||||
//so class not accessible from `place` may be used instead of another accessible class
|
||||
classes = findClassByShortName(providedName, allScope());
|
||||
}
|
||||
@@ -390,7 +376,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
|
||||
private class PackageAnnotationValueProvider implements CachedValueProvider<PsiModifierList> {
|
||||
@Override
|
||||
public Result<PsiModifierList> compute() {
|
||||
List<PsiModifierList> modifiers = ContainerUtil.newArrayList();
|
||||
List<PsiModifierList> modifiers = new ArrayList<>();
|
||||
for(PsiDirectory directory: getDirectories()) {
|
||||
PsiFile file = directory.findFile(PACKAGE_INFO_FILE);
|
||||
PsiPackageStatement stmt = file == null ? null : PsiTreeUtil.getChildOfType(file, PsiPackageStatement.class);
|
||||
|
||||
@@ -17,12 +17,12 @@ import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarFile;
|
||||
@@ -67,7 +67,7 @@ public class LightJavaModule extends LightElement implements PsiJavaModule {
|
||||
}
|
||||
|
||||
private List<PsiPackageAccessibilityStatement> findExports() {
|
||||
List<PsiPackageAccessibilityStatement> exports = ContainerUtil.newArrayList();
|
||||
List<PsiPackageAccessibilityStatement> exports = new ArrayList<>();
|
||||
|
||||
VfsUtilCore.visitChildrenRecursively(myJarRoot, new VirtualFileVisitor() {
|
||||
private final JavaDirectoryService service = JavaDirectoryService.getInstance();
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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-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.light;
|
||||
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiClassImplUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import static com.intellij.psi.PsiReferenceList.Role.EXTENDS_LIST;
|
||||
@@ -32,7 +18,7 @@ public class LightPsiClassBuilder extends LightPsiClassBase implements OriginInf
|
||||
private final LightReferenceListBuilder myImplementsList = new LightReferenceListBuilder(getManager(), IMPLEMENTS_LIST);
|
||||
private final LightReferenceListBuilder myExtendsList = new LightReferenceListBuilder(getManager(), EXTENDS_LIST);
|
||||
private final LightTypeParameterListBuilder myTypeParametersList = new LightTypeParameterListBuilder(getManager(), getLanguage());
|
||||
private final Collection<PsiMethod> myMethods = ContainerUtil.newArrayList();
|
||||
private final Collection<PsiMethod> myMethods = new ArrayList<>();
|
||||
private PsiElement myScope;
|
||||
private PsiClass myContainingClass;
|
||||
private String myOriginInfo;
|
||||
|
||||
+2
-17
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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-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.source.javadoc;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
@@ -40,7 +26,6 @@ import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.CharTable;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -99,7 +84,7 @@ public class PsiDocMethodOrFieldRef extends CompositePsiElement implements PsiDo
|
||||
|
||||
final MethodSignature methodSignature;
|
||||
if (signature != null) {
|
||||
final List<PsiType> types = ContainerUtil.newArrayListWithCapacity(signature.length);
|
||||
final List<PsiType> types = new ArrayList<>(signature.length);
|
||||
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(element.getProject());
|
||||
for (String s : signature) {
|
||||
try {
|
||||
|
||||
+2
-16
@@ -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-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.source.tree.java;
|
||||
|
||||
import com.intellij.codeInsight.ExceptionUtil;
|
||||
@@ -146,7 +132,7 @@ public class PsiCatchSectionImpl extends CompositePsiElement implements PsiCatch
|
||||
}
|
||||
|
||||
private static Collection<PsiClassType> getThrownTypes(@NotNull PsiTryStatement statement) {
|
||||
Collection<PsiClassType> types = ContainerUtil.newArrayList();
|
||||
Collection<PsiClassType> types = new ArrayList<>();
|
||||
PsiCodeBlock tryBlock = statement.getTryBlock();
|
||||
if (tryBlock != null) {
|
||||
types.addAll(ExceptionUtil.getThrownExceptions(tryBlock));
|
||||
|
||||
+3
-17
@@ -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-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.java.psi.impl.cache.impl;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -41,10 +27,10 @@ import com.intellij.psi.search.PackageScope;
|
||||
import com.intellij.psi.util.FindClassUtil;
|
||||
import com.intellij.testFramework.PsiTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.jps.model.java.JavaResourceRootType;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -196,7 +182,7 @@ public class FindClassTest extends PsiTestCase {
|
||||
}
|
||||
|
||||
private List<Module> configureTwoMoreModules() {
|
||||
final List<Module> newModules = ContainerUtil.newArrayList();
|
||||
final List<Module> newModules = new ArrayList<>();
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
ModifiableModuleModel modifiableModel = ModuleManager.getInstance(getProject()).getModifiableModel();
|
||||
Module module2 = modifiableModel.newModule("a.iml", StdModuleTypes.JAVA.getId());
|
||||
|
||||
@@ -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 org.jetbrains.jps.model.java.impl;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class JavaSdkUtil {
|
||||
|
||||
FileFilter jarFileFilter = FileFilters.filesWithExtension("jar");
|
||||
Set<String> pathFilter = ContainerUtil.newTroveSet(FileUtil.PATH_HASHING_STRATEGY);
|
||||
List<File> rootFiles = ContainerUtil.newArrayList();
|
||||
List<File> rootFiles = new ArrayList<>();
|
||||
if (Registry.is("project.structure.add.tools.jar.to.new.jdk")) {
|
||||
File toolsJar = new File(home, "lib/tools.jar");
|
||||
if (toolsJar.isFile()) {
|
||||
|
||||
+3
-16
@@ -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-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 org.jetbrains.jps.model.serialization.java.compiler;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -23,6 +9,7 @@ import org.jetbrains.jps.model.java.JpsJavaExtensionService;
|
||||
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration;
|
||||
import org.jetbrains.jps.model.serialization.JpsProjectExtensionSerializer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +25,7 @@ public class JpsJavaCompilerNotNullableSerializer extends JpsProjectExtensionSer
|
||||
@Override
|
||||
public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) {
|
||||
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
|
||||
List<String> annoNames = ContainerUtil.newArrayList();
|
||||
List<String> annoNames = new ArrayList<>();
|
||||
for (Element option : componentTag.getChildren("instrumentedNotNulls")) {
|
||||
for (Element item : option.getChildren("option")) {
|
||||
ContainerUtil.addIfNotNull(annoNames, item.getAttributeValue("value"));
|
||||
|
||||
@@ -1,3 +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.
|
||||
package com.intellij.json.breadcrumbs;
|
||||
|
||||
import com.intellij.json.JsonBundle;
|
||||
@@ -10,7 +11,6 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.ide.CopyPasteManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.ui.breadcrumbs.BreadcrumbsProvider;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.jetbrains.jsonSchema.impl.JsonSchemaDocumentationProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -18,6 +18,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -59,7 +60,7 @@ public class JsonBreadcrumbsProvider implements BreadcrumbsProvider {
|
||||
@Override
|
||||
public List<? extends Action> getContextActions(@NotNull PsiElement element) {
|
||||
JsonQualifiedNameKind[] values = JsonQualifiedNameKind.values();
|
||||
List<Action> actions = ContainerUtil.newArrayListWithCapacity(values.length);
|
||||
List<Action> actions = new ArrayList<>(values.length);
|
||||
for (JsonQualifiedNameKind kind: values) {
|
||||
actions.add(new AbstractAction(JsonBundle.message("json.copy.to.clipboard", kind.toString())) {
|
||||
@Override
|
||||
|
||||
@@ -1,3 +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.
|
||||
package com.intellij.json.formatter;
|
||||
|
||||
import com.intellij.formatting.*;
|
||||
@@ -12,10 +13,10 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.TokenType;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.json.JsonElementTypes.*;
|
||||
@@ -65,7 +66,7 @@ public class JsonBlock implements ASTBlock {
|
||||
|
||||
public JsonBlock(@Nullable JsonBlock parent,
|
||||
@NotNull ASTNode node,
|
||||
@NotNull JsonCodeStyleSettings customSettings,
|
||||
@NotNull JsonCodeStyleSettings customSettings,
|
||||
@Nullable Alignment alignment,
|
||||
@NotNull Indent indent,
|
||||
@Nullable Wrap wrap,
|
||||
@@ -109,7 +110,7 @@ public class JsonBlock implements ASTBlock {
|
||||
if (mySubBlocks == null) {
|
||||
int propertyAlignment = myCustomSettings.PROPERTY_ALIGNMENT;
|
||||
ASTNode[] children = myNode.getChildren(null);
|
||||
mySubBlocks = ContainerUtil.newArrayListWithCapacity(children.length);
|
||||
mySubBlocks = new ArrayList<>(children.length);
|
||||
for (ASTNode child: children) {
|
||||
if (isWhitespaceOrEmpty(child)) continue;
|
||||
mySubBlocks.add(makeSubBlock(child, propertyAlignment));
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// 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.json.pointer;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -13,7 +14,7 @@ import static com.jetbrains.jsonSchema.JsonPointerUtil.*;
|
||||
public class JsonPointerPosition {
|
||||
|
||||
public JsonPointerPosition() {
|
||||
this.steps = ContainerUtil.newArrayList();
|
||||
this.steps = new ArrayList<>();
|
||||
}
|
||||
|
||||
private JsonPointerPosition(List<Step> steps) {
|
||||
@@ -26,7 +27,7 @@ public class JsonPointerPosition {
|
||||
|
||||
public static JsonPointerPosition parsePointer(@NotNull String pointer) {
|
||||
final List<String> chain = split(normalizeSlashes(normalizeId(pointer)));
|
||||
List<JsonPointerPosition.Step> steps = ContainerUtil.newArrayListWithCapacity(chain.size());
|
||||
List<JsonPointerPosition.Step> steps = new ArrayList<>(chain.size());
|
||||
for (String s: chain) {
|
||||
try {
|
||||
steps.add(JsonPointerPosition.Step.createArrayElementStep(Integer.parseInt(s)));
|
||||
|
||||
@@ -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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionUtil;
|
||||
@@ -26,10 +26,7 @@ import com.jetbrains.jsonSchema.remote.JsonFileResolver;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
public class JsonCachedValues {
|
||||
private static final Key<CachedValue<JsonSchemaObject>> JSON_OBJECT_CACHE_KEY = Key.create("JsonSchemaObjectCache");
|
||||
@@ -154,7 +151,7 @@ public class JsonCachedValues {
|
||||
|
||||
JsonValue schemasValue = schemas.getValue();
|
||||
if (!(schemasValue instanceof JsonArray)) return null;
|
||||
List<JsonSchemaCatalogEntry> catalogMap = ContainerUtil.newArrayList();
|
||||
List<JsonSchemaCatalogEntry> catalogMap = new ArrayList<>();
|
||||
fillMap((JsonArray)schemasValue, catalogMap);
|
||||
return catalogMap;
|
||||
}
|
||||
@@ -193,7 +190,7 @@ public class JsonCachedValues {
|
||||
}
|
||||
|
||||
if (value instanceof JsonArray) {
|
||||
List<String> strings = ContainerUtil.newArrayList();
|
||||
List<String> strings = new ArrayList<>();
|
||||
for (JsonValue val: ((JsonArray)value).getValueList()) {
|
||||
if (val instanceof JsonStringLiteral) {
|
||||
strings.add(((JsonStringLiteral)val).getValue());
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -52,7 +53,7 @@ public class JsonPointerReferenceProvider extends PsiReferenceProvider {
|
||||
@Override
|
||||
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
|
||||
if (!(element instanceof JsonStringLiteral)) return PsiReference.EMPTY_ARRAY;
|
||||
List<PsiReference> refs = ContainerUtil.newArrayList();
|
||||
List<PsiReference> refs = new ArrayList<>();
|
||||
|
||||
List<Pair<TextRange, String>> fragments = ((JsonStringLiteral)element).getTextFragments();
|
||||
if (fragments.size() != 1) return PsiReference.EMPTY_ARRAY;
|
||||
@@ -136,7 +137,7 @@ public class JsonPointerReferenceProvider extends PsiReferenceProvider {
|
||||
|
||||
@NotNull
|
||||
private Object[] collectCatalogVariants() {
|
||||
List<LookupElement> elements = ContainerUtil.newArrayList();
|
||||
List<LookupElement> elements = new ArrayList<>();
|
||||
final Project project = getElement().getProject();
|
||||
final List<JsonSchemaInfo> schemas = JsonSchemaService.Impl.get(project).getAllUserVisibleSchemas();
|
||||
for (JsonSchemaInfo schema : schemas) {
|
||||
|
||||
@@ -361,7 +361,7 @@ class JsonSchemaAnnotatorChecker {
|
||||
@NotNull
|
||||
private JsonValidationError.MissingMultiplePropsIssueData createMissingPropertiesData(@NotNull JsonSchemaObject schema,
|
||||
HashSet<String> requiredNames) {
|
||||
List<JsonValidationError.MissingPropertyIssueData> allProps = ContainerUtil.newArrayList();
|
||||
List<JsonValidationError.MissingPropertyIssueData> allProps = new ArrayList<>();
|
||||
for (String req: requiredNames) {
|
||||
JsonSchemaObject propertySchema = resolvePropertySchema(schema, req);
|
||||
Object defaultValue = propertySchema == null ? null : propertySchema.getDefault();
|
||||
@@ -516,7 +516,7 @@ class JsonSchemaAnnotatorChecker {
|
||||
if (!value.isShouldBeIgnored()) checker.typeError(value.getDelegate(), null, getExpectedTypes(collection));
|
||||
}
|
||||
else {
|
||||
final List<JsonSchemaObject> filtered = ContainerUtil.newArrayListWithCapacity(collection.size());
|
||||
final List<JsonSchemaObject> filtered = new ArrayList<>(collection.size());
|
||||
for (JsonSchemaObject schema: collection) {
|
||||
if (!areSchemaTypesCompatible(schema, type)) continue;
|
||||
filtered.add(schema);
|
||||
@@ -848,8 +848,8 @@ class JsonSchemaAnnotatorChecker {
|
||||
|
||||
// returns the schema, selected for annotation
|
||||
private JsonSchemaObject processOneOf(@NotNull JsonValueAdapter value, List<JsonSchemaObject> oneOf) {
|
||||
final List<JsonSchemaAnnotatorChecker> candidateErroneousCheckers = ContainerUtil.newArrayList();
|
||||
final List<JsonSchemaObject> candidateErroneousSchemas = ContainerUtil.newArrayList();
|
||||
final List<JsonSchemaAnnotatorChecker> candidateErroneousCheckers = new ArrayList<>();
|
||||
final List<JsonSchemaObject> candidateErroneousSchemas = new ArrayList<>();
|
||||
final List<JsonSchemaObject> correct = new SmartList<>();
|
||||
for (JsonSchemaObject object : oneOf) {
|
||||
// skip it if something JS awaited, we do not process it currently
|
||||
@@ -941,8 +941,8 @@ class JsonSchemaAnnotatorChecker {
|
||||
|
||||
// returns the schema, selected for annotation
|
||||
private JsonSchemaObject processAnyOf(@NotNull JsonValueAdapter value, List<JsonSchemaObject> anyOf) {
|
||||
final List<JsonSchemaAnnotatorChecker> candidateErroneousCheckers = ContainerUtil.newArrayList();
|
||||
final List<JsonSchemaObject> candidateErroneousSchemas = ContainerUtil.newArrayList();
|
||||
final List<JsonSchemaAnnotatorChecker> candidateErroneousCheckers = new ArrayList<>();
|
||||
final List<JsonSchemaObject> candidateErroneousSchemas = new ArrayList<>();
|
||||
|
||||
for (JsonSchemaObject object : anyOf) {
|
||||
final JsonSchemaAnnotatorChecker checker = new JsonSchemaAnnotatorChecker(myProject, myOptions);
|
||||
|
||||
@@ -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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionToolSession;
|
||||
@@ -18,10 +18,7 @@ import com.jetbrains.jsonSchema.extension.adapters.JsonValueAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
public class JsonSchemaComplianceChecker {
|
||||
private static final Key<Set<PsiElement>> ANNOTATED_PROPERTIES = Key.create("JsonSchema.Properties.Annotated");
|
||||
@@ -89,8 +86,8 @@ public class JsonSchemaComplianceChecker {
|
||||
private void createWarnings(@Nullable JsonSchemaAnnotatorChecker checker) {
|
||||
if (checker == null || checker.isCorrect()) return;
|
||||
// compute intersecting ranges - we'll solve warning priorities based on this information
|
||||
List<TextRange> ranges = ContainerUtil.newArrayList();
|
||||
List<List<Map.Entry<PsiElement, JsonValidationError>>> entries = ContainerUtil.newArrayList();
|
||||
List<TextRange> ranges = new ArrayList<>();
|
||||
List<List<Map.Entry<PsiElement, JsonValidationError>>> entries = new ArrayList<>();
|
||||
for (Map.Entry<PsiElement, JsonValidationError> entry : checker.getErrors().entrySet()) {
|
||||
TextRange range = entry.getKey().getTextRange();
|
||||
boolean processed = false;
|
||||
|
||||
@@ -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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.json.pointer.JsonPointerPosition;
|
||||
@@ -13,13 +13,13 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.FakePsiElement;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.PsiFileReference;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.jetbrains.jsonSchema.extension.JsonLikePsiWalker;
|
||||
import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider;
|
||||
import com.jetbrains.jsonSchema.ide.JsonSchemaService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -108,7 +108,7 @@ public class JsonSchemaDocumentationProvider implements DocumentationProvider {
|
||||
|
||||
String htmlDescription = null;
|
||||
boolean deprecated = false;
|
||||
List<JsonSchemaType> possibleTypes = ContainerUtil.newArrayList();
|
||||
List<JsonSchemaType> possibleTypes = new ArrayList<>();
|
||||
for (JsonSchemaObject schema : schemas) {
|
||||
if (htmlDescription == null) {
|
||||
htmlDescription = getBestDocumentation(preferShort, schema);
|
||||
|
||||
@@ -140,7 +140,7 @@ public class JsonSchemaObject {
|
||||
|
||||
public void completeInitialization(JsonValueAdapter jsonObject) {
|
||||
if (myIf != null) {
|
||||
myIfThenElse = ContainerUtil.newArrayList();
|
||||
myIfThenElse = new ArrayList<>();
|
||||
myIfThenElse.add(new IfThenElse(myIf, myThen, myElse));
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ public class JsonSchemaObject {
|
||||
@Nullable
|
||||
private static <T> List<T> copyList(@Nullable List<T> target, @Nullable List<T> source) {
|
||||
if (source == null || source.isEmpty()) return target;
|
||||
if (target == null) target = ContainerUtil.newArrayListWithCapacity(source.size());
|
||||
if (target == null) target = new ArrayList<>(source.size());
|
||||
target.addAll(source);
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class JsonSchemaReader {
|
||||
return (element, object, queue, virtualFile) -> {
|
||||
if (element instanceof JsonArrayValueAdapter) {
|
||||
final List<JsonValueAdapter> list = ((JsonArrayValueAdapter)element).getElements();
|
||||
final List<JsonSchemaObject> members = ContainerUtil.newArrayListWithCapacity(list.size());
|
||||
final List<JsonSchemaObject> members = new ArrayList<>(list.size());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JsonValueAdapter value = list.get(i);
|
||||
if (!(value.isObject())) continue;
|
||||
|
||||
@@ -176,7 +176,7 @@ public class JsonSchemaServiceImpl implements JsonSchemaService {
|
||||
}
|
||||
|
||||
if (!single) {
|
||||
List<VirtualFile> files = ContainerUtil.newArrayList();
|
||||
List<VirtualFile> files = new ArrayList<>();
|
||||
for (JsonSchemaFileProvider provider : providers) {
|
||||
VirtualFile schemaFile = getSchemaForProvider(myProject, provider);
|
||||
if (schemaFile != null) {
|
||||
@@ -231,7 +231,7 @@ public class JsonSchemaServiceImpl implements JsonSchemaService {
|
||||
public List<JsonSchemaInfo> getAllUserVisibleSchemas() {
|
||||
List<JsonSchemaCatalogEntry> schemas = myCatalogManager.getAllCatalogEntries();
|
||||
Collection<? extends JsonSchemaFileProvider> providers = myState.getProviders();
|
||||
List<JsonSchemaInfo> results = ContainerUtil.newArrayListWithCapacity(schemas.size() + providers.size());
|
||||
List<JsonSchemaInfo> results = new ArrayList<>(schemas.size() + providers.size());
|
||||
Map<String, JsonSchemaInfo> processedRemotes = new HashMap<>();
|
||||
for (JsonSchemaFileProvider provider: providers) {
|
||||
if (provider.isUserVisible()) {
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
/*
|
||||
* 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-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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.json.pointer.JsonPointerPosition;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -83,7 +68,7 @@ public class JsonSchemaTreeNode {
|
||||
}
|
||||
|
||||
private List<JsonSchemaTreeNode> convertToNodes(List<JsonSchemaObject> children) {
|
||||
List<JsonSchemaTreeNode> nodes = ContainerUtil.newArrayListWithCapacity(children.size());
|
||||
List<JsonSchemaTreeNode> nodes = new ArrayList<>(children.size());
|
||||
for (JsonSchemaObject child: children) {
|
||||
nodes.add(new JsonSchemaTreeNode(this, child));
|
||||
}
|
||||
|
||||
@@ -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-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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.json.pointer.JsonPointerPosition;
|
||||
@@ -262,11 +248,9 @@ public class JsonSchemaVariantsTreeBuilder {
|
||||
final List<JsonSchemaObject> mergedAny = andGroups(op.myAnyOfGroup, myAnyOfGroup);
|
||||
|
||||
final List<List<JsonSchemaObject>> mergedExclusive =
|
||||
ContainerUtil.newArrayListWithCapacity(
|
||||
op.myAnyOfGroup.size() * maxSize(myOneOfGroup) +
|
||||
myAnyOfGroup.size() * maxSize(op.myOneOfGroup) +
|
||||
maxSize(myOneOfGroup) * maxSize(op.myOneOfGroup)
|
||||
);
|
||||
new ArrayList<>(op.myAnyOfGroup.size() * maxSize(myOneOfGroup) +
|
||||
myAnyOfGroup.size() * maxSize(op.myOneOfGroup) +
|
||||
maxSize(myOneOfGroup) * maxSize(op.myOneOfGroup));
|
||||
|
||||
for (List<JsonSchemaObject> objects : myOneOfGroup) {
|
||||
mergedExclusive.add(andGroups(op.myAnyOfGroup, objects));
|
||||
@@ -290,7 +274,7 @@ public class JsonSchemaVariantsTreeBuilder {
|
||||
|
||||
private static List<JsonSchemaObject> andGroups(@NotNull List<JsonSchemaObject> g1,
|
||||
@NotNull List<JsonSchemaObject> g2) {
|
||||
List<JsonSchemaObject> result = ContainerUtil.newArrayListWithCapacity(g1.size() * g2.size());
|
||||
List<JsonSchemaObject> result = new ArrayList<>(g1.size() * g2.size());
|
||||
for (JsonSchemaObject s: g1) {
|
||||
result.addAll(andGroup(s, g2));
|
||||
}
|
||||
@@ -299,7 +283,7 @@ public class JsonSchemaVariantsTreeBuilder {
|
||||
|
||||
// here is important, which pointer gets the result: lets make them all different, otherwise two schemas of branches of oneOf would be equal
|
||||
private static List<JsonSchemaObject> andGroup(@NotNull JsonSchemaObject object, @NotNull List<JsonSchemaObject> group) {
|
||||
List<JsonSchemaObject> list = ContainerUtil.newArrayListWithCapacity(group.size());
|
||||
List<JsonSchemaObject> list = new ArrayList<>(group.size());
|
||||
for (JsonSchemaObject s: group) {
|
||||
JsonSchemaObject schemaObject = JsonSchemaObject.merge(object, s, s);
|
||||
if (schemaObject.isValidByExclusion()) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// 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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.jetbrains.jsonSchema.extension.JsonLikeSyntaxAdapter;
|
||||
import com.jetbrains.jsonSchema.impl.fixes.AddMissingPropertyFix;
|
||||
import com.jetbrains.jsonSchema.impl.fixes.RemoveProhibitedPropertyFix;
|
||||
@@ -10,6 +9,7 @@ import com.jetbrains.jsonSchema.impl.fixes.SuggestEnumValuesFix;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -71,7 +71,7 @@ public class JsonValidationError {
|
||||
Collection<MissingPropertyIssueData> namesToDisplay = myMissingPropertyIssues;
|
||||
boolean trimmed = false;
|
||||
if (trimIfNeeded && namesToDisplay.size() > 3) {
|
||||
namesToDisplay = ContainerUtil.newArrayList();
|
||||
namesToDisplay = new ArrayList<>();
|
||||
Iterator<MissingPropertyIssueData> iterator = myMissingPropertyIssues.iterator();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
namesToDisplay.add(iterator.next());
|
||||
|
||||
@@ -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-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.jetbrains.jsonSchema.impl;
|
||||
|
||||
import com.intellij.util.Processor;
|
||||
@@ -50,7 +36,7 @@ public class MatchResult {
|
||||
});
|
||||
List<Collection<? extends JsonSchemaObject>> result = oneOfGroups.isEmpty()
|
||||
? ContainerUtil.emptyList()
|
||||
: ContainerUtil.newArrayListWithCapacity(oneOfGroups.keySet().size());
|
||||
: new ArrayList<>(oneOfGroups.keySet().size());
|
||||
for (Map.Entry<Integer, Collection<JsonSchemaObject>> entry: oneOfGroups.entrySet()) {
|
||||
result.add(entry.getValue());
|
||||
}
|
||||
|
||||
@@ -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.jetbrains.jsonSchema.impl.fixes;
|
||||
|
||||
import com.intellij.codeInsight.template.Template;
|
||||
@@ -32,6 +32,7 @@ import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AddMissingPropertyFix implements LocalQuickFix, BatchQuickFix<CommonProblemDescriptor> {
|
||||
@@ -154,7 +155,7 @@ public class AddMissingPropertyFix implements LocalQuickFix, BatchQuickFix<Commo
|
||||
@NotNull CommonProblemDescriptor[] descriptors,
|
||||
@NotNull List<PsiElement> psiElementsToIgnore,
|
||||
@Nullable Runnable refreshViews) {
|
||||
List<Pair<AddMissingPropertyFix, PsiElement>> propFixes = ContainerUtil.newArrayList();
|
||||
List<Pair<AddMissingPropertyFix, PsiElement>> propFixes = new ArrayList<>();
|
||||
for (CommonProblemDescriptor descriptor: descriptors) {
|
||||
if (!(descriptor instanceof ProblemDescriptor)) continue;
|
||||
QuickFix[] fixes = descriptor.getFixes();
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.intellij.openapi.vfs.impl.http.RemoteFileInfo;
|
||||
import com.intellij.openapi.wm.StatusBarWidget;
|
||||
import com.intellij.openapi.wm.impl.status.EditorBasedStatusBarPopup;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.jetbrains.jsonSchema.JsonSchemaCatalogProjectConfiguration;
|
||||
import com.jetbrains.jsonSchema.extension.*;
|
||||
import com.jetbrains.jsonSchema.ide.JsonSchemaService;
|
||||
@@ -35,6 +34,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -119,7 +119,7 @@ class JsonSchemaStatusWidget extends EditorBasedStatusBarPopup {
|
||||
}
|
||||
|
||||
if (schemaFiles.size() != 1) {
|
||||
final List<VirtualFile> userSchemas = ContainerUtil.newArrayList();
|
||||
final List<VirtualFile> userSchemas = new ArrayList<>();
|
||||
if (hasConflicts(userSchemas, file)) {
|
||||
MyWidgetState state = new MyWidgetState(createMessage(schemaFiles, myService,
|
||||
"<br/>", "There are several JSON Schemas mapped to this file:<br/>",
|
||||
|
||||
@@ -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.codeInspection;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
@@ -179,7 +179,7 @@ public class ProblemDescriptorUtil {
|
||||
return ProblemDescriptor.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
List<ProblemDescriptor> problems = ContainerUtil.newArrayListWithCapacity(annotations.size());
|
||||
List<ProblemDescriptor> problems = new ArrayList<>(annotations.size());
|
||||
IdentityHashMap<IntentionAction, LocalQuickFix> quickFixMappingCache = ContainerUtil.newIdentityHashMap();
|
||||
for (Annotation annotation : annotations) {
|
||||
if (annotation.getSeverity() == HighlightSeverity.INFORMATION ||
|
||||
|
||||
+2
-16
@@ -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-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.source.resolve.reference.impl.providers;
|
||||
|
||||
@@ -235,7 +221,7 @@ public class FileReferenceSet {
|
||||
decoded = str;
|
||||
valueRange = TextRange.from(startInElement, decoded.length());
|
||||
}
|
||||
List<FileReference> referencesList = ContainerUtil.newArrayList();
|
||||
List<FileReference> referencesList = new ArrayList<>();
|
||||
|
||||
for (int i = wsHead; i < decoded.length() && Character.isWhitespace(decoded.charAt(i)); i++) {
|
||||
wsHead++; // skip head white spaces
|
||||
|
||||
@@ -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.lang;
|
||||
|
||||
@@ -115,7 +115,7 @@ public final class LanguageUtil {
|
||||
@NotNull
|
||||
public static List<Language> getFileLanguages() {
|
||||
LanguageParserDefinitions.INSTANCE.ensureValuesLoaded();
|
||||
List<Language> result = ContainerUtil.newArrayList();
|
||||
List<Language> result = new ArrayList<>();
|
||||
for (Language language : Language.getRegisteredLanguages()) {
|
||||
if (!isFileLanguage(language)) continue;
|
||||
result.add(language);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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-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;
|
||||
|
||||
import com.intellij.injected.editor.VirtualFileWindow;
|
||||
@@ -29,6 +15,7 @@ import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
@@ -110,7 +97,7 @@ public final class LanguageSubstitutors extends LanguageExtension<LanguageSubsti
|
||||
TransactionGuard.getInstance().submitTransactionLater(ApplicationManager.getApplication(), () -> {
|
||||
REQUESTS_DRAIN_NEEDED.set(true);
|
||||
List<Map.Entry<VirtualFile, SubstitutionInfo>> set = ContainerUtil.newArrayList(ourReparsingRequests.entrySet());
|
||||
List<VirtualFile> files = ContainerUtil.newArrayListWithCapacity(set.size());
|
||||
List<VirtualFile> files = new ArrayList<>(set.size());
|
||||
int id = 1;
|
||||
for (Map.Entry<VirtualFile, SubstitutionInfo> entry : set) {
|
||||
VirtualFile f = entry.getKey();
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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-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;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -22,6 +8,7 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -66,7 +53,7 @@ public class ReferenceProviderType {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
|
||||
Collection<PsiReference> result = ContainerUtil.newArrayList();
|
||||
Collection<PsiReference> result = new ArrayList<>();
|
||||
for (PsiReferenceProvider child : children) {
|
||||
ContainerUtil.addAllNotNull(result, child.getReferencesByElement(element, context));
|
||||
}
|
||||
|
||||
@@ -1193,7 +1193,7 @@ public class PsiTreeUtil {
|
||||
public static List<PsiElement> getInjectedElements(@NotNull OuterLanguageElement outerLanguageElement) {
|
||||
PsiElement psi = outerLanguageElement.getContainingFile().getViewProvider().getPsi(outerLanguageElement.getLanguage());
|
||||
TextRange injectionRange = outerLanguageElement.getTextRange();
|
||||
List<PsiElement> res = ContainerUtil.newArrayList();
|
||||
List<PsiElement> res = new ArrayList<>();
|
||||
|
||||
assert psi != null : outerLanguageElement;
|
||||
for (PsiElement element = psi.findElementAt(injectionRange.getStartOffset());
|
||||
|
||||
+7
-22
@@ -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-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.codeInsight.controlflow;
|
||||
|
||||
import com.intellij.codeInsight.controlflow.impl.ConditionalInstructionImpl;
|
||||
@@ -24,7 +10,6 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -53,8 +38,8 @@ public class ControlFlowBuilder {
|
||||
public int transparentInstructionCount;
|
||||
|
||||
public ControlFlowBuilder() {
|
||||
instructions = ContainerUtil.newArrayList();
|
||||
pending = ContainerUtil.newArrayList();
|
||||
instructions = new ArrayList<>();
|
||||
pending = new ArrayList<>();
|
||||
instructionCount = 0;
|
||||
transparentInstructionCount = 0;
|
||||
}
|
||||
@@ -84,8 +69,8 @@ public class ControlFlowBuilder {
|
||||
@NotNull
|
||||
public final ControlFlow getCompleteControlFlow() {
|
||||
if (transparentInstructionCount == 0) return getControlFlow();
|
||||
|
||||
ArrayList<Instruction> result = ContainerUtil.newArrayListWithCapacity(instructionCount);
|
||||
|
||||
ArrayList<Instruction> result = new ArrayList<>(instructionCount);
|
||||
int processedTransparentInstructions = 0;
|
||||
for (Instruction instruction : instructions) {
|
||||
if (instruction instanceof TransparentInstruction) {
|
||||
@@ -111,7 +96,7 @@ public class ControlFlowBuilder {
|
||||
LOG.error("Control flow graph is inconsistent. Instructions: (" + result.size() + ", " + instructionCount + ")\n" +
|
||||
"Transparent instructions: (" + processedTransparentInstructions + ", " + transparentInstructionCount + ")");
|
||||
}
|
||||
|
||||
|
||||
if (!pending.isEmpty()) {
|
||||
LOG.error("Control flow is used incorrectly. All pending node must be connected to fake exit point. Pending: " + pending);
|
||||
}
|
||||
@@ -246,7 +231,7 @@ public class ControlFlowBuilder {
|
||||
|
||||
/**
|
||||
* Creates transparent instruction for given element, and adds it to the instructions list
|
||||
* Transparent instruction will be replaced in the result control flow by direct connection between predecessors and successors
|
||||
* Transparent instruction will be replaced in the result control flow by direct connection between predecessors and successors
|
||||
*
|
||||
* @param element Element to create instruction for
|
||||
* @param markerName name for debug information
|
||||
|
||||
@@ -1430,7 +1430,7 @@ public class PluginManagerCore {
|
||||
private static IdeaPluginDescriptorImpl[] initializePlugins(@Nullable StartupProgress progress) {
|
||||
configureExtensions();
|
||||
|
||||
List<String> errors = ContainerUtil.newArrayList();
|
||||
List<String> errors = new ArrayList<>();
|
||||
IdeaPluginDescriptorImpl[] pluginDescriptors = loadDescriptors(progress, errors);
|
||||
checkEssentialPluginsAreAvailable(pluginDescriptors);
|
||||
|
||||
|
||||
@@ -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.google.common.annotations.VisibleForTesting;
|
||||
@@ -1058,7 +1058,7 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
|
||||
|
||||
private static class UncommittedInfo {
|
||||
private final FrozenDocument myFrozen;
|
||||
private final List<DocumentEvent> myEvents = ContainerUtil.newArrayList();
|
||||
private final List<DocumentEvent> myEvents = new ArrayList<>();
|
||||
private final ConcurrentMap<DocumentWindow, DocumentWindow> myFrozenWindows = ContainerUtil.newConcurrentMap();
|
||||
|
||||
private UncommittedInfo(@NotNull DocumentImpl original) {
|
||||
|
||||
+2
-17
@@ -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-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.smartPointers;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -26,7 +12,6 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.CommonProcessors;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -242,7 +227,7 @@ class SmartPointerTracker {
|
||||
synchronized List<SelfElementInfo> getSortedInfos() {
|
||||
ensureSorted();
|
||||
|
||||
final List<SelfElementInfo> infos = ContainerUtil.newArrayListWithCapacity(size);
|
||||
final List<SelfElementInfo> infos = new ArrayList<>(size);
|
||||
processAlivePointers(pointer -> {
|
||||
SelfElementInfo info = (SelfElementInfo)pointer.getElementInfo();
|
||||
if (!info.hasRange()) return false;
|
||||
|
||||
@@ -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-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.stubs;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
@@ -30,10 +16,10 @@ import com.intellij.psi.impl.DebugUtil;
|
||||
import com.intellij.psi.impl.source.PsiFileWithStubSupport;
|
||||
import com.intellij.psi.tree.IStubFileElementType;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -157,7 +143,7 @@ public abstract class StubTreeLoader {
|
||||
@NotNull PsiFileWithStubSupport psiFile,
|
||||
VirtualFile file,
|
||||
@Nullable StubTree stubTreeFromIndex) {
|
||||
List<Attachment> attachments = ContainerUtil.newArrayList();
|
||||
List<Attachment> attachments = new ArrayList<>();
|
||||
attachments.add(new Attachment(file.getPath() + "_file.txt", psiFile instanceof PsiCompiledElement ? "compiled" : psiFile.getText()));
|
||||
if (stubTree != null) {
|
||||
attachments.add(new Attachment("stubTree.txt", ((PsiFileStubImpl)stubTree.getRoot()).printTree()));
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ class Jsr223IdeScriptEngineManagerImpl extends IdeScriptEngineManager {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> getFileExtensions(@Nullable String language) {
|
||||
List<String> extensions = ContainerUtil.newArrayList();
|
||||
List<String> extensions = new ArrayList<>();
|
||||
List<ScriptEngineFactory> factories = getScriptEngineManager().getEngineFactories();
|
||||
for (ScriptEngineFactory factory : factories) {
|
||||
if (language == null || factory.getLanguageName().equals(language)) {
|
||||
|
||||
@@ -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.diff.comparison.iterables;
|
||||
|
||||
import com.intellij.diff.comparison.DiffTooBigException;
|
||||
@@ -9,7 +9,6 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.diff.Diff;
|
||||
import com.intellij.util.diff.FilesTooBigForDiffException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -356,7 +355,7 @@ public class DiffIterableUtil {
|
||||
public static <T> List<LineRangeData> extractDataRanges(@NotNull List<? extends T> objects1,
|
||||
@NotNull List<? extends T> objects2,
|
||||
@NotNull DiffIterable iterable) {
|
||||
List<LineRangeData> result = ContainerUtil.newArrayList();
|
||||
List<LineRangeData> result = new ArrayList<>();
|
||||
|
||||
for (Pair<Range, Boolean> pair : iterateAll(iterable)) {
|
||||
Range range = pair.first;
|
||||
|
||||
@@ -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.dvcs.push;
|
||||
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
@@ -12,6 +12,7 @@ import com.intellij.util.xmlb.annotations.XCollection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@State(name = "Push.Settings", storages = {@Storage(StoragePathMacros.WORKSPACE_FILE)})
|
||||
@@ -21,7 +22,7 @@ public class PushSettings implements PersistentStateComponent<PushSettings.State
|
||||
|
||||
public static class State {
|
||||
@XCollection(propertyElementName = "force-push-targets")
|
||||
public List<ForcePushTargetInfo> FORCE_PUSH_TARGETS = ContainerUtil.newArrayList();
|
||||
public List<ForcePushTargetInfo> FORCE_PUSH_TARGETS = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -434,7 +434,7 @@ public class DvcsUtil {
|
||||
}
|
||||
List<VcsFullCommitDetails> commitsInRoot = groupedCommits.get(repository);
|
||||
if (commitsInRoot == null) {
|
||||
commitsInRoot = ContainerUtil.newArrayList();
|
||||
commitsInRoot = new ArrayList<>();
|
||||
groupedCommits.put(repository, commitsInRoot);
|
||||
}
|
||||
commitsInRoot.add(commit);
|
||||
|
||||
@@ -20,10 +20,7 @@ import icons.DvcsImplIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class VcsCherryPickAction extends DumbAwareAction {
|
||||
private static final String NAME = "Cherry-Pick";
|
||||
@@ -88,7 +85,7 @@ public class VcsCherryPickAction extends DumbAwareAction {
|
||||
for (CommitId commit : details) {
|
||||
List<Hash> hashes = result.get(commit.getRoot());
|
||||
if (hashes == null) {
|
||||
hashes = ContainerUtil.newArrayList();
|
||||
hashes = new ArrayList<>();
|
||||
result.put(commit.getRoot(), hashes);
|
||||
}
|
||||
hashes.add(commit.getHash());
|
||||
|
||||
@@ -55,7 +55,7 @@ public class PushController implements Disposable {
|
||||
@NotNull private final PushLog myPushLog;
|
||||
@NotNull private final VcsPushDialog myDialog;
|
||||
@Nullable private final Repository myCurrentlyOpenedRepository;
|
||||
private final List<PrePushHandler> myHandlers = ContainerUtil.newArrayList();
|
||||
private final List<PrePushHandler> myHandlers = new ArrayList<>();
|
||||
private final boolean mySingleRepoProject;
|
||||
private static final int DEFAULT_CHILDREN_PRESENTATION_NUMBER = 20;
|
||||
private final ExecutorService myExecutorService = ConcurrencyUtil.newSingleThreadExecutor("DVCS Push");
|
||||
@@ -499,7 +499,7 @@ public class PushController implements Disposable {
|
||||
|
||||
@NotNull
|
||||
private List<PushInfo> preparePushDetails() {
|
||||
List<PushInfo> allDetails = ContainerUtil.newArrayList();
|
||||
List<PushInfo> allDetails = new ArrayList<>();
|
||||
Collection<MyRepoModel<?, ?, ?>> repoModels = getSelectedRepoNode();
|
||||
|
||||
for (MyRepoModel<?, ?, ?> model : repoModels) {
|
||||
@@ -509,7 +509,7 @@ public class PushController implements Disposable {
|
||||
}
|
||||
PushSpec<PushSource, PushTarget> pushSpec = new PushSpec<>(model.getSource(), target);
|
||||
|
||||
List<VcsFullCommitDetails> loadedCommits = ContainerUtil.newArrayList();
|
||||
List<VcsFullCommitDetails> loadedCommits = new ArrayList<>();
|
||||
loadedCommits.addAll(model.getLoadedCommits());
|
||||
if (loadedCommits.isEmpty()) {
|
||||
//Note: loadCommits is cancellable - it tracks current thread's progress indicator under the hood!
|
||||
|
||||
@@ -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.dvcs.push.ui;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
@@ -344,7 +344,7 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
|
||||
@NotNull
|
||||
private static List<Change> collectChanges(@NotNull List<CommitNode> commitNodes) {
|
||||
List<Change> changes = ContainerUtil.newArrayList();
|
||||
List<Change> changes = new ArrayList<>();
|
||||
for (CommitNode node : commitNodes) {
|
||||
changes.addAll(node.getUserObject().getChanges());
|
||||
}
|
||||
@@ -353,7 +353,7 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
|
||||
@NotNull
|
||||
private static <T> List<T> getChildNodesByType(@NotNull DefaultMutableTreeNode node, Class<T> type, boolean reverseOrder) {
|
||||
List<T> nodes = ContainerUtil.newArrayList();
|
||||
List<T> nodes = new ArrayList<>();
|
||||
if (node.getChildCount() < 1) {
|
||||
return nodes;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
|
||||
@NotNull
|
||||
private static List<Integer> getSortedRows(@NotNull int[] rows) {
|
||||
List<Integer> sorted = ContainerUtil.newArrayList();
|
||||
List<Integer> sorted = new ArrayList<>();
|
||||
for (int row : rows) {
|
||||
sorted.add(row);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
|
||||
@NotNull
|
||||
private List<DefaultMutableTreeNode> getNodesForRows(@NotNull List<Integer> rows) {
|
||||
List<DefaultMutableTreeNode> nodes = ContainerUtil.newArrayList();
|
||||
List<DefaultMutableTreeNode> nodes = new ArrayList<>();
|
||||
for (Integer row : rows) {
|
||||
TreePath path = myTree.getPathForRow(row);
|
||||
Object pathComponent = path == null ? null : path.getLastPathComponent();
|
||||
|
||||
@@ -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.dvcs.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -28,7 +28,6 @@ import com.intellij.ui.popup.WizardPopup;
|
||||
import com.intellij.ui.popup.list.ListPopupImpl;
|
||||
import com.intellij.ui.popup.list.ListPopupModel;
|
||||
import com.intellij.util.FontUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -39,6 +38,7 @@ import javax.swing.*;
|
||||
import javax.swing.plaf.basic.BasicButtonUI;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class BranchActionGroupPopup extends FlatSpeedSearchPopup {
|
||||
@Nullable private MyToolbarButton myRestoreSizeButton;
|
||||
@Nullable private MyToolbarButton mySettingsButton;
|
||||
|
||||
private final List<AnAction> mySettingsActions = ContainerUtil.newArrayList();
|
||||
private final List<AnAction> mySettingsActions = new ArrayList<>();
|
||||
@Nullable private JPanel myTitleToolbarPanel;
|
||||
|
||||
public BranchActionGroupPopup(@NotNull String title,
|
||||
@@ -184,7 +184,7 @@ public class BranchActionGroupPopup extends FlatSpeedSearchPopup {
|
||||
|
||||
@NotNull
|
||||
private List<MoreAction> getMoreActions() {
|
||||
List<MoreAction> result = ContainerUtil.newArrayList();
|
||||
List<MoreAction> result = new ArrayList<>();
|
||||
ListPopupModel model = getListModel();
|
||||
for (int i = 0; i < model.getSize(); i++) {
|
||||
MoreAction moreAction = getSpecificAction(model.getElementAt(i), MoreAction.class);
|
||||
@@ -243,7 +243,7 @@ public class BranchActionGroupPopup extends FlatSpeedSearchPopup {
|
||||
if (parentActionGroup instanceof BranchActionGroup) return Collections.emptyList();
|
||||
|
||||
// add per repository branches into the model as Speed Search elements and show them only if regular items were not found by mask;
|
||||
List<AnAction> speedSearchActions = ContainerUtil.newArrayList();
|
||||
List<AnAction> speedSearchActions = new ArrayList<>();
|
||||
if (!isFirstLevel) speedSearchActions.add(new Separator(parentActionGroup.getTemplatePresentation().getText()));
|
||||
for (AnAction child : parentActionGroup.getChildren(null)) {
|
||||
if (child instanceof ActionGroup) {
|
||||
|
||||
+2
-2
@@ -5,7 +5,6 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.extensions.*;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.junit.After;
|
||||
@@ -13,6 +12,7 @@ import org.junit.Test;
|
||||
import org.picocontainer.PicoContainer;
|
||||
import org.picocontainer.defaults.DefaultPicoContainer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -225,7 +225,7 @@ public class ExtensionPointImplTest {
|
||||
public void testListenerNotifications() {
|
||||
ExtensionPoint<String> extensionPoint = buildExtensionPoint(String.class);
|
||||
|
||||
final List<String> extensions = ContainerUtil.newArrayList();
|
||||
final List<String> extensions = new ArrayList<>();
|
||||
extensionPoint.addExtensionPointListener(new ExtensionPointListener<String>() {
|
||||
@Override
|
||||
public void extensionAdded(@NotNull String extension, @Nullable PluginDescriptor pluginDescriptor) {
|
||||
|
||||
+3
-17
@@ -1,23 +1,9 @@
|
||||
/*
|
||||
* 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-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.openapi.externalSystem.model.project;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -31,7 +17,7 @@ public class ExternalModuleBuildClasspathPojo {
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public ExternalModuleBuildClasspathPojo() {
|
||||
// Used by IJ serialization
|
||||
this("___DUMMY___", ContainerUtil.newArrayList());
|
||||
this("___DUMMY___", new ArrayList<>());
|
||||
}
|
||||
|
||||
public ExternalModuleBuildClasspathPojo(@NotNull String path, @NotNull List<String> entries) {
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// 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.openapi.externalSystem.model.project;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -23,7 +23,7 @@ public class ExternalProjectBuildClasspathPojo {
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public ExternalProjectBuildClasspathPojo() {
|
||||
// Used by IJ serialization
|
||||
this("___DUMMY___", ContainerUtil.newArrayList(), new HashMap<>());
|
||||
this("___DUMMY___", new ArrayList<>(), new HashMap<>());
|
||||
}
|
||||
|
||||
public ExternalProjectBuildClasspathPojo(@NotNull String name,
|
||||
|
||||
+2
-2
@@ -18,9 +18,9 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ public class RefreshAllExternalProjectsAction extends AnAction implements AnActi
|
||||
}
|
||||
|
||||
private static List<ProjectSystemId> getSystemIds(@NotNull AnActionEvent e) {
|
||||
final List<ProjectSystemId> systemIds = ContainerUtil.newArrayList();
|
||||
final List<ProjectSystemId> systemIds = new ArrayList<>();
|
||||
|
||||
final ProjectSystemId externalSystemId = e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID);
|
||||
if (externalSystemId != null) {
|
||||
|
||||
+3
-16
@@ -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-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.openapi.externalSystem.service.execution;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionResultSet;
|
||||
@@ -38,6 +24,7 @@ import icons.ExternalSystemIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -99,7 +86,7 @@ public class TaskCompletionProvider extends CommandLineCompletionProvider {
|
||||
}
|
||||
|
||||
final Collection<DataNode<TaskData>> tasks = ExternalSystemApiUtil.getChildren(moduleDataNode, ProjectKeys.TASK);
|
||||
List<LookupElement> elements = ContainerUtil.newArrayListWithCapacity(tasks.size());
|
||||
List<LookupElement> elements = new ArrayList<>(tasks.size());
|
||||
for (DataNode<TaskData> taskDataNode : tasks) {
|
||||
elements.add(LookupElementBuilder.create(taskDataNode.getData().getName()).withIcon(ExternalSystemIcons.Task));
|
||||
}
|
||||
|
||||
+3
-20
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2013 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-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.openapi.externalSystem.service.internal;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
@@ -37,10 +23,7 @@ import com.intellij.util.keyFMap.KeyFMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
@@ -181,6 +164,6 @@ public class ExternalSystemExecuteTaskTask extends AbstractExternalSystemTask {
|
||||
}
|
||||
|
||||
private static List<String> parseCmdParameters(@Nullable String cmdArgsLine) {
|
||||
return cmdArgsLine != null ? ParametersListUtil.parse(cmdArgsLine, false, true) : ContainerUtil.newArrayList();
|
||||
return cmdArgsLine != null ? ParametersListUtil.parse(cmdArgsLine, false, true) : new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class ExternalSystemProjectsWatcherImpl extends ExternalSystemTaskNotific
|
||||
myRefreshRequestsQueue = new MergingUpdateQueue("ExternalSystemProjectsWatcher: Refresh requests queue",
|
||||
REFRESH_MERGING_TIME_SPAN, false, ANY_COMPONENT, myProject, null, false);
|
||||
|
||||
myImportAwareManagers = ContainerUtil.newArrayList();
|
||||
myImportAwareManagers = new ArrayList<>();
|
||||
for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemApiUtil.getAllManagers()) {
|
||||
if (manager instanceof ExternalSystemAutoImportAware) {
|
||||
myImportAwareManagers.add((ExternalSystemAutoImportAware)manager);
|
||||
|
||||
+1
-1
@@ -287,7 +287,7 @@ public abstract class AbstractModuleDataService<E extends ModuleData> extends Ab
|
||||
project.putUserData(ORPHAN_MODULE_FILES, null);
|
||||
project.putUserData(ORPHAN_MODULE_HANDLERS_COUNTER, null);
|
||||
StringBuilder modulesToRestoreText = new StringBuilder();
|
||||
List<Pair<String, Path>> modulesToRestore = ContainerUtil.newArrayList();
|
||||
List<Pair<String, Path>> modulesToRestore = new ArrayList<>();
|
||||
for (Path modulePath : orphanModules) {
|
||||
try {
|
||||
String path = FileUtil.loadFile(modulePath.resolveSibling(modulePath.getFileName() + ".path").toFile());
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ public class ExternalSystemTaskActivator {
|
||||
() -> ContainerUtil.mapNotNull(context.getCompileScope().getAffectedModules(),
|
||||
module -> ExternalSystemApiUtil.getExternalProjectPath(module)));
|
||||
|
||||
final Collection<Phase> phases = ContainerUtil.newArrayList();
|
||||
final Collection<Phase> phases = new ArrayList<>();
|
||||
if (myBefore) {
|
||||
if(context.isRebuild()) {
|
||||
phases.add(Phase.BEFORE_REBUILD);
|
||||
|
||||
+3
-17
@@ -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-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.openapi.externalSystem.service.task.ui;
|
||||
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
@@ -149,7 +135,7 @@ public class ConfigureTasksActivationDialog extends DialogWrapper {
|
||||
|
||||
if (projectData == null || projectData.getExternalProjectStructure() == null) return;
|
||||
|
||||
final List<ProjectPopupItem> popupItems = ContainerUtil.newArrayList();
|
||||
final List<ProjectPopupItem> popupItems = new ArrayList<>();
|
||||
for (DataNode<ModuleData> moduleDataNode : ExternalSystemApiUtil
|
||||
.findAllRecursively(projectData.getExternalProjectStructure(), ProjectKeys.MODULE)) {
|
||||
if(moduleDataNode.isIgnored()) continue;
|
||||
@@ -269,7 +255,7 @@ public class ConfigureTasksActivationDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private List<String> findSelectedProjects() {
|
||||
List<String> tasks = ContainerUtil.newArrayList();
|
||||
List<String> tasks = new ArrayList<>();
|
||||
for (DefaultMutableTreeNode node : myTree.getSelectedNodes(DefaultMutableTreeNode.class, null)) {
|
||||
if (node.getUserObject() instanceof ProjectNode) {
|
||||
final ProjectNode projectNode = (ProjectNode)node.getUserObject();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user