From 0958cc04e6d70fe5136a4d1d2ada1450c5ca5c6b Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 3 May 2019 16:47:57 +0200 Subject: [PATCH] cleanup - diamonds GitOrigin-RevId: 1c500da1fd340f0951de11096afc3e320e38d3c0 --- .../intellij/compiler/impl/TreeBasedMap.java | 26 ++++------------- .../options/CompilerUIConfigurable.java | 2 +- .../server/DefaultMessageHandler.java | 4 +-- .../codeInsight/daemon/impl/MarkerType.java | 6 ++-- .../arrangement/JavaArrangementParseInfo.java | 2 +- .../arrangement/JavaArrangementVisitor.java | 4 +-- .../JavaElementArrangementEntry.java | 4 +-- .../codeStyle/arrangement/JavaRearranger.java | 14 +++++----- .../codeStyle/javadoc/JDClassComment.java | 2 +- .../codeStyle/javadoc/JDMethodComment.java | 2 +- .../javadoc/JDParamListOwnerComment.java | 2 +- .../intellij/refactoring/util/InlineUtil.java | 26 ++++------------- .../jetbrains/jps/cmdline/BuildSession.java | 28 +++++-------------- .../jetbrains/jps/incremental/FSCache.java | 18 ++---------- .../jps/incremental/IncProjectBuilder.java | 4 +-- .../jps/incremental/fs/BuildFSState.java | 22 +++------------ .../jsonSchema/impl/JsonSchemaObject.java | 2 +- .../markup/TextAttributesEffectsBuilder.java | 2 +- .../util/DefaultCachedValuesFactory.java | 18 ++---------- .../colors/impl/AbstractColorsScheme.java | 2 +- .../colors/impl/FontPreferencesImpl.java | 4 +-- .../externalSystem/model/DataNode.java | 2 +- .../ExternalSystemTaskExecutionSettings.java | 6 ++-- .../model/project/ContentRootData.java | 2 +- .../AbstractExternalSystemLocalSettings.java | 2 +- .../AbstractExternalSystemSettings.java | 6 ++-- .../util/ExternalSystemApiUtil.java | 2 +- .../action/DetachExternalProjectAction.java | 2 +- .../service/ExternalSystemFacadeManager.java | 2 +- ...oteExternalSystemCommunicationManager.java | 2 +- .../ExternalSystemBeforeRunTaskProvider.java | 4 +-- .../ExternalSystemProcessingManager.java | 4 +-- .../manage/AbstractDependencyDataService.java | 4 +-- .../manage/AbstractModuleDataService.java | 2 +- .../manage/ContentRootDataService.java | 2 +- .../project/manage/LibraryDataService.java | 6 ++-- .../manage/LibraryDependencyDataService.java | 10 +++---- .../project/manage/ModuleDataService.java | 2 +- .../manage/ModuleDependencyDataService.java | 2 +- .../manage/ProjectDataManagerImpl.java | 4 +-- .../AbstractExternalSystemConfigurable.java | 4 +-- .../task/ui/ExternalSystemTasksTree.java | 2 +- .../task/ui/ExternalSystemTasksTreeModel.java | 4 +-- .../service/ui/ExternalProjectPathField.java | 2 +- .../util/ExternalSystemUtil.java | 4 +-- .../ExternalSystemViewDefaultContributor.java | 2 +- .../filters/CompositeInputFilter.java | 2 +- .../ByModifierArrangementEntryMatcher.java | 2 +- .../match/ByTypeArrangementEntryMatcher.java | 2 +- .../match/StdArrangementEntryMatcher.java | 2 +- .../CompositeArrangementSettingsToken.java | 2 +- .../arrangement/std/StdArrangementTokens.java | 4 +-- .../color/ArrangementColorsProviderImpl.java | 4 +-- .../AbstractArrangementUiComponent.java | 2 +- ...ArrangementAndMatchConditionComponent.java | 6 ++-- ...rrangementAtomMatchConditionComponent.java | 2 +- .../group/ArrangementGroupingComponent.java | 2 +- .../ArrangementGroupingRulesControl.java | 2 +- .../match/ArrangementMatchingRuleEditor.java | 10 +++---- .../options/colors/ColorAndFontOptions.java | 2 +- .../completion/StatisticsWeigher.java | 2 +- .../impl/LiftShorterItemsClassifier.java | 2 +- .../codeInsight/daemon/impl/IndentsPass.java | 2 +- .../lookup/ComparingClassifier.java | 18 ++---------- .../navigation/DocPreviewUtil.java | 6 ++-- .../ide/util/gotoByName/GotoActionModel.java | 2 +- .../arrangement/engine/ArrangementEngine.java | 16 +++++------ .../statusbar/CodeStyleStatusBarWidget.java | 2 +- .../psi/formatter/common/AbstractBlock.java | 2 +- .../source/codeStyle/CodeFormatterFacade.java | 4 +-- .../FixableUsagesRefactoringProcessor.java | 4 +-- .../com/intellij/ui/AddDeleteListPanel.java | 20 ++----------- .../src/com/intellij/ide/IdeEventQueue.java | 2 +- .../internal/inspector/UiDropperAction.java | 2 +- .../application/ConfigImportHelper.java | 2 +- .../application/ex/DecodeDefaultsUtil.java | 18 ++---------- .../openapi/editor/impl/EditorImpl.java | 4 +-- .../openapi/editor/impl/IndentsModelImpl.java | 4 +-- .../com/intellij/ui/SwingActionDelegate.java | 3 +- .../util/ui/ReloadableComboBoxPanel.java | 4 +-- .../testframework/sm/runner/SMTestProxy.java | 2 +- .../fixtures/FileFixture.java | 20 ++----------- .../fixtures/FrameworksTreeFixture.java | 18 ++---------- .../fixtures/IdeFrameFixture.java | 18 ++---------- .../fixtures/IdeaDialogFixture.java | 20 ++----------- .../fixtures/InputDialogFixture.java | 18 ++---------- .../fixtures/RenameDialogFixture.java | 18 ++---------- .../SelectRefactoringDialogFixture.java | 18 ++---------- .../framework/GuiTestConfiguratorBase.java | 18 ++---------- .../matcher/ClassNameMatcher.java | 20 ++----------- .../util/execution/ParametersListUtil.java | 4 +-- .../intellij/util/ui/KeyboardLayoutUtil.java | 2 +- .../changes/RemoteRevisionsNumbersCache.java | 4 +-- .../conflicts/ChangelistConflictTracker.java | 4 +-- ...meterTypePreventsOverridingInspection.java | 2 +- .../idea/copyright/util/NewFileTracker.java | 18 ++---------- .../ssh/SocksAuthenticatorManager.java | 20 ++----------- .../javacvsImpl/io/ReadThread.java | 4 +-- .../src/git4idea/rebase/GitRebaseProcess.java | 2 +- .../resolve/GradleScriptContributor.java | 2 +- .../plugins/gradle/GradleManager.java | 10 +++---- .../remote/impl/GradleLibraryNamesMixer.java | 4 +-- .../service/GradleInstallationManager.java | 2 +- .../project/GradleProjectResolver.java | 4 +-- .../settings/GradleExecutionSettings.java | 2 +- .../gradle/settings/GradleSettings.java | 2 +- .../plugins/gradle/util/GradleUtil.java | 2 +- .../psi/impl/synthetic/GrLightAnnotation.java | 2 +- .../jps/incremental/groovy/ForkedGroovyc.java | 2 +- .../ConvertParameterToMapEntryIntention.java | 4 +-- .../introduce/GrIntroduceHandlerBase.java | 2 +- .../idea/maven/utils/MavenArtifactUtil.java | 18 ++---------- .../DuplicatePropertyInspection.java | 6 ++-- .../editor/ResourceBundleEditor.java | 2 +- .../org/jetbrains/idea/svn/SvnMapping.java | 2 +- .../idea/svn/integrate/ToBeMergedDialog.java | 2 +- .../treeConflict/MergeFromTheirsResolver.java | 8 +++--- .../tasks/youtrack/YouTrackIntellisense.java | 3 +- .../editors/string/StringEditorDialog.java | 2 +- .../plugins/xsltDebugger/EDTGuard.java | 2 +- .../psi/types/TypeEvalContextBasedCache.java | 18 ++---------- .../util/xml/impl/DomInvocationHandler.java | 18 ++---------- .../model/descriptors/RngNsDescriptor.java | 2 +- .../intellij/xml/util/TagSetRuleProvider.java | 18 ++---------- .../xml/impl/schema/XmlNSDescriptorImpl.java | 18 ++---------- 125 files changed, 240 insertions(+), 588 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/TreeBasedMap.java b/java/compiler/impl/src/com/intellij/compiler/impl/TreeBasedMap.java index 0644a274a70f..a88ef1c76376 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/TreeBasedMap.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/TreeBasedMap.java @@ -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.compiler.impl; import com.intellij.util.containers.EmptyIterator; @@ -28,7 +14,7 @@ import java.util.Stack; * @author Eugene Zhuravlev */ public class TreeBasedMap { - private Node myRoot = new Node(); + private Node myRoot = new Node<>(); private final StringInterner myInterner; private final char mySeparator; private int mySize = 0; @@ -96,10 +82,10 @@ public class TreeBasedMap { @NotNull private Node addChild(final StringInterner table, final String text, final int nameStartIndex, final int nameEndIndex) { if (myChildren == null) { - myChildren = new HashMap>(3, 0.95f); + myChildren = new HashMap<>(3, 0.95f); } - Node newChild = new Node(); + Node newChild = new Node<>(); final String key = table.intern(text.substring(nameStartIndex, nameEndIndex)); myChildren.put(key, newChild); @@ -146,7 +132,7 @@ public class TreeBasedMap { } public void removeAll() { - myRoot = new Node(); + myRoot = new Node<>(); } public Iterator getKeysIterator() { @@ -155,7 +141,7 @@ public class TreeBasedMap { private class KeysIterator implements Iterator { - private final Stack> myCurrentNodePath = new Stack>(); + private final Stack> myCurrentNodePath = new Stack<>(); private final StringBuilder myCurrentName = new StringBuilder(); KeysIterator() { diff --git a/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java b/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java index 31c17a2e358d..635858c38426 100644 --- a/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java +++ b/java/compiler/impl/src/com/intellij/compiler/options/CompilerUIConfigurable.java @@ -129,7 +129,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura } } - Map> controls = new HashMap>(); + Map> controls = new HashMap<>(); controls.put(Setting.RESOURCE_PATTERNS, ContainerUtilRt.newArrayList(myResourcePatternsLabel, myResourcePatternsField, myPatternLegendLabel)); controls.put(Setting.CLEAR_OUTPUT_DIR_ON_REBUILD, Collections.singleton(myCbClearOutputDirectory)); controls.put(Setting.ADD_NOT_NULL_ASSERTIONS, Collections.singleton(myAssertNotNullPanel)); diff --git a/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java b/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java index 428568c57aed..0dd5ef40f822 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/DefaultMessageHandler.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.compiler.server; import com.intellij.ide.highlighter.JavaFileType; @@ -91,7 +91,7 @@ public abstract class DefaultMessageHandler implements BuilderMessageHandler { final boolean isRemoved = task.getIsFieldRemoved(); boolean canceled = false; final Ref isSuccess = Ref.create(Boolean.TRUE); - final Set affectedPaths = Collections.synchronizedSet(new HashSet()); // PsiSearchHelper runs multiple threads + final Set affectedPaths = Collections.synchronizedSet(new HashSet<>()); // PsiSearchHelper runs multiple threads final long searchStart = System.currentTimeMillis(); try { if (myConstantSearchTime > CONSTANT_SEARCH_TIME_LIMIT) { diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java index 301039db9dac..5dcda32de07f 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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. /* * @author max @@ -147,8 +147,8 @@ public class MarkerType { @NotNull private static PsiElementProcessor.CollectElementsWithLimit getProcessor(int limit, boolean set) { - return set ? new PsiElementProcessor.CollectElementsWithLimit(limit, new THashSet()) - : new PsiElementProcessor.CollectElementsWithLimit(limit); + return set ? new PsiElementProcessor.CollectElementsWithLimit<>(limit, new THashSet<>()) + : new PsiElementProcessor.CollectElementsWithLimit<>(limit); } private static String getFunctionalImplementationTooltip(@NotNull PsiClass psiClass) { diff --git a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementParseInfo.java b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementParseInfo.java index 45ae95826429..17bb2d2f3182 100644 --- a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementParseInfo.java +++ b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementParseInfo.java @@ -80,7 +80,7 @@ public class JavaArrangementParseInfo { Stack> toProcess = new Stack<>(); toProcess.push(Pair.create(method, result)); - Set usedMethods = new HashSet(); + Set usedMethods = new HashSet<>(); while (!toProcess.isEmpty()) { Pair pair = toProcess.pop(); Set dependentMethods = myMethodDependencies.get(pair.first); diff --git a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementVisitor.java b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementVisitor.java index 4d9ce0ccebc3..5791d12d992e 100644 --- a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementVisitor.java +++ b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaArrangementVisitor.java @@ -27,7 +27,7 @@ public class JavaArrangementVisitor extends JavaRecursiveElementVisitor { private static final String NULL_CONTENT = "no content"; - private static final Map MODIFIERS = new HashMap(); + private static final Map MODIFIERS = new HashMap<>(); static { MODIFIERS.put(PsiModifier.PUBLIC, PUBLIC); @@ -89,7 +89,7 @@ public class JavaArrangementVisitor extends JavaRecursiveElementVisitor { @NotNull private static Set getGroupingRules(@NotNull ArrangementSettings settings) { - Set groupingRules = new HashSet(); + Set groupingRules = new HashSet<>(); for (ArrangementGroupingRule rule : settings.getGroupings()) { groupingRules.add(rule.getGroupingType()); } diff --git a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaElementArrangementEntry.java b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaElementArrangementEntry.java index cec01392644c..1b5159bcf7bf 100644 --- a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaElementArrangementEntry.java +++ b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaElementArrangementEntry.java @@ -19,8 +19,8 @@ public class JavaElementArrangementEntry extends DefaultArrangementEntry implements TypeAwareArrangementEntry, NameAwareArrangementEntry,ModifierAwareArrangementEntry { - @NotNull private final Set myModifiers = new HashSet(); - @NotNull private final Set myTypes = new HashSet(); + @NotNull private final Set myModifiers = new HashSet<>(); + @NotNull private final Set myTypes = new HashSet<>(); @NotNull private final ArrangementSettingsToken myType; @Nullable private final String myName; diff --git a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaRearranger.java b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaRearranger.java index 8a83b8300a2d..29a9a17be8f8 100644 --- a/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaRearranger.java +++ b/java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaRearranger.java @@ -61,9 +61,9 @@ public class JavaRearranger implements Rearranger, new ArrangementSettingsToken("NO_TYPE", "NO_TYPE"); @NotNull private static final Map> MODIFIERS_BY_TYPE = - new HashMap>(); + new HashMap<>(); @NotNull private static final Collection> MUTEXES = - new ArrayList>(); + new ArrayList<>(); private static final Set TYPES_WITH_DISABLED_ORDER = new HashSet<>(); private static final Set TYPES_WITH_DISABLED_NAME_MATCH = new HashSet<>(); @@ -82,9 +82,9 @@ public class JavaRearranger implements Rearranger, MODIFIERS_BY_TYPE.put(METHOD, concat(commonModifiers, SYNCHRONIZED, ABSTRACT)); MODIFIERS_BY_TYPE.put(CONSTRUCTOR, concat(commonModifiers, SYNCHRONIZED)); MODIFIERS_BY_TYPE.put(FIELD, concat(commonModifiers, TRANSIENT, VOLATILE)); - MODIFIERS_BY_TYPE.put(GETTER, new HashSet()); - MODIFIERS_BY_TYPE.put(SETTER, new HashSet()); - MODIFIERS_BY_TYPE.put(OVERRIDDEN, new HashSet()); + MODIFIERS_BY_TYPE.put(GETTER, new HashSet<>()); + MODIFIERS_BY_TYPE.put(SETTER, new HashSet<>()); + MODIFIERS_BY_TYPE.put(OVERRIDDEN, new HashSet<>()); MODIFIERS_BY_TYPE.put(INIT_BLOCK, ContainerUtilRt.newHashSet(STATIC)); TYPES_WITH_DISABLED_ORDER.add(INIT_BLOCK); @@ -116,7 +116,7 @@ public class JavaRearranger implements Rearranger, static { List groupingRules = ContainerUtilRt.newArrayList(new ArrangementGroupingRule(GETTERS_AND_SETTERS)); - List matchRules = new ArrayList(); + List matchRules = new ArrayList<>(); ArrangementSettingsToken[] visibility = {PUBLIC, PROTECTED, PACKAGE_PRIVATE, PRIVATE}; for (ArrangementSettingsToken modifier : visibility) { and(matchRules, FIELD, STATIC, FINAL, modifier); @@ -142,7 +142,7 @@ public class JavaRearranger implements Rearranger, and(matchRules, CLASS, STATIC); and(matchRules, CLASS); - List aliasTokens = new ArrayList(); + List aliasTokens = new ArrayList<>(); aliasTokens.add(VISIBILITY); DEFAULT_SETTINGS = StdArrangementExtendableSettings.createByMatchRules(groupingRules, matchRules, aliasTokens); } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDClassComment.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDClassComment.java index 4cc24adda520..e7091f0159ee 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDClassComment.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDClassComment.java @@ -42,7 +42,7 @@ public class JDClassComment extends JDParamListOwnerComment { public void addAuthor(@NotNull String author) { if (myAuthorsList == null) { - myAuthorsList = new ArrayList(); + myAuthorsList = new ArrayList<>(); } myAuthorsList.add(author); } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDMethodComment.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDMethodComment.java index 6afe17a6dbf6..4db4d64d5662 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDMethodComment.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDMethodComment.java @@ -54,7 +54,7 @@ public class JDMethodComment extends JDParamListOwnerComment { public void addThrow(@NotNull String className, @Nullable String description) { if (myThrowsList == null) { - myThrowsList = new ArrayList(); + myThrowsList = new ArrayList<>(); } myThrowsList.add(new TagDescription(className, description)); } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParamListOwnerComment.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParamListOwnerComment.java index a1edc84e47e9..b617f9325777 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParamListOwnerComment.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/javadoc/JDParamListOwnerComment.java @@ -41,7 +41,7 @@ public class JDParamListOwnerComment extends JDComment { public void addParameter(@NotNull String name, @Nullable String description) { if (myParamsList == null) { - myParamsList = new ArrayList(); + myParamsList = new ArrayList<>(); } myParamsList.add(new TagDescription(name, description)); } diff --git a/java/java-impl/src/com/intellij/refactoring/util/InlineUtil.java b/java/java-impl/src/com/intellij/refactoring/util/InlineUtil.java index bb9a14607a17..960adac49045 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/InlineUtil.java +++ b/java/java-impl/src/com/intellij/refactoring/util/InlineUtil.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.util; import com.intellij.codeInsight.BlockUtils; @@ -309,7 +295,7 @@ public class InlineUtil { } public static boolean allUsagesAreTailCalls(final PsiMethod method) { - final List nonTailCallUsages = Collections.synchronizedList(new ArrayList()); + final List nonTailCallUsages = Collections.synchronizedList(new ArrayList<>()); boolean result = ProgressManager.getInstance().runProcessWithProgressSynchronously( (Runnable)() -> ReferencesSearch.search(method).forEach(psiReference -> { ProgressManager.checkCanceled(); @@ -522,7 +508,7 @@ public class InlineUtil { /** * Extracts side effects from return statements, replacing them with simple {@code return;} or {@code continue;} * while preserving semantics. - * + * * @param method method to process * @param replaceWithContinue if true, returns will be replaced with {@code continue}. */ @@ -553,11 +539,11 @@ public class InlineUtil { } public enum TailCallType { - None(null), + None(null), Simple((methodCopy, callSite, returnType) -> { extractReturnValues(methodCopy, false); return null; - }), + }), Continue((methodCopy, callSite, returnType) -> { extractReturnValues(methodCopy, true); return null; @@ -573,7 +559,7 @@ public class InlineUtil { return null; }), Return((methodCopy, callSite, returnType) -> null); - + @Nullable private final InlineTransformer myTransformer; diff --git a/jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java b/jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java index 59da8d8a4127..573830d9784c 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java +++ b/jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.cmdline; import com.intellij.openapi.diagnostic.Logger; @@ -55,10 +41,10 @@ final class BuildSession implements Runnable, CanceledStatus { private static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.cmdline.BuildSession"); public static final String FS_STATE_FILE = "fs_state.dat"; private static final Boolean REPORT_BUILD_STATISTICS = Boolean.valueOf(System.getProperty(GlobalOptions.REPORT_BUILD_STATISTICS, "false")); - + private final UUID mySessionId; private final Channel myChannel; - @Nullable + @Nullable private final PreloadedData myPreloadedData; private volatile boolean myCanceled; private final String myProjectPath; @@ -68,7 +54,7 @@ final class BuildSession implements Runnable, CanceledStatus { private final EventsProcessor myEventsProcessor = new EventsProcessor(); private volatile long myLastEventOrdinal; private volatile ProjectDescriptor myProjectDescriptor; - private final Map, ConstantSearchFuture> mySearchTasks = Collections.synchronizedMap(new HashMap, ConstantSearchFuture>()); + private final Map, ConstantSearchFuture> mySearchTasks = Collections.synchronizedMap(new HashMap<>()); private final ConstantSearch myConstantSearch = new ConstantSearch(); @NotNull private final BuildRunner myBuildRunner; @@ -215,7 +201,7 @@ final class BuildSession implements Runnable, CanceledStatus { myBuildRunner.setForceCleanCaches(true); } final ProjectDescriptor preloadedProject = myPreloadedData != null? myPreloadedData.getProjectDescriptor() : null; - final DataInputStream fsStateStream = + final DataInputStream fsStateStream = storageFilesAbsent || preloadedProject != null || myLoadUnloadedModules || myInitialFSDelta == null /*this will force FS rescan*/? null : createFSDataStream(dataStorageRoot, myInitialFSDelta.getOrdinal()); if (fsStateStream != null || myPreloadedData != null) { @@ -261,7 +247,7 @@ final class BuildSession implements Runnable, CanceledStatus { } if (myInitialFSDelta == null || myPreloadedData.getFsEventOrdinal() + 1L != myInitialFSDelta.getOrdinal()) { // FS rescan was forced - fsState.clearAll(); + fsState.clearAll(); } else { // apply events to already loaded state @@ -291,7 +277,7 @@ final class BuildSession implements Runnable, CanceledStatus { } } myProjectDescriptor = pd; - + myLastEventOrdinal = myInitialFSDelta != null? myInitialFSDelta.getOrdinal() : 0L; // free memory diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/FSCache.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/FSCache.java index d4eb5ffda54c..9b9a7736725f 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/FSCache.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/FSCache.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.incremental; import gnu.trove.THashMap; @@ -37,7 +23,7 @@ public class FSCache { private static final File[] NULL_VALUE = new File[0]; private static final File[] EMPTY_FILE_ARRAY = new File[0]; - private final Map myMap = Collections.synchronizedMap(new THashMap()); + private final Map myMap = Collections.synchronizedMap(new THashMap<>()); @Nullable public File[] getChildren(File file) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java index 5c5420b64bed..30db924c8dc7 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/IncProjectBuilder.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.incremental; import com.intellij.openapi.diagnostic.Logger; @@ -103,7 +103,7 @@ public class IncProjectBuilder { private final boolean myIsTestMode; private final int myTotalModuleLevelBuilderCount; - private final List myAsyncTasks = Collections.synchronizedList(new ArrayList()); + private final List myAsyncTasks = Collections.synchronizedList(new ArrayList<>()); private final ConcurrentMap myElapsedTimeNanosByBuilder = ContainerUtil.newConcurrentMap(); private final ConcurrentMap myNumberOfSourcesProcessedByBuilder = ContainerUtil.newConcurrentMap(); diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/fs/BuildFSState.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/fs/BuildFSState.java index 4b0c506f6c87..079cc1fb3385 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/fs/BuildFSState.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/fs/BuildFSState.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.incremental.fs; import com.intellij.openapi.diagnostic.Logger; @@ -50,9 +36,9 @@ public class BuildFSState { // when true, will always determine dirty files by scanning FS and comparing timestamps // alternatively, when false, after first scan will rely on external notifications about changes private final boolean myAlwaysScanFS; - private final Set> myInitialScanPerformed = Collections.synchronizedSet(new HashSet>()); + private final Set> myInitialScanPerformed = Collections.synchronizedSet(new HashSet<>()); private final TObjectLongHashMap myRegistrationStamps = new TObjectLongHashMap<>(FileUtil.FILE_HASHING_STRATEGY); - private final Map, FilesDelta> myDeltas = Collections.synchronizedMap(new HashMap, FilesDelta>()); + private final Map, FilesDelta> myDeltas = Collections.synchronizedMap(new HashMap<>()); public BuildFSState(boolean alwaysScanFS) { myAlwaysScanFS = alwaysScanFS; @@ -239,7 +225,7 @@ public class BuildFSState { if (delta == null) { delta = getDelta(rd.getTarget()); } - + return delta.isMarkedRecompile(rd, file); } diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaObject.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaObject.java index 81181b19af6a..f379cd15db55 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaObject.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaObject.java @@ -370,7 +370,7 @@ public class JsonSchemaObject { @Nullable private static Map copyMap(@Nullable Map target, @Nullable Map source) { if (source == null || source.isEmpty()) return target; - if (target == null) target = new HashMap(source.size()); + if (target == null) target = new HashMap<>(source.size()); target.putAll(source); return target; } diff --git a/platform/core-api/src/com/intellij/openapi/editor/markup/TextAttributesEffectsBuilder.java b/platform/core-api/src/com/intellij/openapi/editor/markup/TextAttributesEffectsBuilder.java index 588de94084fa..c5a0748548d8 100644 --- a/platform/core-api/src/com/intellij/openapi/editor/markup/TextAttributesEffectsBuilder.java +++ b/platform/core-api/src/com/intellij/openapi/editor/markup/TextAttributesEffectsBuilder.java @@ -35,7 +35,7 @@ public class TextAttributesEffectsBuilder { .put(BOLD_DOTTED_LINE, UNDERLINE_SLOT) .build(); - private final Map myEffectsMap = new HashMap(EffectSlot.values().length); + private final Map myEffectsMap = new HashMap<>(EffectSlot.values().length); private TextAttributesEffectsBuilder() {} diff --git a/platform/core-impl/src/com/intellij/util/DefaultCachedValuesFactory.java b/platform/core-impl/src/com/intellij/util/DefaultCachedValuesFactory.java index db62812a340f..52e2c654859f 100644 --- a/platform/core-impl/src/com/intellij/util/DefaultCachedValuesFactory.java +++ b/platform/core-impl/src/com/intellij/util/DefaultCachedValuesFactory.java @@ -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.util; import com.intellij.psi.util.ParameterizedCachedValueProvider; @@ -47,6 +33,6 @@ public class DefaultCachedValuesFactory implements CachedValuesFactory { @Override public ParameterizedCachedValue createParameterizedCachedValue(@NotNull ParameterizedCachedValueProvider provider, boolean trackValue) { - return new ParameterizedCachedValueImpl(myProject, provider, trackValue); + return new ParameterizedCachedValueImpl<>(myProject, provider, trackValue); } } diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java index 0837c7bd8cc3..bf324c33dcf2 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java @@ -64,7 +64,7 @@ public abstract class AbstractColorsScheme extends EditorFontCacheImpl implement // version influences XML format and triggers migration private int myVersion = CURR_VERSION; - Map myColorsMap = new HashMap(); + Map myColorsMap = new HashMap<>(); Map myAttributesMap = new THashMap<>(); @NonNls private static final String EDITOR_FONT = "font"; diff --git a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/FontPreferencesImpl.java b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/FontPreferencesImpl.java index 85f41ef4ba79..48852400e2eb 100644 --- a/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/FontPreferencesImpl.java +++ b/platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/FontPreferencesImpl.java @@ -24,8 +24,8 @@ import java.util.List; public class FontPreferencesImpl extends ModifiableFontPreferences { @NotNull private final TObjectIntHashMap myFontSizes = new TObjectIntHashMap<>(); - @NotNull private final List myEffectiveFontFamilies = new ArrayList(); - @NotNull private final List myRealFontFamilies = new ArrayList(); + @NotNull private final List myEffectiveFontFamilies = new ArrayList<>(); + @NotNull private final List myRealFontFamilies = new ArrayList<>(); private boolean myUseLigatures; private float myLineSpacing = DEFAULT_LINE_SPACING; diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java index 9b35e6a6c3ff..2fce330b25f8 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java @@ -30,7 +30,7 @@ public class DataNode implements Serializable, UserDataHolderEx { private static final long serialVersionUID = 1L; private static final Logger LOG = Logger.getInstance(DataNode.class); - @NotNull private final List> myChildren = new ArrayList>(); + @NotNull private final List> myChildren = new ArrayList<>(); @NotNull private transient List> myChildrenView = Collections.unmodifiableList(myChildren); @NotNull private transient UserDataHolderBase myUserData = new UserDataHolderBase(); diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java index f11458db7f9a..4834c35da0a5 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java @@ -25,9 +25,9 @@ public class ExternalSystemTaskExecutionSettings implements Cloneable { @NotNull @NonNls public static final Key JVM_AGENT_SETUP_KEY = Key.create("jvmAgentSetup"); @NotNull - private List myTaskNames = new ArrayList(); + private List myTaskNames = new ArrayList<>(); @NotNull - private List myTaskDescriptions = new ArrayList(); + private List myTaskDescriptions = new ArrayList<>(); @Nullable private String myExecutionName; private String myExternalSystemIdString; @@ -35,7 +35,7 @@ public class ExternalSystemTaskExecutionSettings implements Cloneable { private String myVmOptions; private String myScriptParameters; @NotNull - private Map myEnv = new HashMap(); + private Map myEnv = new HashMap<>(); private boolean myPassParentEnvs = true; public ExternalSystemTaskExecutionSettings() { diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ContentRootData.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ContentRootData.java index 6f5f83e72992..5ef01aa4ceeb 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ContentRootData.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ContentRootData.java @@ -20,7 +20,7 @@ public class ContentRootData extends AbstractExternalEntityData { private static final long serialVersionUID = 1L; @NotNull private final Map> myData = - new HashMap>(); + new HashMap<>(); @NotNull private final String myRootPath; diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemLocalSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemLocalSettings.java index f14240c96478..832d3dff40d0 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemLocalSettings.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemLocalSettings.java @@ -151,7 +151,7 @@ public abstract class AbstractExternalSystemLocalSettings manager = getManager(myExternalSystemId); assert manager != null; - Set pathsToForget = new HashSet(); + Set pathsToForget = new HashSet<>(); for (ExternalProjectPojo pojo : state.availableProjects.keySet()) { pathsToForget.add(pojo.getPath()); } diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java index 82ceb3b57300..b0e781799eac 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/settings/AbstractExternalSystemSettings.java @@ -38,7 +38,7 @@ public abstract class AbstractExternalSystemSettings< @NotNull private final Topic myChangesTopic; private Supplier myProjectSupplier; - @NotNull private final Map myLinkedProjectsSettings = new HashMap(); + @NotNull private final Map myLinkedProjectsSettings = new HashMap<>(); @NotNull private final Map myLinkedProjectsSettingsView = Collections.unmodifiableMap(myLinkedProjectsSettings); @@ -142,8 +142,8 @@ public abstract class AbstractExternalSystemSettings< // do not add invalid 'null' settings settings = ContainerUtil.filter(settings, ps -> ps.getExternalProjectPath() != null); - List added = new ArrayList(); - Map removed = new HashMap(myLinkedProjectsSettings); + List added = new ArrayList<>(); + Map removed = new HashMap<>(myLinkedProjectsSettings); myLinkedProjectsSettings.clear(); for (PS current : settings) { myLinkedProjectsSettings.put(current.getExternalProjectPath(), current); diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java index 8d4e170c0aae..e7b14170c927 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java @@ -223,7 +223,7 @@ public class ExternalSystemApiUtil { continue; } if (result == null) { - result = new ArrayList>(); + result = new ArrayList<>(); } result.add((DataNode)child); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java index 26f6c98469cf..4efef6e46cb9 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java @@ -71,7 +71,7 @@ public class DetachExternalProjectAction extends ExternalSystemNodeAction orphanModules = new ArrayList(); + List orphanModules = new ArrayList<>(); for (Module module : ModuleManager.getInstance(project).getModules()) { if (!ExternalSystemApiUtil.isExternalSystemAwareModule(projectSystemId, module)) continue; diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java index 00426f73ddcf..4e821ad154e0 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java @@ -229,7 +229,7 @@ public class ExternalSystemFacadeManager { public boolean isTaskActive(@NotNull ExternalSystemTaskId id) { Map> copy - = new HashMap>(myRemoteFacades); + = new HashMap<>(myRemoteFacades); for (Map.Entry> entry : copy.entrySet()) { try { if (entry.getValue().first.isTaskInProgress(id)) { diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/RemoteExternalSystemCommunicationManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/RemoteExternalSystemCommunicationManager.java index 92bc98e38713..57f16b94428d 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/RemoteExternalSystemCommunicationManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/RemoteExternalSystemCommunicationManager.java @@ -115,7 +115,7 @@ public class RemoteExternalSystemCommunicationManager implements ExternalSystemC File myWorkingDirectory = new File(configuration); params.setWorkingDirectory(myWorkingDirectory.isDirectory() ? myWorkingDirectory.getPath() : PathManager.getBinPath()); - final List classPath = new ArrayList(); + final List classPath = new ArrayList<>(); // IDE jars. classPath.addAll(PathManager.getUtilClassPath()); diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemBeforeRunTaskProvider.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemBeforeRunTaskProvider.java index 8554dbe418bb..3b570a871250 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemBeforeRunTaskProvider.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemBeforeRunTaskProvider.java @@ -72,7 +72,7 @@ public abstract class ExternalSystemBeforeRunTaskProvider extends BeforeRunTaskP public boolean canExecuteTask(@NotNull RunConfiguration configuration, @NotNull ExternalSystemBeforeRunTask beforeRunTask) { final ExternalSystemTaskExecutionSettings executionSettings = beforeRunTask.getTaskExecutionSettings(); - final List tasks = new ArrayList(); + final List tasks = new ArrayList<>(); for (String taskName : executionSettings.getTaskNames()) { tasks.add(new ExternalTaskPojo(taskName, executionSettings.getExternalProjectPath(), null)); } @@ -94,7 +94,7 @@ public abstract class ExternalSystemBeforeRunTaskProvider extends BeforeRunTaskP final ExternalSystemTaskExecutionSettings executionSettings = beforeRunTask.getTaskExecutionSettings(); - final List tasks = new ArrayList(); + final List tasks = new ArrayList<>(); for (String taskName : executionSettings.getTaskNames()) { tasks.add(new ExternalTaskPojo(taskName, executionSettings.getExternalProjectPath(), null)); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java index 4afc0d8115f1..a23f3c0cbbe0 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java @@ -183,9 +183,9 @@ public class ExternalSystemProcessingManager implements ExternalSystemTaskNotifi public void update() { long delay = TOO_LONG_EXECUTION_MS; - Map newState = new HashMap(); + Map newState = new HashMap<>(); - Map currentState = new HashMap(myTasksInProgress); + Map currentState = new HashMap<>(myTasksInProgress); if (currentState.isEmpty()) { return; } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java index 3ceb0083eec2..536c6151202f 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java @@ -143,11 +143,11 @@ public abstract class AbstractDependencyDataService> groupByModule(@NotNull Collection data) { - Map> result = new HashMap>(); + Map> result = new HashMap<>(); for (ExportableOrderEntry entry : data) { Collection entries = result.get(entry.getOwnerModule()); if (entries == null) { - result.put(entry.getOwnerModule(), entries = new ArrayList()); + result.put(entry.getOwnerModule(), entries = new ArrayList<>()); } entries.add(entry); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java index 1da15c6dc66c..a1deee1f7257 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractModuleDataService.java @@ -155,7 +155,7 @@ public abstract class AbstractModuleDataService extends Ab @NotNull private Collection> filterExistingModules(@NotNull Collection> modules, @NotNull IdeModifiableModelsProvider modelsProvider) { - Collection> result = new ArrayList>(); + Collection> result = new ArrayList<>(); for (DataNode node : modules) { ModuleData moduleData = node.getData(); Module module = modelsProvider.findIdeModule(moduleData); diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ContentRootDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ContentRootDataService.java index ca2b4bdeb9e5..5474005af1f6 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ContentRootDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ContentRootDataService.java @@ -135,7 +135,7 @@ public class ContentRootDataService extends AbstractProjectDataService contentEntriesMap = new HashMap(); + final Map contentEntriesMap = new HashMap<>(); for (ContentEntry contentEntry : contentEntries) { contentEntriesMap.put(contentEntry.getUrl(), contentEntry); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDataService.java index c8a55a070ec5..82c7c7c96a2b 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDataService.java @@ -91,7 +91,7 @@ public final class LibraryDataService extends AbstractProjectDataService> prepareLibraryFiles(@NotNull LibraryData data) { - Map> result = new HashMap>(); + Map> result = new HashMap<>(); for (LibraryPathType pathType: LibraryPathType.values()) { Set paths = data.getPaths(pathType); if (paths.isEmpty()) { @@ -233,7 +233,7 @@ public final class LibraryDataService extends AbstractProjectDataService toRemovePerType = new HashSet(); + HashSet toRemovePerType = new HashSet<>(); toRemove.put(ideType, toRemovePerType); for (VirtualFile ideFile: ideLibrary.getFiles(ideType)) { @@ -255,7 +255,7 @@ public final class LibraryDataService extends AbstractProjectDataService> entry: toAdd.entrySet()) { - Map> roots = new HashMap>(); + Map> roots = new HashMap<>(); roots.put(entry.getKey(), ContainerUtil.map(entry.getValue(), PATH_TO_FILE)); registerPaths(externalLibrary.isUnresolved(), roots, libraryModel, externalLibrary.getInternalName()); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDependencyDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDependencyDataService.java index 8ab5af678c33..42e25b83a8da 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDependencyDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDependencyDataService.java @@ -52,10 +52,10 @@ public class LibraryDependencyDataService extends AbstractDependencyDataService< // The trick is that we should perform module settings modification inside try/finally block against target root model. // That means that we need to prepare all necessary data, obtain a model and modify it as necessary. final Map/* library paths */, LibraryDependencyData> moduleLibrariesToImport = - new HashMap, LibraryDependencyData>(); + new HashMap<>(); final Map projectLibrariesToImport = - new HashMap(); - final Set toImport = new LinkedHashSet(); + new HashMap<>(); + final Set toImport = new LinkedHashSet<>(); final Map orderEntryDataMap = new LinkedHashMap<>(); boolean hasUnresolved = false; @@ -65,7 +65,7 @@ public class LibraryDependencyDataService extends AbstractDependencyDataService< hasUnresolved |= libraryData.isUnresolved(); switch (dependencyData.getLevel()) { case MODULE: - Set paths = new HashSet(); + Set paths = new HashSet<>(); for (String path : libraryData.getPaths(LibraryPathType.BINARY)) { paths.add(ExternalSystemApiUtil.toCanonicalPath(path) + dependencyData.getScope().name()); } @@ -161,7 +161,7 @@ public class LibraryDependencyDataService extends AbstractDependencyDataService< ModuleLibraryOrderEntryImpl moduleLibraryOrderEntry = (ModuleLibraryOrderEntryImpl)entry; Library library = moduleLibraryOrderEntry.getLibrary(); final VirtualFile[] libraryFiles = library.getFiles(OrderRootType.CLASSES); - final Set moduleLibraryKey = new HashSet(libraryFiles.length); + final Set moduleLibraryKey = new HashSet<>(libraryFiles.length); for (VirtualFile file : libraryFiles) { moduleLibraryKey.add(ExternalSystemApiUtil.getLocalFileSystemPath(file) + moduleLibraryOrderEntry.getScope().name()); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDataService.java index b5f81b87532c..637163ff8bda 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDataService.java @@ -110,7 +110,7 @@ public class ModuleDataService extends AbstractModuleDataService { } } - Set result = new HashSet(); + Set result = new HashSet<>(); for (Map.Entry> entry : oldInfo.entrySet()) { String newName = map.get(entry.getKey().getPath()); if (newName != null && !newName.equals(entry.getKey().getName())) { diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDependencyDataService.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDependencyDataService.java index 76306cb8bf0c..05e70ff45d28 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDependencyDataService.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDependencyDataService.java @@ -57,7 +57,7 @@ public class ModuleDependencyDataService extends AbstractDependencyDataService, ModuleOrderEntry> toRemove = - new HashMap, ModuleOrderEntry>(); + new HashMap<>(); final Map orderEntryDataMap = new LinkedHashMap<>(); for (OrderEntry entry : modelsProvider.getOrderEntries(module)) { diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataManagerImpl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataManagerImpl.java index ed5c74bbf919..2d669f67276e 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataManagerImpl.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataManagerImpl.java @@ -63,11 +63,11 @@ public class ProjectDataManagerImpl implements ProjectDataManager { @NotNull @Override protected Map, List>> compute() { - Map, List>> result = new HashMap, List>>(); + Map, List>> result = new HashMap<>(); for (ProjectDataService service : supplier.get()) { List> services = result.get(service.getTargetDataKey()); if (services == null) { - result.put(service.getTargetDataKey(), services = new ArrayList>()); + result.put(service.getTargetDataKey(), services = new ArrayList<>()); } services.add(service); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalSystemConfigurable.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalSystemConfigurable.java index c80bb44e110d..d8eb74a62ba0 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalSystemConfigurable.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalSystemConfigurable.java @@ -56,7 +56,7 @@ public abstract class AbstractExternalSystemConfigurable< { @NotNull private final List> myProjectSettingsControls = - new ArrayList>(); + new ArrayList<>(); @NotNull private final ProjectSystemId myExternalSystemId; @NotNull private final Project myProject; @@ -218,7 +218,7 @@ public abstract class AbstractExternalSystemConfigurable< L publisher = systemSettings.getPublisher(); publisher.onBulkChangeStart(); try { - List projectSettings = new ArrayList(); + List projectSettings = new ArrayList<>(); for (ExternalSystemSettingsControl control : myProjectSettingsControls) { ProjectSettings s = newProjectSettings(); control.apply(s); diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTree.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTree.java index 76e45032a0b7..94394b92b489 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTree.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTree.java @@ -36,7 +36,7 @@ public class ExternalSystemTasksTree extends Tree implements Supplier myPathsToProcessCollapseState = new HashSet(); + @NotNull private final Set myPathsToProcessCollapseState = new HashSet<>(); @NotNull private final Map myExpandedStateHolder; diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTreeModel.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTreeModel.java index fc777b3bd46e..5deb663d0391 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTreeModel.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ExternalSystemTasksTreeModel.java @@ -116,7 +116,7 @@ public class ExternalSystemTasksTreeModel extends DefaultTreeModel { public void ensureSubProjectsStructure(@NotNull ExternalProjectPojo topLevelProject, @NotNull Collection subProjects) { ExternalSystemNode topLevelProjectNode = ensureProjectNodeExists(topLevelProject); - Map toAdd = new HashMap(); + Map toAdd = new HashMap<>(); for (ExternalProjectPojo subProject : subProjects) { toAdd.put(subProject.getPath(), subProject); } @@ -158,7 +158,7 @@ public class ExternalSystemTasksTreeModel extends DefaultTreeModel { // )); return; } - Set toAdd = new HashSet(); + Set toAdd = new HashSet<>(); for (ExternalTaskPojo task : tasks) { toAdd.add(buildTaskInfo(task)); } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectPathField.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectPathField.java index 9839b3e42077..512995b55447 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectPathField.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectPathField.java @@ -130,7 +130,7 @@ public class ExternalProjectPathField extends ComponentWithBrowseButton(), project, externalSystemId); + ExternalSystemTasksTree result = new ExternalSystemTasksTree(model, new HashMap<>(), project, externalSystemId); ExternalSystemManager manager = ExternalSystemApiUtil.getManager(externalSystemId); assert manager != null; diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemUtil.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemUtil.java index 2444b8e521ad..c4bfac691be7 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemUtil.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemUtil.java @@ -119,7 +119,7 @@ public class ExternalSystemUtil { private static final Logger LOG = Logger.getInstance(ExternalSystemUtil.class); - @NotNull private static final Map RUNNER_IDS = new HashMap(); + @NotNull private static final Map RUNNER_IDS = new HashMap<>(); public static final TObjectHashingStrategy> HASHING_STRATEGY = new TObjectHashingStrategy>() { @@ -271,7 +271,7 @@ public class ExternalSystemUtil { callback = spec.getCallback(); } - Set toRefresh = new HashSet(); + Set toRefresh = new HashSet<>(); for (ExternalProjectSettings setting : projectsSettings) { // don't refresh project when auto-import is disabled if such behavior needed (e.g. on project opening when auto-import is disabled) if (!setting.isUseAutoImport() && spec.whenAutoImportEnabled()) continue; diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalSystemViewDefaultContributor.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalSystemViewDefaultContributor.java index a620ddb9b5c7..26bbb06b535c 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalSystemViewDefaultContributor.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalSystemViewDefaultContributor.java @@ -143,7 +143,7 @@ public class ExternalSystemViewDefaultContributor extends ExternalSystemViewCont final AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(externalProjectsView.getProject(), externalProjectsView.getSystemId()); - final Map groupToModule = new HashMap(moduleDataNodes.size()); + final Map groupToModule = new HashMap<>(moduleDataNodes.size()); List moduleNodes = new ArrayList<>(); diff --git a/platform/lang-api/src/com/intellij/execution/filters/CompositeInputFilter.java b/platform/lang-api/src/com/intellij/execution/filters/CompositeInputFilter.java index 96366daeed24..ed0211eba31f 100644 --- a/platform/lang-api/src/com/intellij/execution/filters/CompositeInputFilter.java +++ b/platform/lang-api/src/com/intellij/execution/filters/CompositeInputFilter.java @@ -18,7 +18,7 @@ import java.util.List; public class CompositeInputFilter implements InputFilter { private static final Logger LOG = Logger.getInstance(CompositeInputFilter.class); - private final List myFilters = new ArrayList(); + private final List myFilters = new ArrayList<>(); private final DumbService myDumbService; public CompositeInputFilter(@NotNull Project project) { diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByModifierArrangementEntryMatcher.java b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByModifierArrangementEntryMatcher.java index b2d8dc4db863..aeb16dbfc0a3 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByModifierArrangementEntryMatcher.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByModifierArrangementEntryMatcher.java @@ -16,7 +16,7 @@ import java.util.Set; */ public class ByModifierArrangementEntryMatcher implements ArrangementEntryMatcher { - @NotNull private final Set myModifiers = new HashSet(); + @NotNull private final Set myModifiers = new HashSet<>(); public ByModifierArrangementEntryMatcher(@NotNull ArrangementAtomMatchCondition interestedModifier) { myModifiers.add(interestedModifier); diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByTypeArrangementEntryMatcher.java b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByTypeArrangementEntryMatcher.java index 17523beb01e9..fc4411ed632d 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByTypeArrangementEntryMatcher.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/ByTypeArrangementEntryMatcher.java @@ -22,7 +22,7 @@ import java.util.Set; */ public class ByTypeArrangementEntryMatcher implements ArrangementEntryMatcher { - @NotNull private final Set myTypes = new HashSet(); + @NotNull private final Set myTypes = new HashSet<>(); public ByTypeArrangementEntryMatcher(@NotNull ArrangementAtomMatchCondition interestedType) { myTypes.add(interestedType); diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/StdArrangementEntryMatcher.java b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/StdArrangementEntryMatcher.java index d2eec304c175..90c789364417 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/StdArrangementEntryMatcher.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/match/StdArrangementEntryMatcher.java @@ -113,7 +113,7 @@ public class StdArrangementEntryMatcher implements ArrangementEntryMatcher { */ public static class StdMatcherBuilderImpl implements StdMatcherBuilder { - @NotNull private final List myMatchers = new ArrayList(); + @NotNull private final List myMatchers = new ArrayList<>(); /** * Maps token type to all arrangement tokens that were encountered so far by parsing conditions with * {@link #onCondition(ArrangementAtomMatchCondition) onCondition} calls. diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/CompositeArrangementSettingsToken.java b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/CompositeArrangementSettingsToken.java index 5c82dfedac44..5dc47904cb62 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/CompositeArrangementSettingsToken.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/CompositeArrangementSettingsToken.java @@ -20,7 +20,7 @@ public class CompositeArrangementSettingsToken { private static final Function WRAPPER = token -> new CompositeArrangementSettingsToken(token, deduceRole(token), Collections.emptyList()); - @NotNull private final List myChildren = new ArrayList(); + @NotNull private final List myChildren = new ArrayList<>(); @NotNull private final ArrangementSettingsToken myToken; @NotNull private final StdArrangementTokenUiRole myRole; diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/StdArrangementTokens.java b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/StdArrangementTokens.java index 635cd170c6c2..adf7d9f811bb 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/StdArrangementTokens.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/std/StdArrangementTokens.java @@ -23,7 +23,7 @@ import static com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.En */ public class StdArrangementTokens { - private static final Map TOKENS_BY_ID = new HashMap(); + private static final Map TOKENS_BY_ID = new HashMap<>(); /** * Forces nested classes initialization - otherwise it's possible that, say, {@link #byId(String)} returns null for valid @@ -60,7 +60,7 @@ public class StdArrangementTokens { @NotNull @Override protected Set compute() { - Set result = new HashSet(); + Set result = new HashSet<>(); for (Field field : clazz.getFields()) { if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) { try { diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/color/ArrangementColorsProviderImpl.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/color/ArrangementColorsProviderImpl.java index 7aba51577c86..eeeca386ccb6 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/color/ArrangementColorsProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/color/ArrangementColorsProviderImpl.java @@ -20,9 +20,9 @@ import java.util.Map; public class ArrangementColorsProviderImpl implements ArrangementColorsProvider { @NotNull private final Map myNormalAttributesCache = - new HashMap(); + new HashMap<>(); @NotNull private final Map mySelectedAttributesCache = - new HashMap(); + new HashMap<>(); @NotNull private final TextAttributes myDefaultNormalAttributes = new TextAttributes(); @NotNull private final TextAttributes myDefaultSelectedAttributes = new TextAttributes(); diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/AbstractArrangementUiComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/AbstractArrangementUiComponent.java index 6059c1ab0429..558cb67a37d2 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/AbstractArrangementUiComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/AbstractArrangementUiComponent.java @@ -69,7 +69,7 @@ public abstract class AbstractArrangementUiComponent implements ArrangementUiCom } }; - @NotNull private final Set myAvailableTokens = new HashSet(); + @NotNull private final Set myAvailableTokens = new HashSet<>(); @Nullable private Listener myListener; @Nullable private Rectangle myScreenBounds; diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAndMatchConditionComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAndMatchConditionComponent.java index d48eb50c88e6..c924ab4f561c 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAndMatchConditionComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAndMatchConditionComponent.java @@ -32,8 +32,8 @@ import java.util.*; */ public class ArrangementAndMatchConditionComponent extends JPanel implements ArrangementUiComponent { - @NotNull private final List myComponents = new ArrayList(); - @NotNull private final Set myAvailableTokens = new HashSet(); + @NotNull private final List myComponents = new ArrayList<>(); + @NotNull private final Set myAvailableTokens = new HashSet<>(); @NotNull private final ArrangementCompositeMatchCondition mySetting; @Nullable private Rectangle myScreenBounds; @@ -49,7 +49,7 @@ public class ArrangementAndMatchConditionComponent extends JPanel implements Arr setOpaque(false); setLayout(new GridBagLayout()); final Map operands = - new HashMap(); + new HashMap<>(); ArrangementMatchConditionVisitor visitor = new ArrangementMatchConditionVisitor() { @Override public void visit(@NotNull ArrangementAtomMatchCondition condition) { diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java index 290fbff48db5..91143c3f829a 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/component/ArrangementAtomMatchConditionComponent.java @@ -65,7 +65,7 @@ public class ArrangementAtomMatchConditionComponent implements ArrangementUiComp } }; - @NotNull private final Set myAvailableTokens = new HashSet(); + @NotNull private final Set myAvailableTokens = new HashSet<>(); @NotNull private final BorderStrategy myBorderStrategy; @NotNull private final String myText; diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingComponent.java index efc11c2c45de..153b375a82bc 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingComponent.java @@ -46,7 +46,7 @@ public class ArrangementGroupingComponent extends JPanel implements ArrangementR @NotNull ArrangementStandardSettingsManager settingsManager) throws IllegalArgumentException { - List children = new ArrayList(); + List children = new ArrayList<>(); StdArrangementTokenUiRole childRole = null; for (CompositeArrangementSettingsToken child : token.getChildren()) { if (childRole == null) { diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingRulesControl.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingRulesControl.java index a72d89a9ba8e..1e14fc2e88e3 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingRulesControl.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/group/ArrangementGroupingRulesControl.java @@ -32,7 +32,7 @@ public class ArrangementGroupingRulesControl extends JBTable { @NotNull public static final DataKey KEY = DataKey.create("Arrangement.Rule.Group.Control"); @NotNull private final Map myComponents = - new HashMap(); + new HashMap<>(); @NotNull private final ArrangementStandardSettingsManager mySettingsManager; diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRuleEditor.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRuleEditor.java index f433b51de33a..9811a0e9bcc7 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRuleEditor.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/match/ArrangementMatchingRuleEditor.java @@ -35,8 +35,8 @@ import java.util.*; public class ArrangementMatchingRuleEditor extends JPanel implements ArrangementUiComponent.Listener { @NotNull private final Map myComponents = - new HashMap(); - @NotNull private final List myRows = new ArrayList(); + new HashMap<>(); + @NotNull private final List myRows = new ArrayList<>(); @NotNull private final ArrangementMatchingRulesControl myControl; @NotNull private final ArrangementStandardSettingsManager mySettingsManager; @@ -93,7 +93,7 @@ public class ArrangementMatchingRuleEditor extends JPanel implements Arrangement MultiRowFlowPanel panel = new MultiRowFlowPanel( FlowLayout.LEFT, ArrangementConstants.HORIZONTAL_GAP, ArrangementConstants.VERTICAL_GAP ); - List prevTokens = new ArrayList(); + List prevTokens = new ArrayList<>(); StdArrangementTokenUiRole prevRole = null; ArrangementUiComponent component; JComponent uiComponent; @@ -188,7 +188,7 @@ public class ArrangementMatchingRuleEditor extends JPanel implements Arrangement @Nullable private Pair buildCondition() { - List conditions = new ArrayList(); + List conditions = new ArrayList<>(); ArrangementSettingsToken orderType = null; for (ArrangementUiComponent component : myComponents.values()) { if (!component.isEnabled() || !component.isSelected()) { @@ -261,7 +261,7 @@ public class ArrangementMatchingRuleEditor extends JPanel implements Arrangement // We need to disable conditions which are not applicable for empty rules (e.g. we don't want to enable 'volatile' condition // for java rearranger if no 'field' condition is selected. condition = null; - conditionTokens = new HashMap(); + conditionTokens = new HashMap<>(); } else if (!(element instanceof StdArrangementMatchRule)) { return; diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java index 9f52713fc1b3..39e0b7e1266b 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java @@ -1210,7 +1210,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract } private static Map, Element> createNamedIndex(Element e) { - HashMap, Element> index = new HashMap, Element>(); + HashMap, Element> index = new HashMap<>(); for (Element child : e.getChildren()) { index.put(indexKey(child), child); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/StatisticsWeigher.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/StatisticsWeigher.java index 80f65f0ec525..2d49b7d79a83 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/StatisticsWeigher.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/StatisticsWeigher.java @@ -140,7 +140,7 @@ public class StatisticsWeigher extends CompletionWeigher { @NotNull @Override public List> getSortingWeights(@NotNull Iterable items, @NotNull final ProcessingContext context) { - return ContainerUtil.map(items, lookupElement -> new Pair(lookupElement, getWeight(lookupElement))); + return ContainerUtil.map(items, lookupElement -> new Pair<>(lookupElement, getWeight(lookupElement))); } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java index 2e5b57b6b581..80ec0984a51a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/LiftShorterItemsClassifier.java @@ -106,7 +106,7 @@ public class LiftShorterItemsClassifier extends Classifier { public List> getSortingWeights(@NotNull Iterable items, @NotNull ProcessingContext context) { final THashSet lifted = newIdentityTroveSet(); Iterable iterable = liftShorterElements(ContainerUtil.newArrayList(items), lifted, context); - return ContainerUtil.map(iterable, element -> new Pair(element, lifted.contains(element))); + return ContainerUtil.map(iterable, element -> new Pair<>(element, lifted.contains(element))); } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java index 69a8c2a7b8af..ed9e9e7c6f8b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java @@ -359,7 +359,7 @@ public class IndentsPass extends TextEditorHighlightingPass implements DumbAware } private class IndentsCalculator { - @NotNull final Map myComments = new HashMap(); + @NotNull final Map myComments = new HashMap<>(); @NotNull final int[] lineIndents; // negative value means the line is empty (or contains a comment) and indent // (denoted by absolute value) was deduced from enclosing non-empty lines @NotNull final CharSequence myChars; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/ComparingClassifier.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/ComparingClassifier.java index 502ee6744560..8107b5535181 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/ComparingClassifier.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/ComparingClassifier.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2011 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.lookup; import com.intellij.openapi.util.Pair; @@ -80,6 +66,6 @@ public abstract class ComparingClassifier extends Classifier { @NotNull @Override public List> getSortingWeights(@NotNull Iterable items, @NotNull final ProcessingContext context) { - return ContainerUtil.map(items, t -> new Pair(t, getWeight(t, context))); + return ContainerUtil.map(items, t -> new Pair<>(t, getWeight(t, context))); } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/DocPreviewUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/DocPreviewUtil.java index 9f042ad4c39f..6d4730f53750 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/DocPreviewUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/DocPreviewUtil.java @@ -91,11 +91,11 @@ public class DocPreviewUtil { } // Build links info. - Map links = new HashMap(); + Map links = new HashMap<>(); process(fullText, new LinksCollector(links)); // Add derived names. - Map toAdd = new HashMap(); + Map toAdd = new HashMap<>(); for (Map.Entry entry : links.entrySet()) { String shortName = parseShortName(entry.getKey()); if (shortName != null) { @@ -112,7 +112,7 @@ public class DocPreviewUtil { } // Apply links info to the header template. - List modifiedRanges = new ArrayList(); + List modifiedRanges = new ArrayList<>(); List sortedReplacements = ContainerUtilRt.newArrayList(links.keySet()); Collections.sort(sortedReplacements, REPLACEMENTS_COMPARATOR); StringBuilder buffer = new StringBuilder(header); diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java index d0cc4cb94a8e..fb2aeb29565a 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoActionModel.java @@ -427,7 +427,7 @@ public class GotoActionModel implements ChooseByNameModel, Comparator, D @NotNull public SortedSet sortItems(@NotNull Set elements) { - TreeSet objects = new TreeSet(this); + TreeSet objects = new TreeSet<>(this); objects.addAll(elements); return objects; } diff --git a/platform/lang-impl/src/com/intellij/psi/codeStyle/arrangement/engine/ArrangementEngine.java b/platform/lang-impl/src/com/intellij/psi/codeStyle/arrangement/engine/ArrangementEngine.java index d7bf60cd79f7..016297205eef 100644 --- a/platform/lang-impl/src/com/intellij/psi/codeStyle/arrangement/engine/ArrangementEngine.java +++ b/platform/lang-impl/src/com/intellij/psi/codeStyle/arrangement/engine/ArrangementEngine.java @@ -224,9 +224,9 @@ public class ArrangementEngine { @NotNull List rulesByPriority, @Nullable Map entryToSection) { - List arranged = new ArrayList(); - Set unprocessed = new LinkedHashSet(); - List, E>> dependent = new ArrayList, E>>(); + List arranged = new ArrayList<>(); + Set unprocessed = new LinkedHashSet<>(); + List, E>> dependent = new ArrayList<>(); for (E entry : entries) { List dependencies = entry.getDependencies(); if (dependencies == null) { @@ -353,10 +353,10 @@ public class ArrangementEngine { return; } - Map entryToSection = new HashMap(); - Map> map = new HashMap>(); - List arranged = new ArrayList(); - List toArrange = new ArrayList(); + Map entryToSection = new HashMap<>(); + Map> map = new HashMap<>(); + List arranged = new ArrayList<>(); + List toArrange = new ArrayList<>(); for (ArrangementEntryWrapper wrapper : wrappers) { E entry = wrapper.getEntry(); map.put(wrapper.getEntry(), wrapper); @@ -485,7 +485,7 @@ public class ArrangementEngine { private static class Context { - @NotNull public final List moveInfos = new ArrayList(); + @NotNull public final List moveInfos = new ArrayList<>(); @NotNull public final Rearranger rearranger; @NotNull public final Collection> wrappers; diff --git a/platform/lang-impl/src/com/intellij/psi/codeStyle/statusbar/CodeStyleStatusBarWidget.java b/platform/lang-impl/src/com/intellij/psi/codeStyle/statusbar/CodeStyleStatusBarWidget.java index 48da622eb28f..b1a7a7c4b389 100644 --- a/platform/lang-impl/src/com/intellij/psi/codeStyle/statusbar/CodeStyleStatusBarWidget.java +++ b/platform/lang-impl/src/com/intellij/psi/codeStyle/statusbar/CodeStyleStatusBarWidget.java @@ -129,7 +129,7 @@ public class CodeStyleStatusBarWidget extends EditorBasedStatusBarPopup implemen @NotNull private static AnAction[] getActions(@Nullable final CodeStyleStatusBarUIContributor uiContributor, @NotNull PsiFile psiFile) { - List allActions = new ArrayList(); + List allActions = new ArrayList<>(); if (uiContributor != null) { AnAction[] actions = uiContributor.getActions(psiFile); if (actions != null) { diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java b/platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java index 3e4227fb4ccb..020912d44350 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java @@ -94,7 +94,7 @@ public abstract class AbstractBlock implements ASTBlock, ExtraRangesProvider { if (blockRange.containsRange(startOffset, endOffset)) { PsiFile injected = PsiDocumentManager.getInstance(psi.getProject()).getCachedPsiFile(documentWindow); if (injected != null) { - List result = new ArrayList(); + List result = new ArrayList<>(); DefaultInjectedLanguageBlockBuilder builder = new DefaultInjectedLanguageBlockBuilder(((SettingsAwareBlock)this).getSettings()); builder.addInjectedBlocks(result, myNode, getWrap(), getAlignment(), getIndent()); return result; diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java index f267d09f98df..f19e0df28878 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeFormatterFacade.java @@ -263,7 +263,7 @@ public class CodeFormatterFacade { // We use a set here because we encountered a situation when more than one PSI leaf points to the same injected fragment // (at least for sql injected into sql). - final LinkedHashSet injectedFileRangesSet = new LinkedHashSet(); + final LinkedHashSet injectedFileRangesSet = new LinkedHashSet<>(); if (!psi.getProject().isDefault()) { List injectedDocuments = InjectedLanguageManager.getInstance(file.getProject()).getCachedInjectedDocumentsInRange(file, file.getTextRange()); @@ -370,7 +370,7 @@ public class CodeFormatterFacade { PsiElement e = toProcess.pop(); if (e instanceof PsiLanguageInjectionHost) { if (result == null) { - result = new HashSet(); + result = new HashSet<>(); } result.add((PsiLanguageInjectionHost)e); } diff --git a/platform/lang-impl/src/com/intellij/refactoring/util/FixableUsagesRefactoringProcessor.java b/platform/lang-impl/src/com/intellij/refactoring/util/FixableUsagesRefactoringProcessor.java index 2dab7a2f9826..142cc16ef47d 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/util/FixableUsagesRefactoringProcessor.java +++ b/platform/lang-impl/src/com/intellij/refactoring/util/FixableUsagesRefactoringProcessor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.util; import com.intellij.openapi.diagnostic.Logger; @@ -41,7 +41,7 @@ public abstract class FixableUsagesRefactoringProcessor extends BaseRefactoringP @Override @NotNull protected final UsageInfo[] findUsages() { - final List usages = Collections.synchronizedList(new ArrayList()); + final List usages = Collections.synchronizedList(new ArrayList<>()); findUsages(usages); final int numUsages = usages.size(); final FixableUsageInfo[] usageArray = usages.toArray(new FixableUsageInfo[numUsages]); diff --git a/platform/platform-api/src/com/intellij/ui/AddDeleteListPanel.java b/platform/platform-api/src/com/intellij/ui/AddDeleteListPanel.java index ea42dfb14e62..959edb16a5d9 100644 --- a/platform/platform-api/src/com/intellij/ui/AddDeleteListPanel.java +++ b/platform/platform-api/src/com/intellij/ui/AddDeleteListPanel.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2011 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.ui; @@ -37,8 +23,8 @@ import java.util.List; public abstract class AddDeleteListPanel extends PanelWithButtons implements ComponentWithEmptyText { private final String myTitle; - protected DefaultListModel myListModel = new DefaultListModel(); - protected JBList myList = new JBList(myListModel); + protected DefaultListModel myListModel = new DefaultListModel<>(); + protected JBList myList = new JBList<>(myListModel); public AddDeleteListPanel(final String title, final List initialList) { myTitle = title; diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java index 21de6ae88fc2..a505b2c057e0 100644 --- a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java +++ b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java @@ -1289,7 +1289,7 @@ public class IdeEventQueue extends EventQueue { } private final Set shortcutsShowingPopups = new HashSet<>(); - private WeakReference lastActiveKeymap = new WeakReference(null); + private WeakReference lastActiveKeymap = new WeakReference<>(null); private final List actionsShowingPopupsList = new ArrayList<>(); private long lastTypeaheadTimestamp = -1; diff --git a/platform/platform-impl/src/com/intellij/internal/inspector/UiDropperAction.java b/platform/platform-impl/src/com/intellij/internal/inspector/UiDropperAction.java index 174f5bde0aed..3864ec360cca 100644 --- a/platform/platform-impl/src/com/intellij/internal/inspector/UiDropperAction.java +++ b/platform/platform-impl/src/com/intellij/internal/inspector/UiDropperAction.java @@ -377,7 +377,7 @@ public class UiDropperAction extends ToggleAction implements DumbAware { @SuppressWarnings("UseOfObsoleteCollectionType") private static Vector prepareChildren(Component parent) { - Vector result = new Vector(); + Vector result = new Vector<>(); if (parent instanceof Container) { for (Component component : ((Container)parent).getComponents()) { result.add(new ComponentNode(component)); diff --git a/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java b/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java index 6554c79dc4d4..73ad97f1a5a8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java @@ -139,7 +139,7 @@ public class ConfigImportHelper { // looks for the most recent existing config directory in the vicinity of the new one, assuming standard layout // ("~/Library/" on macOS, "~/./config" on other OSes) - List homes = new ArrayList(2); + List homes = new ArrayList<>(2); homes.add((isMacOs ? newConfigDir : newConfigDir.getParent()).getParent()); String nameWithSelector = StringUtil.notNullize( PathManager.getPathsSelector(), diff --git a/platform/platform-impl/src/com/intellij/openapi/application/ex/DecodeDefaultsUtil.java b/platform/platform-impl/src/com/intellij/openapi/application/ex/DecodeDefaultsUtil.java index 51623d85fc8a..546e11497feb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/ex/DecodeDefaultsUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/ex/DecodeDefaultsUtil.java @@ -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.openapi.application.ex; import com.intellij.openapi.components.impl.stores.FileStorageCoreUtil; @@ -31,7 +17,7 @@ import java.util.Map; public class DecodeDefaultsUtil { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.application.ex.DecodeDefaultsUtil"); - private static final Map RESOURCE_CACHE = Collections.synchronizedMap(new THashMap()); + private static final Map RESOURCE_CACHE = Collections.synchronizedMap(new THashMap<>()); public static URL getDefaults(Object requestor, @NotNull String componentResourcePath) { URL url = RESOURCE_CACHE.get(componentResourcePath); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index e049ee42614b..94d51774aa67 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -4223,8 +4223,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi private class MyColorSchemeDelegate extends DelegateColorScheme { private final FontPreferencesImpl myFontPreferences = new FontPreferencesImpl(); private final FontPreferencesImpl myConsoleFontPreferences = new FontPreferencesImpl(); - private final Map myOwnAttributes = new HashMap(); - private final Map myOwnColors = new HashMap(); + private final Map myOwnAttributes = new HashMap<>(); + private final Map myOwnColors = new HashMap<>(); private final EditorColorsScheme myCustomGlobalScheme; private Map myFontsMap; private int myMaxFontSize = EditorFontsConstants.getMaxEditorFontSize(); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/IndentsModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/IndentsModelImpl.java index fa2a82eb15f3..7029165b7615 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/IndentsModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/IndentsModelImpl.java @@ -17,8 +17,8 @@ import java.util.Map; public class IndentsModelImpl implements IndentsModel { - private final Map myIndentsByLines = new HashMap(); - private List myIndents = new ArrayList(); + private final Map myIndentsByLines = new HashMap<>(); + private List myIndents = new ArrayList<>(); @NotNull private final EditorImpl myEditor; public IndentsModelImpl(@NotNull EditorImpl editor) { diff --git a/platform/platform-impl/src/com/intellij/ui/SwingActionDelegate.java b/platform/platform-impl/src/com/intellij/ui/SwingActionDelegate.java index 18042ba280a1..e2bcdc90d4e7 100644 --- a/platform/platform-impl/src/com/intellij/ui/SwingActionDelegate.java +++ b/platform/platform-impl/src/com/intellij/ui/SwingActionDelegate.java @@ -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.ui; import com.intellij.openapi.actionSystem.AnAction; @@ -71,7 +72,7 @@ public class SwingActionDelegate extends AnAction implements DumbAware { */ @ApiStatus.Experimental public static void configureMapping(@NotNull JComponent base, @NotNull JComponent dependant, @NotNull String... actions) { - HashMap map = new HashMap(); + HashMap map = new HashMap<>(); for (String action : actions) map.put(action, dependant); configureMapping(base, map::get); } diff --git a/platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.java b/platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.java index c4f70dafde03..d3f78d2cc6ec 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.java +++ b/platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.util.ui; import com.intellij.openapi.ui.ComboBox; @@ -19,7 +19,7 @@ public abstract class ReloadableComboBoxPanel extends ReloadablePanel { @NotNull protected JComboBox createValuesComboBox() { - return new ComboBox(); + return new ComboBox<>(); } @NotNull diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java index 307eebc0d996..eb9c3eb4984b 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java @@ -579,7 +579,7 @@ public class SMTestProxy extends AbstractTestProxy { public List collectChildren() { final List allChildren = getChildren(); - final List result = new ArrayList(); + final List result = new ArrayList<>(); result.addAll(allChildren); diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileFixture.java index 398034903947..7b4e33a46e48 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FileFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx; @@ -130,7 +116,7 @@ public class FileFixture { Collection highlightInfos = execute(new GuiQuery>() { @Override protected Collection executeInEDT() throws Throwable { - CommonProcessors.CollectProcessor processor = new CommonProcessors.CollectProcessor(); + CommonProcessors.CollectProcessor processor = new CommonProcessors.CollectProcessor<>(); DaemonCodeAnalyzerEx.processHighlights(document, myProject, severity, 0, document.getTextLength(), processor); return processor.getResults(); } @@ -160,7 +146,7 @@ public class FileFixture { Collection highlightInfos = execute(new GuiQuery>() { @Override protected Collection executeInEDT() throws Throwable { - CommonProcessors.CollectProcessor processor = new CommonProcessors.CollectProcessor(); + CommonProcessors.CollectProcessor processor = new CommonProcessors.CollectProcessor<>(); DaemonCodeAnalyzerEx.processHighlights(document, myProject, severity, 0, document.getTextLength(), processor); return processor.getResults(); } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FrameworksTreeFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FrameworksTreeFixture.java index bf053c87046d..56fd146a6c90 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FrameworksTreeFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/FrameworksTreeFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.ide.projectView.impl.ProjectViewTree; @@ -121,7 +107,7 @@ public class FrameworksTreeFixture { @SuppressWarnings("UseOfObsoleteCollectionType") private static Vector prepareChildren(Component component) { if (!(component instanceof FrameworksTree)) return null; - Vector result = new Vector(); + Vector result = new Vector<>(); final Tree tree = (Tree)component; final int rowCount = tree.getRowCount(); for (int i = 0; i < rowCount; i++) { diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java index 972c6e6b0f76..1de7d062d91c 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.codeInspection.ui.InspectionTree; @@ -600,7 +586,7 @@ public class IdeFrameFixture extends ComponentFixture notificationPanelRef = new Ref(); + final Ref notificationPanelRef = new Ref<>(); pause(new Condition("Notification with message '" + message + "' shows up") { @Override diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeaDialogFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeaDialogFixture.java index 590790a8adaf..96013b69d654 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeaDialogFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeaDialogFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.openapi.ui.DialogWrapper; @@ -77,7 +63,7 @@ public abstract class IdeaDialogFixture extends Compone @NotNull public static DialogAndWrapper find(@NotNull Robot robot, @NotNull final Class clz, @NotNull final GenericTypeMatcher matcher) { - final Ref wrapperRef = new Ref(); + final Ref wrapperRef = new Ref<>(); JDialog dialog = GuiTestUtil.INSTANCE.waitUntilFound(robot, new GenericTypeMatcher(JDialog.class) { @Override protected boolean isMatching(@NotNull JDialog dialog) { @@ -91,7 +77,7 @@ public abstract class IdeaDialogFixture extends Compone return false; } }); - return new DialogAndWrapper(dialog, wrapperRef.get()); + return new DialogAndWrapper<>(dialog, wrapperRef.get()); } protected IdeaDialogFixture(@NotNull Robot robot, @NotNull JDialog target, @NotNull T dialogWrapper) { diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/InputDialogFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/InputDialogFixture.java index e1d952708108..6798418ce2a3 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/InputDialogFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/InputDialogFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.openapi.ui.DialogWrapper; @@ -33,7 +19,7 @@ import static org.junit.Assert.assertNotNull; public class InputDialogFixture extends IdeaDialogFixture { @NotNull public static InputDialogFixture findByTitle(@NotNull Robot robot, @NotNull final String title) { - final Ref wrapperRef = new Ref(); + final Ref wrapperRef = new Ref<>(); JDialog dialog = GuiTestUtil.INSTANCE.waitUntilFound(robot, new GenericTypeMatcher(JDialog.class) { @Override protected boolean isMatching(@NotNull JDialog dialog) { diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/RenameDialogFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/RenameDialogFixture.java index 195e03aab4c2..ae43c719acb4 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/RenameDialogFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/RenameDialogFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.openapi.actionSystem.impl.SimpleDataContext; @@ -64,7 +50,7 @@ public class RenameDialogFixture extends IdeaDialogFixture { //noinspection SSBasedInspection SwingUtilities.invokeLater( () -> handler.invoke(element.getProject(), new PsiElement[] { element }, SimpleDataContext.getProjectContext(element.getProject()))); - final Ref ref = new Ref(); + final Ref ref = new Ref<>(); JDialog dialog = GuiTestUtil.INSTANCE.waitUntilFound(robot, new GenericTypeMatcher(JDialog.class) { @Override protected boolean isMatching(@NotNull JDialog dialog) { diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/SelectRefactoringDialogFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/SelectRefactoringDialogFixture.java index 7a2cab15013d..d8afc287bf50 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/SelectRefactoringDialogFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/SelectRefactoringDialogFixture.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.fixtures; import com.intellij.openapi.ui.DialogWrapper; @@ -28,7 +14,7 @@ import javax.swing.*; public class SelectRefactoringDialogFixture extends IdeaDialogFixture { @NotNull public static SelectRefactoringDialogFixture findByTitle(@NotNull Robot robot) { - final Ref wrapperRef = new Ref(); + final Ref wrapperRef = new Ref<>(); JDialog dialog = GuiTestUtil.INSTANCE.waitUntilFound(robot, new GenericTypeMatcher(JDialog.class) { @Override protected boolean isMatching(@NotNull JDialog dialog) { diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestConfiguratorBase.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestConfiguratorBase.java index fc1bb450b464..f00915ae0c34 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestConfiguratorBase.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestConfiguratorBase.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.framework; import org.fest.reflect.reference.TypeRef; @@ -60,7 +46,7 @@ public class GuiTestConfiguratorBase { // Invoked using reflection and the IDE's ClassLoader. @NotNull private static Map extractTestConfiguration(@NotNull Method testMethod) { - Map config = new HashMap(); + Map config = new HashMap<>(); //TODO: replace with system properties (or VM options) config.put(SKIP_SOURCE_GENERATION_ON_SYNC_KEY, false); config.put(TAKE_SCREENSHOT_ON_TEST_FAILURE_KEY, true); diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/matcher/ClassNameMatcher.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/matcher/ClassNameMatcher.java index 236847ebbca6..a010bfe06960 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/matcher/ClassNameMatcher.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/matcher/ClassNameMatcher.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.testGuiFramework.matcher; import org.fest.swing.core.GenericTypeMatcher; @@ -43,10 +29,10 @@ public class ClassNameMatcher extends GenericTypeMatcher } public static ClassNameMatcher forClass(String className, Class supportedType) { - return new ClassNameMatcher(className, supportedType); + return new ClassNameMatcher<>(className, supportedType); } public static ClassNameMatcher forClass(String className, Class supportedType, boolean requireShowing) { - return new ClassNameMatcher(className, supportedType, requireShowing); + return new ClassNameMatcher<>(className, supportedType, requireShowing); } } diff --git a/platform/util/src/com/intellij/util/execution/ParametersListUtil.java b/platform/util/src/com/intellij/util/execution/ParametersListUtil.java index 6372357734c1..7a7633662d02 100644 --- a/platform/util/src/com/intellij/util/execution/ParametersListUtil.java +++ b/platform/util/src/com/intellij/util/execution/ParametersListUtil.java @@ -19,7 +19,7 @@ public class ParametersListUtil { public static final Function> DEFAULT_LINE_PARSER = text -> parse(text, true); public static final Function, String> DEFAULT_LINE_JOINER = strings -> StringUtil.join(strings, " "); public static final Function> COLON_LINE_PARSER = text -> { - final ArrayList result = new ArrayList(); + final ArrayList result = new ArrayList<>(); final StringTokenizer tokenizer = new StringTokenizer(text, ";", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.nextToken()); @@ -107,7 +107,7 @@ public class ParametersListUtil { public static List parse(@NotNull String parameterString, boolean keepQuotes, boolean supportSingleQuotes) { parameterString = parameterString.trim(); - final ArrayList params = new ArrayList(); + final ArrayList params = new ArrayList<>(); if (parameterString.isEmpty()) { return params; } diff --git a/platform/util/src/com/intellij/util/ui/KeyboardLayoutUtil.java b/platform/util/src/com/intellij/util/ui/KeyboardLayoutUtil.java index dfc946e52479..a380be0e7c71 100644 --- a/platform/util/src/com/intellij/util/ui/KeyboardLayoutUtil.java +++ b/platform/util/src/com/intellij/util/ui/KeyboardLayoutUtil.java @@ -58,7 +58,7 @@ public class KeyboardLayoutUtil { private static class HardCoded { - private static final Map LL = new HashMap(33); + private static final Map LL = new HashMap<>(33); static { // keyboard layouts in lowercase diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsNumbersCache.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsNumbersCache.java index ed48846fc502..fd5243205142 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsNumbersCache.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsNumbersCache.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.vcs.changes; import com.intellij.openapi.diagnostic.Logger; @@ -70,7 +70,7 @@ public class RemoteRevisionsNumbersCache implements ChangesOnServerTracker { myProject = project; myLock = new Object(); myData = new HashMap<>(); - myRefreshingQueues = Collections.synchronizedMap(new HashMap>()); + myRefreshingQueues = Collections.synchronizedMap(new HashMap<>()); myLatestRevisionsMap = new HashMap<>(); myLfs = LocalFileSystem.getInstance(); myVcsManager = ProjectLevelVcsManager.getInstance(project); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java index b05ad160c31d..eeab876f51aa 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.vcs.changes.conflicts; @@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicBoolean; public class ChangelistConflictTracker { - private final Map myConflicts = Collections.synchronizedMap(new LinkedHashMap()); + private final Map myConflicts = Collections.synchronizedMap(new LinkedHashMap<>()); private final Options myOptions = new Options(); private final Project myProject; diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/ParameterTypePreventsOverridingInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/ParameterTypePreventsOverridingInspection.java index 98313b25731d..0a63e5140ecb 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/ParameterTypePreventsOverridingInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/ParameterTypePreventsOverridingInspection.java @@ -123,7 +123,7 @@ public class ParameterTypePreventsOverridingInspection extends BaseInspection { continue; } final PsiParameter[] superParameters = superParameterList.getParameters(); - final Map problemTypeElements = new HashMap(2); + final Map problemTypeElements = new HashMap<>(2); for (int i = 0; i < parameters.length; i++) { final PsiParameter parameter = parameters[i]; final PsiParameter superParameter = superParameters[i]; diff --git a/plugins/copyright/src/com/maddyhome/idea/copyright/util/NewFileTracker.java b/plugins/copyright/src/com/maddyhome/idea/copyright/util/NewFileTracker.java index e24b53bf4061..e85ecc629be1 100644 --- a/plugins/copyright/src/com/maddyhome/idea/copyright/util/NewFileTracker.java +++ b/plugins/copyright/src/com/maddyhome/idea/copyright/util/NewFileTracker.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.maddyhome.idea.copyright.util; @@ -24,7 +10,7 @@ import java.util.Collections; import java.util.Set; public class NewFileTracker { - private final Set newFiles = Collections.synchronizedSet(new THashSet()); + private final Set newFiles = Collections.synchronizedSet(new THashSet<>()); public boolean poll(@NotNull VirtualFile file) { return newFiles.remove(file); diff --git a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/connections/ssh/SocksAuthenticatorManager.java b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/connections/ssh/SocksAuthenticatorManager.java index a579763fad0f..3bcce291bee7 100644 --- a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/connections/ssh/SocksAuthenticatorManager.java +++ b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/connections/ssh/SocksAuthenticatorManager.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.cvsSupport2.connections.ssh; import com.intellij.cvsSupport2.config.ProxySettings; @@ -80,8 +66,8 @@ public class SocksAuthenticatorManager { private final NonStaticAuthenticator myAuthenticator; private CvsProxySelector() { - myKnownHosts = Collections.synchronizedMap(new HashMap, Pair>()); - myAuthMap = Collections.synchronizedMap(new HashMap, Pair>()); + myKnownHosts = Collections.synchronizedMap(new HashMap<>()); + myAuthMap = Collections.synchronizedMap(new HashMap<>()); myAuthenticator = new NonStaticAuthenticator() { @Override public PasswordAuthentication getPasswordAuthentication() { diff --git a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/javacvsImpl/io/ReadThread.java b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/javacvsImpl/io/ReadThread.java index e3e9226632f9..7fa117bf6559 100644 --- a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/javacvsImpl/io/ReadThread.java +++ b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/javacvsImpl/io/ReadThread.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.cvsSupport2.javacvsImpl.io; import com.intellij.openapi.diagnostic.Logger; @@ -17,7 +17,7 @@ import java.util.Collections; */ public class ReadThread implements Runnable { - public final static Collection READ_THREADS = Collections.synchronizedCollection(new ArrayList()); + public final static Collection READ_THREADS = Collections.synchronizedCollection(new ArrayList<>()); private static final Logger LOG = Logger.getInstance("#com.intellij.cvsSupport2.javacvsImpl.io.ReadThread"); diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java index e807c83d6a24..01bcdfb22ba4 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseProcess.java @@ -232,7 +232,7 @@ public class GitRebaseProcess { String repoName = getShortRepositoryName(repository); LOG.info("Rebasing root " + repoName + ", mode: " + notNull(customMode, "standard")); - Collection skippedCommits = new ArrayList(); + Collection skippedCommits = new ArrayList<>(); MultiMap allSkippedCommits = getSkippedCommits(alreadyRebased); boolean retryWhenDirty = false; diff --git a/plugins/gradle/java/src/service/resolve/GradleScriptContributor.java b/plugins/gradle/java/src/service/resolve/GradleScriptContributor.java index 703baf026ff2..afb57af353da 100644 --- a/plugins/gradle/java/src/service/resolve/GradleScriptContributor.java +++ b/plugins/gradle/java/src/service/resolve/GradleScriptContributor.java @@ -40,7 +40,7 @@ public class GradleScriptContributor extends NonCodeMembersContributor { @NotNull ResolveState state) { if (!UtilKt.isResolvedInGradleScript(aClass)) return; - List methodInfo = new ArrayList(); + List methodInfo = new ArrayList<>(); for (GrMethodCall current = PsiTreeUtil.getParentOfType(place, GrMethodCall.class); current != null; current = PsiTreeUtil.getParentOfType(current, GrMethodCall.class)) { diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/GradleManager.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/GradleManager.java index 5178396abe0e..8353c4a6e3a0 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/GradleManager.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/GradleManager.java @@ -103,7 +103,7 @@ public final class GradleManager @NotNull @Override protected List compute() { - List result = new ArrayList(); + List result = new ArrayList<>(); // It's possible usecase when 'java' subsystem dependent plugins bundled with the non-java IDE using fat plugin distribution. // This approach can lead to unwanted/incompatible extensions to be loaded. @@ -280,7 +280,7 @@ public final class GradleManager @Override public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException { - final Set additionalEntries = new HashSet(); + final Set additionalEntries = new HashSet<>(); for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) { ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(extension.getClass())); for (Class aClass : extension.getExtraProjectModelClasses()) { @@ -480,8 +480,8 @@ public final class GradleManager @Nullable private static Map patchLinkedProjects(@NotNull Project project) { GradleSettings settings = GradleSettings.getInstance(project); - Collection correctedSettings = new ArrayList(); - Map adjustedPaths = new HashMap(); + Collection correctedSettings = new ArrayList<>(); + Map adjustedPaths = new HashMap<>(); for (GradleProjectSettings projectSettings : settings.getLinkedProjectsSettings()) { String oldPath = projectSettings.getExternalProjectPath(); if (oldPath != null && new File(oldPath).isFile() && FileUtilRt.extensionEquals(oldPath, GradleConstants.EXTENSION)) { @@ -509,7 +509,7 @@ public final class GradleManager private static void patchAvailableProjects(@NotNull Map adjustedPaths, @NotNull GradleLocalSettings localSettings) { Map> adjustedAvailableProjects = - new HashMap>(); + new HashMap<>(); for (Map.Entry> entry : localSettings.getAvailableProjects().entrySet()) { String newPath = adjustedPaths.get(entry.getKey().getPath()); if (newPath == null) { diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/remote/impl/GradleLibraryNamesMixer.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/remote/impl/GradleLibraryNamesMixer.java index 8147da459687..78462a2387c3 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/remote/impl/GradleLibraryNamesMixer.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/remote/impl/GradleLibraryNamesMixer.java @@ -62,8 +62,8 @@ public class GradleLibraryNamesMixer { if (libraries.isEmpty()) { return; } - Map names = new HashMap(); - List data = new ArrayList(); + Map names = new HashMap<>(); + List data = new ArrayList<>(); for (DataNode library : libraries) { Wrapped wrapped = new Wrapped(library.getData()); data.add(wrapped); diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/GradleInstallationManager.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/GradleInstallationManager.java index f4580aa78335..e9dec82d0643 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/GradleInstallationManager.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/GradleInstallationManager.java @@ -84,7 +84,7 @@ public class GradleInstallationManager { return null; } - List result = new ArrayList(); + List result = new ArrayList<>(); File libs = new File(gradleHome, "lib"); File[] files = libs.listFiles(); diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleProjectResolver.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleProjectResolver.java index 45111d9ea4fd..dc757738bd12 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleProjectResolver.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleProjectResolver.java @@ -309,7 +309,7 @@ public class GradleProjectResolver implements ExternalSystemProjectResolver includedModules = exposeCompositeBuild(allModels, resolverCtx, projectDataNode); final Map, IdeaModule>> moduleMap = - new HashMap, IdeaModule>>(); + new HashMap<>(); final Map, ExternalSourceSet>> sourceSetsMap = new HashMap<>(); projectDataNode.putUserData(RESOLVED_SOURCE_SETS, sourceSetsMap); @@ -550,7 +550,7 @@ public class GradleProjectResolver implements ExternalSystemProjectResolver createExternalProjectsMap(@Nullable String compositePrefix, @Nullable final ExternalProject rootExternalProject) { - final Map externalProjectMap = new HashMap(); + final Map externalProjectMap = new HashMap<>(); if (rootExternalProject == null) return externalProjectMap; diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExecutionSettings.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExecutionSettings.java index 386886c05898..3f4647915d2b 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExecutionSettings.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExecutionSettings.java @@ -22,7 +22,7 @@ public class GradleExecutionSettings extends ExternalSystemExecutionSettings { @NotNull private final GradleExecutionWorkspace myExecutionWorkspace = new GradleExecutionWorkspace(); @NotNull private final List> myResolverExtensions = - new ArrayList>(); + new ArrayList<>(); @Nullable private final String myGradleHome; @Nullable private final String myServiceDirectory; diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleSettings.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleSettings.java index 387240c71557..cdddcf3877af 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleSettings.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleSettings.java @@ -146,7 +146,7 @@ public class GradleSettings extends AbstractExternalSystemSettings { - private final Set myProjectSettings = new TreeSet(); + private final Set myProjectSettings = new TreeSet<>(); @Override @XCollection(elementTypes = {GradleProjectSettings.class}) diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleUtil.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleUtil.java index eccdeabad8c8..e71bd672e95f 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleUtil.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleUtil.java @@ -167,7 +167,7 @@ public class GradleUtil { } File rootProjectParent = new File(rootProjectPath); StringBuilder buffer = new StringBuilder(FileUtil.toCanonicalPath(rootProjectParent.getAbsolutePath())); - Stack stack = new Stack(); + Stack stack = new Stack<>(); for (GradleProject p = subProject; p != null; p = p.getParent()) { stack.push(p.getName()); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightAnnotation.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightAnnotation.java index 933a72b2819d..b5b92f808fda 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightAnnotation.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/synthetic/GrLightAnnotation.java @@ -192,7 +192,7 @@ public class GrLightAnnotation extends LightElement implements GrAnnotation { } public void addAttribute(@NotNull GrAnnotationNameValuePair attribute) { - if (myAttributes == null) myAttributes = new ArrayList(); + if (myAttributes == null) myAttributes = new ArrayList<>(); myAttributes.add(attribute); myCachedAttributes = null; } diff --git a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java index 5a430c4fcefa..fe55feb71a2d 100644 --- a/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java +++ b/plugins/groovy/jps-plugin/src/org/jetbrains/jps/incremental/groovy/ForkedGroovyc.java @@ -60,7 +60,7 @@ class ForkedGroovyc implements GroovycFlavor { JpsGroovySettings settings = JpsGroovycRunner.getGroovyCompilerSettings(context); - List vmParams = new ArrayList(); + List vmParams = new ArrayList<>(); vmParams.add("-Xmx" + System.getProperty("groovyc.heap.size", String.valueOf(Utils.suggestForkedCompilerHeapSize())) + "m"); vmParams.add("-Dfile.encoding=" + System.getProperty("file.encoding")); //vmParams.add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5239"); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/ConvertParameterToMapEntryIntention.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/ConvertParameterToMapEntryIntention.java index 974e9a219198..e3b65479be37 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/ConvertParameterToMapEntryIntention.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/parameterToEntry/ConvertParameterToMapEntryIntention.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.plugins.groovy.intentions.style.parameterToEntry; import com.intellij.openapi.application.ApplicationManager; @@ -417,7 +417,7 @@ public class ConvertParameterToMapEntryIntention extends Intention { .message("find.method.ro.closure.usages.0", owner instanceof GrClosableBlock ? CLOSURE_CAPTION : METHOD_CAPTION), true) { @Override public void run(@NotNull final ProgressIndicator indicator) { - final Collection references = Collections.synchronizedSet(new HashSet()); + final Collection references = Collections.synchronizedSet(new HashSet<>()); final Processor consumer = psiReference -> { references.add(psiReference); return true; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/GrIntroduceHandlerBase.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/GrIntroduceHandlerBase.java index 3e329fa5ddd8..37a896ac2e27 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/GrIntroduceHandlerBase.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/GrIntroduceHandlerBase.java @@ -422,7 +422,7 @@ public abstract class GrIntroduceHandlerBase list = Collections.synchronizedList(new ArrayList()); + final List list = Collections.synchronizedList(new ArrayList<>()); if (scope instanceof GroovyScriptClass) { scope = scope.getContainingFile(); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenArtifactUtil.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenArtifactUtil.java index f975a25210fd..6336fd5c792b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenArtifactUtil.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenArtifactUtil.java @@ -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 org.jetbrains.idea.maven.utils; import com.intellij.openapi.util.Comparing; @@ -39,7 +25,7 @@ public class MavenArtifactUtil { public static final String[] DEFAULT_GROUPS = new String[]{"org.apache.maven.plugins", "org.codehaus.mojo"}; public static final String MAVEN_PLUGIN_DESCRIPTOR = "META-INF/maven/plugin.xml"; - private static final Map ourPluginInfoCache = Collections.synchronizedMap(new THashMap()); + private static final Map ourPluginInfoCache = Collections.synchronizedMap(new THashMap<>()); @Nullable public static MavenPluginInfo readPluginInfo(File localRepository, MavenId mavenId) { diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java index c2246c380552..7571ceb5a25b 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-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.duplicatePropertyInspection; import com.intellij.codeInspection.*; @@ -123,8 +123,8 @@ public class DuplicatePropertyInspection extends GlobalSimpleInspectionTool { : MODULE_WITH_DEPENDENCIES ? GlobalSearchScope.moduleWithDependenciesScope(module) : GlobalSearchScope.projectScope(file.getProject()); - final Map> processedValueToFiles = Collections.synchronizedMap(new HashMap>()); - final Map> processedKeyToFiles = Collections.synchronizedMap(new HashMap>()); + final Map> processedValueToFiles = Collections.synchronizedMap(new HashMap<>()); + final Map> processedKeyToFiles = Collections.synchronizedMap(new HashMap<>()); final ProgressIndicator original = ProgressManager.getInstance().getProgressIndicator(); final ProgressIndicator progress = ProgressWrapper.wrap(original); ProgressManager.getInstance().runProcess(() -> { diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java index 57cc5bf95733..2ef9acbbf30f 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/ResourceBundleEditor.java @@ -286,7 +286,7 @@ public class ResourceBundleEditor extends UserDataHolderBase implements Document return; } - Stack toCheck = new Stack(); + Stack toCheck = new Stack<>(); toCheck.push(myStructureViewComponent.getTreeModel().getRoot()); while (!toCheck.isEmpty()) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnMapping.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnMapping.java index 322cfd9d9f4e..ce1baf8491aa 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnMapping.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnMapping.java @@ -20,7 +20,7 @@ public class SvnMapping { @NotNull private final List myLonelyRoots = new ArrayList<>(); @NotNull private final TreeMap myFile2UrlMap = new TreeMap<>(FILE_PATHS_COMPARATOR); - @NotNull private final Map myUrl2FileMap = new HashMap(); + @NotNull private final Map myUrl2FileMap = new HashMap<>(); // no additional info. for caching only (convert roots) @NotNull private final ClearableLazyValue> myPreCalculatedUnderVcsRoots = new ClearableLazyValue>() { @NotNull diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java index 956804212b87..6b3882293a33 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java @@ -96,7 +96,7 @@ public class ToBeMergedDialog extends DialogWrapper { myRevisionsModel = new ListTableModel<>(new ColumnInfo[]{FAKE_COLUMN}, changeLists); myPanel = new JPanel(new BorderLayout()); myWiseSelection = new QuantitySelection<>(allStatusesCalculated); - myAlreadyMerged = new HashSet(); + myAlreadyMerged = new HashSet<>(); setOKButtonText("Merge Selected"); initUI(); init(); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java index 9ff720a7ad88..03e3a239a86d 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/treeConflict/MergeFromTheirsResolver.java @@ -94,8 +94,8 @@ public class MergeFromTheirsResolver extends BackgroundTaskGroup { myOldPresentation = TreeConflictRefreshablePanel.filePath(myOldFilePath); myNewPresentation = TreeConflictRefreshablePanel.filePath(myNewFilePath); - myTheirsChanges = new ArrayList(); - myTheirsBinaryChanges = new ArrayList(); + myTheirsChanges = new ArrayList<>(); + myTheirsBinaryChanges = new ArrayList<>(); myTextPatches = emptyList(); } @@ -229,7 +229,7 @@ public class MergeFromTheirsResolver extends BackgroundTaskGroup { } private void applyBinaryChanges() throws VcsException { - List dirtyPaths = new ArrayList(); + List dirtyPaths = new ArrayList<>(); for (Change change : myTheirsBinaryChanges) { try { WriteAction.runAndWait(() -> { @@ -328,7 +328,7 @@ public class MergeFromTheirsResolver extends BackgroundTaskGroup { private List convertPaths(@NotNull List changes) throws VcsException { initAddOption(); - List result = new ArrayList(); + List result = new ArrayList<>(); for (Change change : changes) { if (isUnderOldDir(change, myOldFilePath)) { result diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/youtrack/YouTrackIntellisense.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/youtrack/YouTrackIntellisense.java index 75a1f2d476fe..5ce9a4c706ff 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/youtrack/YouTrackIntellisense.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/youtrack/YouTrackIntellisense.java @@ -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.tasks.youtrack; import com.intellij.openapi.diagnostic.Logger; @@ -66,7 +67,7 @@ public class YouTrackIntellisense { } private static final Map, Response> ourCache = - Collections.synchronizedMap(new SizeLimitedCache, Response>(CACHE_SIZE)); + Collections.synchronizedMap(new SizeLimitedCache<>(CACHE_SIZE)); @NotNull private static TextAttributes getAttributeByStyleClass(@NotNull String styleClass) { diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/editors/string/StringEditorDialog.java b/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/editors/string/StringEditorDialog.java index 8e3839aa9f5a..3e6fe1d1d93a 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/editors/string/StringEditorDialog.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/editors/string/StringEditorDialog.java @@ -185,7 +185,7 @@ public final class StringEditorDialog extends DialogWrapper{ } private static Collection findPropertyReferences(final Property property, final Module module) { - final Collection references = Collections.synchronizedList(new ArrayList()); + final Collection references = Collections.synchronizedList(new ArrayList<>()); ProgressManager.getInstance().runProcessWithProgressSynchronously( (Runnable)() -> ReferencesSearch.search(property).forEach(psiReference -> { PsiMethod method = PsiTreeUtil.getParentOfType(psiReference.getElement(), PsiMethod.class); diff --git a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/EDTGuard.java b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/EDTGuard.java index 6f8c08518589..9e5d6f76a064 100644 --- a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/EDTGuard.java +++ b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/EDTGuard.java @@ -150,7 +150,7 @@ class EDTGuard implements InvocationHandler { @NotNull public static T create(@NotNull final O target, final ProcessHandler process) { final Pair, LinkedBlockingQueue> queue = - Pair.create(new LinkedBlockingQueue(10), new LinkedBlockingQueue()); + Pair.create(new LinkedBlockingQueue<>(10), new LinkedBlockingQueue<>()); final Thread thread = new Thread("Async Invocation Thread for " + process) { @Override diff --git a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextBasedCache.java b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextBasedCache.java index 73a82908a3a1..284fb498a9c2 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextBasedCache.java +++ b/python/psi-api/src/com/jetbrains/python/psi/types/TypeEvalContextBasedCache.java @@ -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.jetbrains.python.psi.types; import com.intellij.psi.util.CachedValue; @@ -44,7 +30,7 @@ public final class TypeEvalContextBasedCache { */ public TypeEvalContextBasedCache(@NotNull final CachedValuesManager manager, @NotNull final Function valueProvider) { - myCachedMapStorage = manager.createCachedValue(new MapCreator(), false); + myCachedMapStorage = manager.createCachedValue(new MapCreator<>(), false); myProvider = valueProvider; } diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java index 7bbadc286393..9bbe9ec9570a 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.util.xml.impl; import com.intellij.openapi.diagnostic.Logger; @@ -212,7 +198,7 @@ public abstract class DomInvocationHandler pointer = SmartPointerManager.getInstance(myManager.getProject()).createSmartPsiElementPointer(tag); - return myManager.createStableValue(new StableCopyFactory(pointer, myType, getClass())); + return myManager.createStableValue(new StableCopyFactory<>(pointer, myType, getClass())); } return (T)createPathStableCopy(); } diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java index ef27498242ff..6805efc93068 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngNsDescriptor.java @@ -54,7 +54,7 @@ import java.util.*; public class RngNsDescriptor implements XmlNSDescriptorEx, Validator { private final Map> myDescriptorsMap = - Collections.synchronizedMap(new HashMap>()); + Collections.synchronizedMap(new HashMap<>()); private XmlFile myFile; private PsiElement myElement; diff --git a/xml/xml-analysis-impl/src/com/intellij/xml/util/TagSetRuleProvider.java b/xml/xml-analysis-impl/src/com/intellij/xml/util/TagSetRuleProvider.java index 6916ad134bcc..8b3edd4647fc 100644 --- a/xml/xml-analysis-impl/src/com/intellij/xml/util/TagSetRuleProvider.java +++ b/xml/xml-analysis-impl/src/com/intellij/xml/util/TagSetRuleProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.xml.util; import com.intellij.psi.xml.XmlTag; @@ -28,7 +14,7 @@ import java.util.Map; */ public abstract class TagSetRuleProvider extends XmlTagRuleProviderBase { - private final Map map = Collections.synchronizedMap(new HashMap()); + private final Map map = Collections.synchronizedMap(new HashMap<>()); @Nullable protected abstract String getNamespace(@NotNull XmlTag tag); diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java index 70f6e9b7f7dd..a5e3ff0abbcd 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/XmlNSDescriptorImpl.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-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.xml.impl.schema; import com.intellij.codeInsight.daemon.Validator; @@ -756,7 +742,7 @@ public class XmlNSDescriptorImpl implements XmlNSDescriptorEx,Validator createAndPutTypesCachedValueSimpleType(final XmlTag tag, final Pair pair) { final CachedValue value = CachedValuesManager.getManager(tag.getProject()).createCachedValue(() -> { final SimpleTypeDescriptor simpleTypeDescriptor = new SimpleTypeDescriptor(tag); - return new CachedValueProvider.Result(simpleTypeDescriptor, tag); + return new CachedValueProvider.Result<>(simpleTypeDescriptor, tag); }, false); myTypesMap.put(pair, value); return value;