diff --git a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java index c5c48b96cfd6..62948cb62279 100644 --- a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java +++ b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java @@ -466,14 +466,14 @@ final class ImageEditorUI extends JPanel implements DataProvider, CopyProvider, } else if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { return editor != null ? editor.getFile() : null; } else if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) { - return editor != null ? new VirtualFile[]{editor.getFile()} : new VirtualFile[]{}; + return editor != null ? new VirtualFile[]{editor.getFile()} : VirtualFile.EMPTY_ARRAY; } else if (CommonDataKeys.PSI_FILE.is(dataId)) { return getData(CommonDataKeys.PSI_ELEMENT.getName()); } else if (CommonDataKeys.PSI_ELEMENT.is(dataId)) { VirtualFile file = editor != null ? editor.getFile() : null; return file != null && file.isValid() ? PsiManager.getInstance(editor.getProject()).findFile(file) : null; } else if (LangDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) { - return editor != null ? new PsiElement[]{(PsiElement)getData(CommonDataKeys.PSI_ELEMENT.getName())} : new PsiElement[]{} ; + return editor != null ? new PsiElement[]{(PsiElement)getData(CommonDataKeys.PSI_ELEMENT.getName())} : PsiElement.EMPTY_ARRAY; } else if (PlatformDataKeys.COPY_PROVIDER.is(dataId) && copyPasteSupport != null) { return this; } else if (PlatformDataKeys.CUT_PROVIDER.is(dataId) && copyPasteSupport != null) { diff --git a/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java b/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java index 76058aabeaa9..00a684da7cd9 100644 --- a/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java +++ b/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -31,7 +31,6 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.Condition; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.search.PsiElementProcessor; @@ -176,7 +175,7 @@ public abstract class AbstractPatternBasedConfigurationProducer result = new ArrayList(); for (final PsiReference ref : methodReferences) { final PsiElement element = ref.getElement(); diff --git a/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperBaseProcessor.java b/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperBaseProcessor.java index 75c965f45ba2..ddf5952ca961 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperBaseProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperBaseProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -104,7 +104,8 @@ public abstract class ExtractSuperBaseProcessor extends TurnRefsToSuperProcessor @NotNull protected UsageInfo[] findUsages() { - PsiReference[] refs = ReferencesSearch.search(myClass, GlobalSearchScope.projectScope(myProject), false).toArray(new PsiReference[0]); + PsiReference[] refs = ReferencesSearch.search(myClass, GlobalSearchScope.projectScope(myProject), false).toArray( + PsiReference.EMPTY_ARRAY); final ArrayList result = new ArrayList(); detectTurnToSuperRefs(refs, result); final PsiPackage originalPackage = JavaDirectoryService.getInstance().getPackage(myClass.getContainingFile().getContainingDirectory()); diff --git a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java index 78844ee81153..2ac01c3cbad9 100644 --- a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -55,7 +55,6 @@ import com.intellij.refactoring.rename.RenameJavaVariableProcessor; import com.intellij.refactoring.util.*; import com.intellij.usageView.UsageInfo; import com.intellij.usageView.UsageViewDescriptor; -import com.intellij.util.Function; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.HashMap; import com.intellij.util.containers.MultiMap; @@ -1108,7 +1107,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor { if (isAccessedForWriting) { if (refVar.hasModifierProperty(PsiModifier.FINAL) || shouldBeFinal) return false; PsiReference[] refs = - ReferencesSearch.search(refVar, GlobalSearchScope.projectScope(myProject), false).toArray(new PsiReference[0]); + ReferencesSearch.search(refVar, GlobalSearchScope.projectScope(myProject), false).toArray(PsiReference.EMPTY_ARRAY); return refs.length == 1; //TODO: control flow } else { diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/LocalToFieldHandler.java b/java/java-impl/src/com/intellij/refactoring/introduceField/LocalToFieldHandler.java index 5d5f0f012f18..9060a78310c3 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceField/LocalToFieldHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceField/LocalToFieldHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -31,6 +31,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.PsiElementProcessor; import com.intellij.psi.search.searches.ReferencesSearch; +import com.intellij.psi.util.FileTypeUtils; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.HelpID; import com.intellij.refactoring.RefactoringBundle; @@ -40,7 +41,6 @@ import com.intellij.refactoring.util.EnumConstantsUtil; import com.intellij.refactoring.util.RefactoringUtil; import com.intellij.util.IncorrectOperationException; import com.intellij.util.VisibilityUtil; -import com.intellij.psi.util.FileTypeUtils; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -295,7 +295,7 @@ public abstract class LocalToFieldHandler { final boolean rebindNeeded2 = !myVariableName.equals(myFieldName) || myRebindNeeded; final PsiReference[] refs; if (rebindNeeded2) { - refs = ReferencesSearch.search(myLocal, GlobalSearchScope.projectScope(myProject), false).toArray(new PsiReference[0]); + refs = ReferencesSearch.search(myLocal, GlobalSearchScope.projectScope(myProject), false).toArray(PsiReference.EMPTY_ARRAY); } else { refs = null; diff --git a/java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodStaticProcessor.java b/java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodStaticProcessor.java index 906b809af879..bee75c86f492 100644 --- a/java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodStaticProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodStaticProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -35,7 +35,6 @@ import com.intellij.refactoring.util.CanonicalTypes; import com.intellij.refactoring.util.RefactoringUtil; import com.intellij.refactoring.util.javadoc.MethodJavaDocHelper; import com.intellij.usageView.UsageInfo; -import com.intellij.util.Consumer; import com.intellij.util.IncorrectOperationException; import com.intellij.util.VisibilityUtil; import com.intellij.util.containers.MultiMap; @@ -304,7 +303,7 @@ public class MakeMethodStaticProcessor extends MakeMethodOrClassStaticProcessor< PsiElement anchor = null; PsiExpressionList argList = null; - PsiExpression[] exprs = new PsiExpression[0]; + PsiExpression[] exprs = PsiExpression.EMPTY_ARRAY; if (parent instanceof PsiMethodCallExpression) { argList = ((PsiMethodCallExpression)parent).getArgumentList(); exprs = argList.getExpressions(); diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java index bc16d1e24792..c913417dfc3b 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHelper.java @@ -22,7 +22,6 @@ import com.intellij.codeInsight.intention.AddAnnotationFix; import com.intellij.lang.Language; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Key; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleSettings; @@ -552,7 +551,7 @@ public class JavaPullUpHelper implements PullUpHelper { } if (doLookup) { final PsiReference[] references = - ReferencesSearch.search(field, new LocalSearchScope(statement), false).toArray(new PsiReference[0]); + ReferencesSearch.search(field, new LocalSearchScope(statement), false).toArray(PsiReference.EMPTY_ARRAY); if (commonInitializerCandidate == null && references.length > 0) { return null; } diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpConflictsUtil.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpConflictsUtil.java index e36d976d0e07..9661961a1197 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpConflictsUtil.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpConflictsUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -155,7 +155,7 @@ public class PullUpConflictsUtil { ContainerUtil.addIfNotNull(checkModuleConflictsList, method.getTypeParameterList()); } RefactoringConflictsUtil.analyzeModuleConflicts(subclass.getProject(), checkModuleConflictsList, - new UsageInfo[0], targetRepresentativeElement, conflicts); + UsageInfo.EMPTY_ARRAY, targetRepresentativeElement, conflicts); final PsiFile psiFile = PsiTreeUtil.getParentOfType(subclass, PsiClassOwner.class); final boolean toDifferentPackage = !Comparing.strEqual(targetPackage.getQualifiedName(), diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveClassesOrPackagesHandler.java b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveClassesOrPackagesHandler.java index d114f9687745..18051c1aee3e 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveClassesOrPackagesHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/JavaMoveClassesOrPackagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -211,7 +211,7 @@ public class JavaMoveClassesOrPackagesHandler extends MoveHandlerDelegate { return; } final MoveClassesOrPackagesToNewDirectoryDialog dlg = - new MoveClassesOrPackagesToNewDirectoryDialog(directories[0], new PsiElement[0], false, callback) { + new MoveClassesOrPackagesToNewDirectoryDialog(directories[0], PsiElement.EMPTY_ARRAY, false, callback) { @Override protected BaseRefactoringProcessor createRefactoringProcessor(Project project, final PsiDirectory targetDirectory, diff --git a/java/java-impl/src/com/intellij/refactoring/psi/SearchUtils.java b/java/java-impl/src/com/intellij/refactoring/psi/SearchUtils.java index a5c73ca58fe2..570835ea90a8 100644 --- a/java/java-impl/src/com/intellij/refactoring/psi/SearchUtils.java +++ b/java/java-impl/src/com/intellij/refactoring/psi/SearchUtils.java @@ -31,7 +31,7 @@ public class SearchUtils{ public static Iterable findAllReferences(PsiElement element, SearchScope scope){ - return new ArrayIterable(ReferencesSearch.search(element, scope, true).toArray(new PsiReference[0])); + return new ArrayIterable(ReferencesSearch.search(element, scope, true).toArray(PsiReference.EMPTY_ARRAY)); /* try { Class searchClass = Class.forName("com.intellij.psi.search.searches.ReferencesSearch"); @@ -59,12 +59,12 @@ public class SearchUtils{ } public static Iterable findOverridingMethods(PsiMethod method){ - return new ArrayIterable(OverridingMethodsSearch.search(method).toArray(new PsiMethod[0])); + return new ArrayIterable(OverridingMethodsSearch.search(method).toArray(PsiMethod.EMPTY_ARRAY)); // return OverridingMethodsSearch.search(method, method.getUseScope(), true).findAll(); } public static Iterable findClassInheritors(PsiClass aClass, boolean deep){ - return new ArrayIterable(ClassInheritorsSearch.search(aClass, deep).toArray(new PsiClass[0])); + return new ArrayIterable(ClassInheritorsSearch.search(aClass, deep).toArray(PsiClass.EMPTY_ARRAY)); // return ClassInheritorsSearch.search(aClass, deep); } diff --git a/java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderViewDescriptor.java b/java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderViewDescriptor.java index e58a9df62bc0..a593a37b86ca 100644 --- a/java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderViewDescriptor.java +++ b/java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderViewDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -28,7 +28,7 @@ public class ReplaceConstructorWithBuilderViewDescriptor extends UsageViewDescri @NotNull public PsiElement[] getElements() { - return new PsiElement[0]; + return PsiElement.EMPTY_ARRAY; } public String getProcessedElementsHeader() { diff --git a/java/java-impl/src/com/intellij/refactoring/tempWithQuery/TempWithQueryHandler.java b/java/java-impl/src/com/intellij/refactoring/tempWithQuery/TempWithQueryHandler.java index 9a3f209ed2dd..c13857137bc2 100644 --- a/java/java-impl/src/com/intellij/refactoring/tempWithQuery/TempWithQueryHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/tempWithQuery/TempWithQueryHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -79,7 +79,8 @@ public class TempWithQueryHandler implements RefactoringActionHandler { return; } - final PsiReference[] refs = ReferencesSearch.search(local, GlobalSearchScope.projectScope(project), false).toArray(new PsiReference[0]); + final PsiReference[] refs = ReferencesSearch.search(local, GlobalSearchScope.projectScope(project), false).toArray( + PsiReference.EMPTY_ARRAY); if (refs.length == 0) { String message = RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("variable.is.never.used", localName)); diff --git a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperProcessor.java b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperProcessor.java index 44eed8588c59..6e43ed29c005 100644 --- a/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -68,7 +68,8 @@ public class TurnRefsToSuperProcessor extends TurnRefsToSuperProcessorBase { @NotNull protected UsageInfo[] findUsages() { - final PsiReference[] refs = ReferencesSearch.search(myClass, GlobalSearchScope.projectScope(myProject), false).toArray(new PsiReference[0]); + final PsiReference[] refs = ReferencesSearch.search(myClass, GlobalSearchScope.projectScope(myProject), false).toArray( + PsiReference.EMPTY_ARRAY); final ArrayList result = detectTurnToSuperRefs(refs, new ArrayList()); diff --git a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java index 3016555b1e95..ec9dd94b0e43 100644 --- a/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java +++ b/java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationLabeler.java @@ -823,7 +823,8 @@ public class TypeMigrationLabeler { } public PsiReference[] markRootUsages(final PsiElement element, final PsiType migrationType) { - return markRootUsages(element, migrationType, ReferencesSearch.search(element, myRules.getSearchScope(), false).toArray(new PsiReference[0])); + return markRootUsages(element, migrationType, ReferencesSearch.search(element, myRules.getSearchScope(), false).toArray( + PsiReference.EMPTY_ARRAY)); } PsiReference[] markRootUsages(final PsiElement element, final PsiType migrationType, final PsiReference[] refs) { diff --git a/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceSearchingScanner.java b/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceSearchingScanner.java index 866198e009c7..5ab6fd5d69ae 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceSearchingScanner.java +++ b/java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassReferenceSearchingScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -30,7 +30,7 @@ public class ClassReferenceSearchingScanner extends ClassReferenceScanner { public PsiReference[] findReferences() { GlobalSearchScope projectScope = GlobalSearchScope.projectScope(myClass.getProject()); - return ReferencesSearch.search(myClass, projectScope, false).toArray(new PsiReference[0]); + return ReferencesSearch.search(myClass, projectScope, false).toArray(PsiReference.EMPTY_ARRAY); } } diff --git a/java/java-impl/src/com/intellij/slicer/SliceUtil.java b/java/java-impl/src/com/intellij/slicer/SliceUtil.java index 9f46cf8e0a22..a1a1785608cd 100644 --- a/java/java-impl/src/com/intellij/slicer/SliceUtil.java +++ b/java/java-impl/src/com/intellij/slicer/SliceUtil.java @@ -440,7 +440,7 @@ class SliceUtil { // for erased method calls for which we cannot determine target substitutor, // rely on call argument types. I.e. new Pair(1,2) -> Pair if (element instanceof PsiTypeParameterListOwner && PsiUtil.isRawSubstitutor((PsiTypeParameterListOwner)element, substitutor)) { - PsiTypeParameter[] typeParameters = substitutor.getSubstitutionMap().keySet().toArray(new PsiTypeParameter[0]); + PsiTypeParameter[] typeParameters = substitutor.getSubstitutionMap().keySet().toArray(PsiTypeParameter.EMPTY_ARRAY); PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(project).getResolveHelper(); substitutor = resolveHelper.inferTypeArguments(typeParameters, actualParameters, expressions, parentSubstitutor, argumentList, diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java index a996bb88c5d6..43bf3349a17e 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/PsiImportListImpl.java @@ -32,7 +32,7 @@ public class PsiImportListImpl extends JavaStubPsiElement imp private volatile Map myClassNameToImportMap; private volatile Map myPackageNameToImportMap; private volatile Map myNameToSingleImportMap; - private static final PsiImportStatementBase[] EMPTY_ARRAY = new PsiImportStatementBase[0]; + private static final PsiImportStatementBase[] EMPTY_ARRAY = PsiImportStatementBase.EMPTY_ARRAY; private static final ArrayFactory ARRAY_FACTORY = new ArrayFactory() { @NotNull @Override diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java index 25f9e47a4a89..bac588d7ce9e 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java @@ -771,7 +771,7 @@ public class InferenceSession { restParamSubstitution = restParamSubstitution.put(typeParameters[i], parameter); } } - return initBounds(null, restParamSubstitution, capturedParams.toArray(new PsiTypeParameter[0])); + return initBounds(null, restParamSubstitution, capturedParams.toArray(PsiTypeParameter.EMPTY_ARRAY)); } return initBounds(null, typeParameters); } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/GenerateEquals15Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/GenerateEquals15Test.java index 8ea66c9fe7a2..be02e9c483c4 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/GenerateEquals15Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/GenerateEquals15Test.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.codeInsight; import com.intellij.codeInsight.generation.EqualsHashCodeTemplatesManager; @@ -13,12 +28,12 @@ public class GenerateEquals15Test extends GenerateEqualsTestCase { } public void testDifferentTypes() throws Exception { - doTest(Function.ID, Function.ID, fields -> new PsiField[0], true + doTest(Function.ID, Function.ID, fields -> PsiField.EMPTY_ARRAY, true ); } public void testDifferentTypesGetters() throws Exception { - doTest(Function.ID, Function.ID, fields -> new PsiField[0], true, true); + doTest(Function.ID, Function.ID, fields -> PsiField.EMPTY_ARRAY, true, true); } public void testDifferentTypesAllNotNull() throws Exception { diff --git a/java/java-tests/testSrc/com/intellij/find/findUsages/FindParameterTest.java b/java/java-tests/testSrc/com/intellij/find/findUsages/FindParameterTest.java index 3113d8c096ae..350b887aad3e 100644 --- a/java/java-tests/testSrc/com/intellij/find/findUsages/FindParameterTest.java +++ b/java/java-tests/testSrc/com/intellij/find/findUsages/FindParameterTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.find.findUsages; import com.intellij.psi.*; @@ -25,7 +40,7 @@ public class FindParameterTest extends PsiTestCase { final PsiMethod methodFromText = elementFactory.createMethodFromText(text, null); final PsiParameter[] parameters = methodFromText.getParameterList().getParameters(); final PsiReference[] references = - ReferencesSearch.search(parameters[0], new LocalSearchScope(methodFromText), false).toArray(new PsiReference[0]); + ReferencesSearch.search(parameters[0], new LocalSearchScope(methodFromText), false).toArray(PsiReference.EMPTY_ARRAY); Assert.assertEquals(references.length, 2); } } diff --git a/java/java-tests/testSrc/com/intellij/psi/search/FindUsages15Test.java b/java/java-tests/testSrc/com/intellij/psi/search/FindUsages15Test.java index 45923fa78402..5e13cf868023 100644 --- a/java/java-tests/testSrc/com/intellij/psi/search/FindUsages15Test.java +++ b/java/java-tests/testSrc/com/intellij/psi/search/FindUsages15Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -16,7 +16,6 @@ package com.intellij.psi.search; import com.intellij.JavaTestUtil; -import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; @@ -47,12 +46,12 @@ public class FindUsages15Test extends PsiTestCase{ PsiMethod[] constructors = enumClass.getConstructors(); assertEquals(2, constructors.length); PsiReference[] references0 = - ReferencesSearch.search(constructors[0], GlobalSearchScope.moduleScope(myModule), false).toArray(new PsiReference[0]); + ReferencesSearch.search(constructors[0], GlobalSearchScope.moduleScope(myModule), false).toArray(PsiReference.EMPTY_ARRAY); assertEquals(2, references0.length); assertTrue(references0[0].getElement() instanceof PsiEnumConstant); assertTrue(references0[1].getElement() instanceof PsiEnumConstant); PsiReference[] references1 = - ReferencesSearch.search(constructors[1], GlobalSearchScope.moduleScope(myModule), false).toArray(new PsiReference[0]); + ReferencesSearch.search(constructors[1], GlobalSearchScope.moduleScope(myModule), false).toArray(PsiReference.EMPTY_ARRAY); assertEquals(1, references1.length); assertTrue(references1[0].getElement() instanceof PsiEnumConstant); } diff --git a/java/java-tests/testSrc/com/intellij/psi/search/SearchInLibsTest.java b/java/java-tests/testSrc/com/intellij/psi/search/SearchInLibsTest.java index f21cac838046..8dcb983beb9f 100644 --- a/java/java-tests/testSrc/com/intellij/psi/search/SearchInLibsTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/search/SearchInLibsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -148,7 +148,7 @@ public class SearchInLibsTest extends PsiTestCase { final PsiClass aClass = myJavaFacade.findClass(classNameToSearch); assertNotNull(aClass); - PsiReference[] refs = ReferencesSearch.search(aClass, scope, false).toArray(new PsiReference[0]); + PsiReference[] refs = ReferencesSearch.search(aClass, scope, false).toArray(PsiReference.EMPTY_ARRAY); ArrayList files = new ArrayList<>(); for (PsiReference ref : refs) { diff --git a/java/java-tests/testSrc/com/intellij/psi/search/UpdateCacheTest.java b/java/java-tests/testSrc/com/intellij/psi/search/UpdateCacheTest.java index 602d42e50bcb..be33b6f07a5c 100644 --- a/java/java-tests/testSrc/com/intellij/psi/search/UpdateCacheTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/search/UpdateCacheTest.java @@ -45,13 +45,15 @@ import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.PsiTestCase; import com.intellij.testFramework.PsiTestUtil; import com.intellij.util.ArrayUtil; -import com.intellij.util.Processor; import com.intellij.util.indexing.FileBasedIndex; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; @PlatformTestCase.WrapInCommand public class UpdateCacheTest extends PsiTestCase { @@ -406,7 +408,8 @@ public class UpdateCacheTest extends PsiTestCase { } private void checkUsages(PsiElement element, @NonNls String[] expectedFiles){ - PsiReference[] refs = ReferencesSearch.search(element, GlobalSearchScope.projectScope(myProject), false).toArray(new PsiReference[0]); + PsiReference[] refs = ReferencesSearch.search(element, GlobalSearchScope.projectScope(myProject), false).toArray( + PsiReference.EMPTY_ARRAY); List files = new ArrayList(); for (PsiReference ref : refs) { diff --git a/platform/core-impl/src/com/intellij/mock/MockFileDocumentManagerImpl.java b/platform/core-impl/src/com/intellij/mock/MockFileDocumentManagerImpl.java index 1d7e03624708..ecbb31c6f3b1 100644 --- a/platform/core-impl/src/com/intellij/mock/MockFileDocumentManagerImpl.java +++ b/platform/core-impl/src/com/intellij/mock/MockFileDocumentManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -86,7 +86,7 @@ public class MockFileDocumentManagerImpl extends FileDocumentManager { @Override @NotNull public Document[] getUnsavedDocuments() { - return new Document[0]; + return Document.EMPTY_ARRAY; } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java index 310ff333b511..131813271daf 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -268,7 +268,7 @@ public class FoldingUpdate { ", PSI element range: " + psiElement.getTextRange() + "; " + DebugUtil.diagnosePsiDocumentInconsistency(psiElement, document); LOG.error(message, ApplicationManager.getApplication().isInternal() ? new Attachment[]{AttachmentFactory.createAttachment(document), new Attachment("psiTree.txt", DebugUtil.psiToString(file, false, true))} - : new Attachment[0]); + : Attachment.EMPTY_ARRAY); } public static class FoldingMap extends MultiMap{ diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java index 48665d43dc44..038a85eb921f 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -153,7 +153,7 @@ public class ShowImplementationsAction extends AnAction implements PopupAction { } String text = ""; - PsiElement[] impls = new PsiElement[0]; + PsiElement[] impls = PsiElement.EMPTY_ARRAY; if (element != null) { //if (element instanceof PsiPackage) return; diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index fd128febf667..90423eb0b4fe 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -736,7 +736,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp @Nullable @Override public CommonProblemDescriptor[] getDescriptions(@NotNull RefEntity refEntity) { - return new CommonProblemDescriptor[0]; + return CommonProblemDescriptor.EMPTY_ARRAY; } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java index 808be6971b2b..844438f5f1a0 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -415,7 +415,7 @@ public class DefaultInspectionToolPresentation implements ProblemDescriptionsPro public void ignoreCurrentElementProblem(RefEntity refEntity, CommonProblemDescriptor descriptor) { CommonProblemDescriptor[] descriptors = getIgnoredElements().get(refEntity); if (descriptors == null) { - descriptors = new CommonProblemDescriptor[0]; + descriptors = CommonProblemDescriptor.EMPTY_ARRAY; } getIgnoredElements().put(refEntity, ArrayUtil.append(descriptors, descriptor)); } diff --git a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/DefaultLanguageColorsPage.java b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/DefaultLanguageColorsPage.java index f7e413fe010e..22c78ac45401 100644 --- a/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/DefaultLanguageColorsPage.java +++ b/platform/lang-impl/src/com/intellij/openapi/options/colors/pages/DefaultLanguageColorsPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -243,7 +243,7 @@ public class DefaultLanguageColorsPage implements ColorSettingsPage, DisplayPrio @NotNull @Override public ColorDescriptor[] getColorDescriptors() { - return new ColorDescriptor[0]; + return ColorDescriptor.EMPTY_ARRAY; } @NotNull diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/FindDependencyUtil.java b/platform/lang-impl/src/com/intellij/packageDependencies/FindDependencyUtil.java index 888fb38b1b3e..4cd358cc8ca1 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/FindDependencyUtil.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/FindDependencyUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -80,7 +80,7 @@ public class FindDependencyUtil { } } deps.retainAll(searchIn); - if (deps.isEmpty()) return new UsageInfo[0]; + if (deps.isEmpty()) return UsageInfo.EMPTY_ARRAY; int totalCount = deps.size(); int count = 0; diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesUsagesPanel.java b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesUsagesPanel.java index c2ee176db7a3..73fd993f4299 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesUsagesPanel.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesUsagesPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -32,9 +32,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiUtilCore; import com.intellij.usageView.UsageInfo; -import com.intellij.util.Consumer; -import javax.swing.*; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -68,7 +66,7 @@ public class DependenciesUsagesPanel extends UsagesPanel { myCurrentProgress = progress; ProgressManager.getInstance().runProcess(() -> { ApplicationManager.getApplication().runReadAction(() -> { - UsageInfo[] usages = new UsageInfo[0]; + UsageInfo[] usages = UsageInfo.EMPTY_ARRAY; Set elementsToSearch = null; try { diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/DummyProject.java b/platform/platform-impl/src/com/intellij/openapi/command/impl/DummyProject.java index 5f1e4ddc5c43..928b8cc55784 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/DummyProject.java +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/DummyProject.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -144,7 +144,7 @@ public class DummyProject extends UserDataHolderBase implements Project { @NotNull public ComponentConfig[] getComponentConfigurations() { - return new ComponentConfig[0]; + return ComponentConfig.EMPTY_ARRAY; } @Nullable diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java index 7be3c01b2d45..6edb5b52e4e5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -89,7 +89,7 @@ public class KeymapImpl extends ExternalizableSchemeAdapter implements Keymap { private Map> myMouseShortcut2ListOfIds = null; // TODO[vova,anton] it should be final member - private static final Shortcut[] ourEmptyShortcutsArray = new Shortcut[0]; + private static final Shortcut[] ourEmptyShortcutsArray = Shortcut.EMPTY_ARRAY; private final List myListeners = ContainerUtil.createLockFreeCopyOnWriteList(); private KeymapManagerEx myKeymapManager; diff --git a/platform/platform-impl/src/com/intellij/openapi/options/SchemeImportUtil.java b/platform/platform-impl/src/com/intellij/openapi/options/SchemeImportUtil.java index 56dda7dc59f4..5775fe88c3b2 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/SchemeImportUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/SchemeImportUtil.java @@ -58,7 +58,7 @@ public class SchemeImportUtil { preselectFiles[0] = preselect; } else { - preselectFiles = new VirtualFile[0]; + preselectFiles = VirtualFile.EMPTY_ARRAY; } final VirtualFile[] virtualFiles = fileChooser.choose(null, preselectFiles); //CodeStyleSchemesUIConfiguration.Util.getRecentImportFile()); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java index 333df7656066..79e3a5bf9661 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java @@ -26,12 +26,14 @@ import com.intellij.psi.PsiLanguageInjectionHost; import com.intellij.psi.impl.source.tree.CompositeElement; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; -import com.intellij.util.ThrowableRunnable; import com.intellij.util.containers.HashSet; import gnu.trove.THashMap; import gnu.trove.TObjectIntHashMap; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; /** * @author gregsh @@ -149,7 +151,7 @@ public class IElementTypeTest extends LightPlatformCodeInsightFixtureTestCase { public void testInitialRegisterPerformance() { PlatformTestUtil.startPerformanceTest("IElementType add", 100, () -> { Language language = Language.ANY; - IElementType[] old = IElementType.push(new IElementType[0]); + IElementType[] old = IElementType.push(IElementType.EMPTY_ARRAY); try { for (short i = 0; i < 15000; i++) { IElementType type = new IElementType("i " + i, language); diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java index 11ec56ee91e2..97f24e7dd8c8 100644 --- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -22,7 +22,6 @@ import com.intellij.testFramework.LightPlatformTestCase; import com.intellij.usages.*; import com.intellij.usages.rules.UsageFilteringRule; import com.intellij.usages.rules.UsageGroupingRule; -import com.intellij.util.Consumer; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; @@ -261,7 +260,7 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { @Override @NotNull public TextChunk[] getText() { - return new TextChunk[0]; + return TextChunk.EMPTY_ARRAY; } @Override diff --git a/platform/testFramework/src/com/intellij/mock/Mock.java b/platform/testFramework/src/com/intellij/mock/Mock.java index 89a0106fff6a..40ac16d280d0 100644 --- a/platform/testFramework/src/com/intellij/mock/Mock.java +++ b/platform/testFramework/src/com/intellij/mock/Mock.java @@ -256,7 +256,7 @@ public class Mock { @Override @NotNull public VirtualFile[] getSiblings(@NotNull VirtualFile file) { - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } @Override @@ -352,13 +352,13 @@ public class Mock { @Override @NotNull public VirtualFile[] getOpenFiles() { - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } @Override @NotNull public VirtualFile[] getSelectedFiles() { - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } @Override @@ -484,7 +484,7 @@ public class Mock { @Override public VirtualFile[] getChildren() { - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } @NotNull diff --git a/platform/testFramework/src/com/intellij/testFramework/ProjectViewTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/ProjectViewTestUtil.java index 548c312614d4..2156daa9e096 100644 --- a/platform/testFramework/src/com/intellij/testFramework/ProjectViewTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/ProjectViewTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -59,7 +59,7 @@ public class ProjectViewTestUtil { return result; } } - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } public static void collect(AbstractTreeNode node, diff --git a/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java b/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java index 0e6e48c65c37..ececeb24c9d9 100644 --- a/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java +++ b/plugins/git4idea/src/git4idea/history/GitHistoryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -65,7 +65,7 @@ public class GitHistoryProvider implements VcsHistoryProviderEx, VcsCacheableHis } public VcsDependentHistoryComponents getUICustomization(final VcsHistorySession session, JComponent forShortcutRegistration) { - return VcsDependentHistoryComponents.createOnlyColumns(new ColumnInfo[0]); + return VcsDependentHistoryComponents.createOnlyColumns(ColumnInfo.EMPTY_ARRAY); } public AnAction[] getAdditionalActions(Runnable refresher) { diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java index 4fc79bc26283..5dec1ac81a36 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -110,7 +110,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase public void testCreateFromEmptyFiles() throws Throwable { List expected = new ArrayList(); - VirtualFile[] files = new VirtualFile[0]; + VirtualFile[] files = VirtualFile.EMPTY_ARRAY; List actual = GithubCreateGistAction.collectContents(myProject, null, null, files); diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleRerunFailedTestsAction.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleRerunFailedTestsAction.java index d1c894d73b04..f26953d12bf5 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleRerunFailedTestsAction.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/action/GradleRerunFailedTestsAction.java @@ -59,7 +59,7 @@ public class GradleRerunFailedTestsAction extends JavaRerunFailedTestsAction { @NotNull @Override public Module[] getModules() { - return new Module[0]; + return Module.EMPTY_ARRAY; } @Nullable diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java index 971d4ff5b1d1..86ac333f3a07 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/config/AbstractConfigUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -140,7 +140,7 @@ public abstract class AbstractConfigUtils { } public Library[] getProjectSDKLibraries(Project project) { - if (project == null || project.isDisposed()) return new Library[0]; + if (project == null || project.isDisposed()) return Library.EMPTY_ARRAY; final LibraryTable table = ProjectLibraryTable.getInstance(project); final List all = ContainerUtil.findAll(table.getLibraries(), LIB_SEARCH_CONDITION); return all.toArray(new Library[all.size()]); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java index 67b4250f41c3..69d5691d0472 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocFieldReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -108,7 +108,7 @@ public class GrDocFieldReferenceImpl extends GrDocMemberReferenceImpl implements } return candidates; } - return new ResolveResult[0]; + return ResolveResult.EMPTY_ARRAY; } } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java index c807d5628d2d..34f53c04ef58 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocMethodReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -118,7 +118,7 @@ public class GrDocMethodReferenceImpl extends GrDocMemberReferenceImpl implement resolved.processDeclarations(constructorProcessor, ResolveState.initial(), resolved, this); return ArrayUtil.mergeArrays(processor.getCandidates(), constructorProcessor.getCandidates()); } - return new ResolveResult[0]; + return ResolveResult.EMPTY_ARRAY; } @Override diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java index e5e0add0b99b..460324c46c62 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java @@ -317,7 +317,7 @@ public class PsiUtil { if (namedArgs.length > 0) { GrNamedArgument context = namedArgs[0]; - result.add(GrMapType.createFromNamedArgs(context, byShape ? new GrNamedArgument[0] : namedArgs)); + result.add(GrMapType.createFromNamedArgs(context, byShape ? GrNamedArgument.EMPTY_ARRAY : namedArgs)); } for (GrExpression expression : expressions) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/LibrariesUtil.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/LibrariesUtil.java index 5076e87faede..6a7e132d4e01 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/LibrariesUtil.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/LibrariesUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -39,7 +39,6 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.config.GroovyConfigUtils; import java.io.File; -import java.io.FilenameFilter; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -55,7 +54,7 @@ public class LibrariesUtil { } public static Library[] getLibrariesByCondition(final Module module, final Condition condition) { - if (module == null) return new Library[0]; + if (module == null) return Library.EMPTY_ARRAY; final ArrayList libraries = new ArrayList(); AccessToken accessToken = ApplicationManager.getApplication().acquireReadActionLock(); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/dynamicMembers/GrDynamicMethodImpl.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/dynamicMembers/GrDynamicMethodImpl.java index d1dead93a06b..478b9d8f8521 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/dynamicMembers/GrDynamicMethodImpl.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/util/dynamicMembers/GrDynamicMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -113,7 +113,7 @@ public class GrDynamicMethodImpl extends LightElement implements GrMethod { @Override @NotNull public PsiMethod[] findDeepestSuperMethods() { - return new PsiMethod[0]; + return PsiMethod.EMPTY_ARRAY; } @Override @@ -123,7 +123,7 @@ public class GrDynamicMethodImpl extends LightElement implements GrMethod { @Override public GrMember[] getMembers() { - return new GrMember[0]; + return GrMember.EMPTY_ARRAY; } @Override diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/CreateClassFix.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/CreateClassFix.java index 776b7777a240..6ed1bc3411b7 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/CreateClassFix.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/CreateClassFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -137,7 +137,7 @@ public abstract class CreateClassFix { method = (GrMethod)targetClass.addBefore(method, null); final PsiElement context = PsiTreeUtil.getParentOfType(refElement, PsiMethod.class, PsiClass.class, PsiFile.class); - IntentionUtils.createTemplateForMethod(argTypes, paramTypesExpressions, method, targetClass, new TypeConstraint[0], true, context); + IntentionUtils.createTemplateForMethod(argTypes, paramTypesExpressions, method, targetClass, TypeConstraint.EMPTY_ARRAY, true, context); } finally { writeLock.finish(); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyColorsAndFontsPage.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyColorsAndFontsPage.java index 1319b7e5161d..1437d6af8b75 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyColorsAndFontsPage.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/highlighter/GroovyColorsAndFontsPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -94,7 +94,7 @@ public class GroovyColorsAndFontsPage implements ColorSettingsPage { @Override @NotNull public ColorDescriptor[] getColorDescriptors() { - return new ColorDescriptor[0]; + return ColorDescriptor.EMPTY_ARRAY; } @Override diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/smartEnter/GroovySmartEnterProcessor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/smartEnter/GroovySmartEnterProcessor.java index b79d652a826d..e52fb2c6953c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/smartEnter/GroovySmartEnterProcessor.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/smartEnter/GroovySmartEnterProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -194,7 +194,7 @@ public class GroovySmartEnterProcessor extends SmartEnterProcessorWithFixers { private static PsiElement[] getChildren(PsiElement element) { PsiElement psiChild = element.getFirstChild(); - if (psiChild == null) return new PsiElement[0]; + if (psiChild == null) return PsiElement.EMPTY_ARRAY; List result = new ArrayList(); while (psiChild != null) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/memberPullUp/GrPullUpConflictsUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/memberPullUp/GrPullUpConflictsUtil.java index 5692e834cec0..5bb58006d9cd 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/memberPullUp/GrPullUpConflictsUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/memberPullUp/GrPullUpConflictsUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -144,7 +144,7 @@ public class GrPullUpConflictsUtil { ContainerUtil.addIfNotNull(checkModuleConflictsList, method.getReturnTypeElement()); ContainerUtil.addIfNotNull(checkModuleConflictsList, method.getTypeParameterList()); } - GrRefactoringConflictsUtil.analyzeModuleConflicts(subclass.getProject(), checkModuleConflictsList, new UsageInfo[0], targetRepresentativeElement, conflicts); + GrRefactoringConflictsUtil.analyzeModuleConflicts(subclass.getProject(), checkModuleConflictsList, UsageInfo.EMPTY_ARRAY, targetRepresentativeElement, conflicts); final String fqName = subclass.getQualifiedName(); final String packageName; if (fqName != null) { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java index 13600b9c029d..a4625d4af521 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java @@ -57,7 +57,7 @@ public class HgHistoryProvider implements VcsHistoryProvider { public VcsDependentHistoryComponents getUICustomization(VcsHistorySession session, JComponent forShortcutRegistration) { - return VcsDependentHistoryComponents.createOnlyColumns(new ColumnInfo[0]); + return VcsDependentHistoryComponents.createOnlyColumns(ColumnInfo.EMPTY_ARRAY); } public AnAction[] getAdditionalActions(Runnable runnable) { diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxNamespaceDescriptor.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxNamespaceDescriptor.java index f6cdd51a0807..d2c8bfd0e1ae 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxNamespaceDescriptor.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxNamespaceDescriptor.java @@ -11,7 +11,6 @@ import com.intellij.psi.xml.XmlDocument; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import com.intellij.util.ArrayUtil; -import com.intellij.util.Processor; import com.intellij.xml.XmlElementDescriptor; import com.intellij.xml.XmlNSDescriptor; import org.jetbrains.annotations.NotNull; @@ -59,7 +58,7 @@ public class JavaFxNamespaceDescriptor implements XmlNSDescriptor, Validator { final Runnable callCleanupWorker = new Runnable() { public void run() { if (myProject.isDisposed()) return; - new CleanupWorker(new VirtualFile[]{}, myProject, "action.Subversion.cleanup.progress.title") { + new CleanupWorker(VirtualFile.EMPTY_ARRAY, myProject, "action.Subversion.cleanup.progress.title") { @Override protected void chanceToFillRoots() { final List infos = getAllWcInfos(); diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedNativeTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedNativeTest.java index 5143b76be991..a279d2deecbe 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedNativeTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedNativeTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.idea.svn; import com.intellij.openapi.fileEditor.impl.LoadTextUtil; @@ -78,7 +93,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -104,7 +119,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -129,7 +144,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -161,7 +176,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s2.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -197,7 +212,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { Assert.assertEquals(SubTree.ourS1Contents, text.toString()); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -220,7 +235,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.myRootDir, "target"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); for (VirtualFile file : files) { Assert.assertTrue(file.getPath(), clManager.isUnversioned(file)); @@ -263,7 +278,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.myTargetDir, "t15.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Nullable diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java index e13959d3a288..732b058e74f8 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnChangesCorrectlyRefreshedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -86,7 +86,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -112,7 +112,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -137,7 +137,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -169,7 +169,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s2.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -205,7 +205,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { Assert.assertEquals(SubTree.ourS1Contents, text.toString()); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -228,7 +228,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { assertVF(subTree.myRootDir, "target"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); for (VirtualFile file : files) { Assert.assertTrue(file.getPath(), clManager.isUnversioned(file)); @@ -271,7 +271,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn17TestCase { assertVF(subTree.myTargetDir, "t15.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Nullable diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedNativeTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedNativeTest.java index 6ffd3cef8cf8..54c751c42fb8 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedNativeTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedNativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -93,7 +93,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -119,7 +119,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -144,7 +144,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -176,7 +176,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.mySourceDir, "s2.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -212,7 +212,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { Assert.assertEquals(SubTree.ourS1Contents, text.toString()); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -235,7 +235,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.myRootDir, "target"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); for (VirtualFile file : files) { Assert.assertTrue(file.getPath(), clManager.isUnversioned(file)); @@ -278,7 +278,7 @@ public class SvnChangesCorrectlyRefreshedNativeTest extends Svn17TestCase { assertVF(subTree.myTargetDir, "t15.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Nullable diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedTest.java index 5bfe54fbf7ec..bb5080084984 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn16/SvnChangesCorrectlyRefreshedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -112,7 +112,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -138,7 +138,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -163,7 +163,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { assertVF(subTree.mySourceDir, "s1.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -195,7 +195,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { assertVF(subTree.mySourceDir, "s2.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -231,7 +231,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { Assert.assertEquals(SubTree.ourS1Contents, text.toString()); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Test @@ -254,7 +254,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { assertVF(subTree.myRootDir, "target"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); for (VirtualFile file : files) { Assert.assertTrue(file.getPath(), clManager.isUnversioned(file)); @@ -297,7 +297,7 @@ public class SvnChangesCorrectlyRefreshedTest extends Svn16TestCase { assertVF(subTree.myTargetDir, "t15.txt"); clManager.ensureUpToDate(false); - DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager); + DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager); } @Nullable diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/impl/LocalTaskImpl.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/impl/LocalTaskImpl.java index 0f96aed5c2f8..63eadd378ef8 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/impl/LocalTaskImpl.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/impl/LocalTaskImpl.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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 + * 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 + * 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. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.intellij.tasks.impl; @@ -47,7 +47,7 @@ public class LocalTaskImpl extends LocalTask { private String myId = ""; private String mySummary = ""; private String myDescription = null; - private Comment[] myComments = new Comment[0]; + private Comment[] myComments = Comment.EMPTY_ARRAY; private boolean myClosed = false; private Date myCreated; private Date myUpdated; diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/lighthouse/LighthouseRepository.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/lighthouse/LighthouseRepository.java index 61a50d5c9b3e..672479abc587 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/lighthouse/LighthouseRepository.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/lighthouse/LighthouseRepository.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.tasks.lighthouse; import com.intellij.openapi.diagnostic.Logger; @@ -158,7 +173,7 @@ public class LighthouseRepository extends BaseRepositoryImpl { @NotNull @Override public Comment[] getComments() { - return new Comment[0]; + return Comment.EMPTY_ARRAY; } @NotNull diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/trac/TracRepository.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/trac/TracRepository.java index ffcaa23a2168..153178dcf1b5 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/trac/TracRepository.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/trac/TracRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -148,7 +148,7 @@ public class TracRepository extends BaseRepositoryImpl { @NotNull @Override public Comment[] getComments() { - return new Comment[0]; + return Comment.EMPTY_ARRAY; } @NotNull diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java index dcfc7f0e5b67..fcd17ae4cb21 100644 --- a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java +++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -425,7 +425,7 @@ public class TaskVcsTest extends CodeInsightFixtureTestCase { @NotNull @Override public Comment[] getComments() { - return new Comment[0]; + return Comment.EMPTY_ARRAY; } @NotNull diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java index 16bd5ddec4b2..2165d1d1e92c 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -142,7 +142,7 @@ public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool { } } } - return problemDescriptors.toArray(new ProblemDescriptor[]{}); + return problemDescriptors.toArray(ProblemDescriptor.EMPTY_ARRAY); } private class GroupNameQuickFix implements LocalQuickFix { diff --git a/plugins/ui-designer-core/src/com/intellij/designer/model/EmptyXmlTag.java b/plugins/ui-designer-core/src/com/intellij/designer/model/EmptyXmlTag.java index f96cc95d91db..5260402a0420 100644 --- a/plugins/ui-designer-core/src/com/intellij/designer/model/EmptyXmlTag.java +++ b/plugins/ui-designer-core/src/com/intellij/designer/model/EmptyXmlTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * 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. @@ -76,7 +76,7 @@ public class EmptyXmlTag implements XmlTag { @NotNull @Override public XmlAttribute[] getAttributes() { - return new XmlAttribute[0]; + return XmlAttribute.EMPTY_ARRAY; } @Override @@ -125,19 +125,19 @@ public class EmptyXmlTag implements XmlTag { @NotNull @Override public XmlTag[] getSubTags() { - return new XmlTag[0]; + return XmlTag.EMPTY; } @NotNull @Override public XmlTag[] findSubTags(@NonNls String qname) { - return new XmlTag[0]; + return XmlTag.EMPTY; } @NotNull @Override public XmlTag[] findSubTags(@NonNls String localName, @NonNls String namespace) { - return new XmlTag[0]; + return XmlTag.EMPTY; } @Override @@ -185,13 +185,13 @@ public class EmptyXmlTag implements XmlTag { @NotNull @Override public XmlTagChild[] getChildren() { - return new XmlTagChild[0]; + return XmlTagChild.EMPTY_ARRAY; } @NotNull @Override public XmlText[] getTextElements() { - return new XmlText[0]; + return XmlText.EMPTY_ARRAY; } @NotNull @@ -287,7 +287,7 @@ public class EmptyXmlTag implements XmlTag { @NotNull @Override public PsiElement[] getChildren() { - return new PsiElement[0]; + return PsiElement.EMPTY_ARRAY; } @Override @@ -475,7 +475,7 @@ public class EmptyXmlTag implements XmlTag { @NotNull @Override public PsiReference[] getReferences() { - return new PsiReference[0]; + return PsiReference.EMPTY_ARRAY; } @Override diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathColorSettingsPage.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathColorSettingsPage.java index 491ac8dd250d..1473bbc4af72 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathColorSettingsPage.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathColorSettingsPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -65,7 +65,7 @@ public class XPathColorSettingsPage implements ColorSettingsPage { @NotNull public ColorDescriptor[] getColorDescriptors() { - return new ColorDescriptor[0]; + return ColorDescriptor.EMPTY_ARRAY; } @NotNull diff --git a/plugins/yaml/src/org/jetbrains/yaml/YAMLColorsPage.java b/plugins/yaml/src/org/jetbrains/yaml/YAMLColorsPage.java index 30c54292a437..a0a6291867c5 100644 --- a/plugins/yaml/src/org/jetbrains/yaml/YAMLColorsPage.java +++ b/plugins/yaml/src/org/jetbrains/yaml/YAMLColorsPage.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.jetbrains.yaml; import com.intellij.icons.AllIcons; @@ -46,7 +61,7 @@ public class YAMLColorsPage implements ColorSettingsPage { // Empty still private static final Map ADDITIONAL_HIGHLIGHT_DESCRIPTORS = new HashMap(); - private static final ColorDescriptor[] COLORS = new ColorDescriptor[0]; + private static final ColorDescriptor[] COLORS = ColorDescriptor.EMPTY_ARRAY; @Nullable public Map getAdditionalHighlightingTagToDescriptorMap() { diff --git a/python/ide/src/com/jetbrains/python/PyDirectoryIndexExcludePolicy.java b/python/ide/src/com/jetbrains/python/PyDirectoryIndexExcludePolicy.java index b5a671a5f28f..01dfbae6970b 100644 --- a/python/ide/src/com/jetbrains/python/PyDirectoryIndexExcludePolicy.java +++ b/python/ide/src/com/jetbrains/python/PyDirectoryIndexExcludePolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -56,6 +56,6 @@ public class PyDirectoryIndexExcludePolicy implements DirectoryIndexExcludePolic public VirtualFilePointer[] getExcludeRootsForModule(@NotNull ModuleRootModel rootModel) { - return new VirtualFilePointer[0]; + return VirtualFilePointer.EMPTY_ARRAY; } } diff --git a/python/openapi/src/com/jetbrains/python/psi/PyStringLiteralFileReferenceSet.java b/python/openapi/src/com/jetbrains/python/psi/PyStringLiteralFileReferenceSet.java index 2aacbc8735c1..8dbd96344776 100644 --- a/python/openapi/src/com/jetbrains/python/psi/PyStringLiteralFileReferenceSet.java +++ b/python/openapi/src/com/jetbrains/python/psi/PyStringLiteralFileReferenceSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -41,7 +41,8 @@ public class PyStringLiteralFileReferenceSet extends RootFileReferenceSet { } public PyStringLiteralFileReferenceSet(@NotNull PyStringLiteralExpression element, boolean caseSensitive) { - this(element.getStringValue(), element, element.getStringValueTextRange().getStartOffset(), null, caseSensitive, true, new FileType[0]); + this(element.getStringValue(), element, element.getStringValueTextRange().getStartOffset(), null, caseSensitive, true, + FileType.EMPTY_ARRAY); } public PyStringLiteralFileReferenceSet(@NotNull String str, diff --git a/python/python-community-configure/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java b/python/python-community-configure/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java index ed458a4e9938..f800d97e41bb 100644 --- a/python/python-community-configure/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java +++ b/python/python-community-configure/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -47,7 +47,6 @@ import com.intellij.remote.RemoteSdkAdditionalData; import com.intellij.ui.*; import com.intellij.ui.components.JBList; import com.intellij.util.NullableConsumer; -import com.intellij.util.NullableFunction; import com.intellij.util.PathMappingSettings; import com.intellij.util.containers.FactoryMap; import com.jetbrains.python.PyBundle; @@ -564,7 +563,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper { catch (Exception e) { LOG.error(e); } - return new VirtualFile[0]; + return VirtualFile.EMPTY_ARRAY; } @Override diff --git a/python/src/com/jetbrains/python/console/completion/PydevConsoleReference.java b/python/src/com/jetbrains/python/console/completion/PydevConsoleReference.java index 5fe819f323b3..6fb65ae80ca0 100644 --- a/python/src/com/jetbrains/python/console/completion/PydevConsoleReference.java +++ b/python/src/com/jetbrains/python/console/completion/PydevConsoleReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -59,7 +59,7 @@ public class PydevConsoleReference extends PsiPolyVariantReferenceBase result = Sets.newHashSet(); diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java index f5b2ba2c22dc..907375546361 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/DomHighlightingLiteTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -233,7 +233,7 @@ public class DomHighlightingLiteTest extends DomTestCase { public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, @NotNull final InspectionManager manager, final boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); - return new ProblemDescriptor[0]; + return ProblemDescriptor.EMPTY_ARRAY; } @Override @@ -266,7 +266,7 @@ public class DomHighlightingLiteTest extends DomTestCase { public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, @NotNull final InspectionManager manager, final boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); - return new ProblemDescriptor[0]; + return ProblemDescriptor.EMPTY_ARRAY; } @Override diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java index e3a23d3aa87a..73b4f74c7160 100644 --- a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java +++ b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractXmlBlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -232,7 +232,7 @@ public abstract class AbstractXmlBlock extends AbstractBlock { return collectSubTags((XmlElement)myNode.getPsi()); } else { - return new XmlTag[0]; + return XmlTag.EMPTY; } } diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java index a50c3a0ffea1..af9b1c90013d 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -98,7 +98,7 @@ public class AnyXmlElementDescriptor implements XmlElementDescriptor { @Override public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) { - return new XmlAttributeDescriptor[0]; + return XmlAttributeDescriptor.EMPTY; } @Override diff --git a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java index 63a0c2da0466..477953a89ee5 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -51,7 +51,7 @@ public class NullElementDescriptor implements XmlElementDescriptor { //todo: refactor to support full DTD spec @Override public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) { - return new XmlElementDescriptor[0]; + return XmlElementDescriptor.EMPTY_ARRAY; } @Override @@ -61,7 +61,7 @@ public class NullElementDescriptor implements XmlElementDescriptor { @Override public XmlAttributeDescriptor[] getAttributesDescriptors(final XmlTag context) { - return new XmlAttributeDescriptor[0]; + return XmlAttributeDescriptor.EMPTY; } @Override